I have:
-RaspberryPI with 433 and node red installed and fully working (I was able to install node-red-contrib-hass and the mqtt component, last is connecting fine, not sure about the contrib-hass)
-Windows 10 with Home Assistant and MQTT Broker running (with self signed CA! )
What Iām trying to do:
Get Node-Red to send info to HA and (me) be able to use it:
-I would like the 433 devices to pass the info to HASS through node-red.
ie: when my motion sensor(s) gets activated, to show on HA or be able to use it, like if motion sensor -> turn light (I know thatās doable with HA and the automation etc, my issue comes from getting the actual data from node-red to HA)
What I donāt understand is how node-red pass the info to HA and how I could use it, read it, etcā¦
I have read a lot of MQTT and node-red and tried looking for an example for node-red-contrib-hassā¦ even tried and error with connecting, etcā¦ broker the setup twice (probably got connected, but couldnāt figure what was going on)
Any help appreciated it.
EDIT: forgot to mention: I been using the ādebugā to read the messages coming in/out from serial and mqtt. Deleted to debug other issues at this point, but I could add it again.
Hi. Iām really interested to interface HA and Node-red. @Madpilot, could I have some more info by you about payload decoding you realized to parse the event coming from HA stream?
Thank you very much in advance.
I seem to be having trouble parsing the data being returned by eventsource. It looks like JSON data, but all my attempts to parse it fail. Could you please provide some guidance on the next steps for using eventsource? Maybe a function that leaves me with a javascript object I can use?
Sorry for taking so long to reply to everyone. @-mentioning @MadPilot doesnāt work - my username is all lower case.
@mkzimms Itās already parsed, you should just be able to treat it like a regular JS object.
@alpat59 The easiest way to work out the format is to attach a debug object to the output of the eventsource node, and look what gets produced. An example I just pulled looks like this:
The plugin I wrote is an input, not an output - I donāt use the node-red plugin.
My guess is though, you would need a glue function in between owntracks and Node Hass, as I doubt the output from owntracks is in the format that HASS is expecting (Which is why it is returning a 500 error)
Sorry guys,
Iām working very hard and I donāt have my developement platform available now. Just give me some time to build it again and Iāll try to have a look at it.
Thanks