Hi I am currently working on a project for my university and I am not really familiar with Node-RED, and Java Websockets.
Bascily the Project is a voice assistant:
you speak into a Rasspberry PI which runs Rhasspy(voice to text) -> creating intents -> which are send to Node-RED in Json format
Node-RED recieves intents in Json Format. -> send to Android App(jsut display data for now)
I want to get the data on my android Phone.
Right now I have my Rasspberry PI connected with my Node-RED server and I am sending "intents" which contain data in Json format this is working so far. For example I say: " how is the weather " -> I get via an input websocket: Intent: object
name: "weather"
.....
text: "how is the weather"
Now I want to get this data in Json format with my android(running Java and want to use Websockets(OkHttp) ) phone via websockets but I am not sure how to get it are there already any example on how to connect my phone to the Node-RED server and get the Json data?
My idea now:
Run a websocket client on my phone which connects to Node-RED:ws://......:1880
Create "output websocket" in Node-RED which sends payload(Json data) to my android
--> now jsut display text^^
Excuse my english is not my mother language
I appreciate any help and idea
What are you going to do with the data once you have it in the phone. Have you considered something like Telegram if you are just trying to get notifications?
Hi, once I get the data on my phone I want to build an URL with the recieved data for REST-API.
For example you ask "what food today in mensa" -> I build URL for example: https......./mensa/today -> and phone will be able to displlay JSON from Rest-API
Automate would do all that, no need to install node-red As said you can run a mqtt or http plugin or use google firebase messaging, and receive the data, Automate can display notification, dialogs or you can use Web dialogs and build your own html/javascript page. This would probably be less resource/battery hungry. Automate could also call your rest API
yes, I wrote already an APP hardcoded for Rest-API so far but want to switch it to the correct url with the recieved parameter from Node RED and Tasker so my app is more flexible and I get correct data on display