Hi,
I have Home Assistant together with Node Red running. Normally I am using HA for GUI and for interconnecting to different Devices (Platforms) and Node Red for Automation.
I have a special system which has an API which I am quering via Node Red as this was the easiest way for me. It is a switch, so I can query the status and also change the value from 0 to 1 or back.
On Node Red I created an HTTP GET “http://192.168.1.220/api/1.0/datapoint/1/15/0/98/0” which delivers me a JSON Message. With JSON and “set msg.payload” I am extracting the needed value and sending it to MQTT.
On HA I am taking this MQTT and showing the Status of this Entity
The second part is to change the status of this switch (0/1). Therefore I created a HTTP PUT “http://192.168.1.220/api/1.0/datapoint” which I am feeding with an Inject “JSON” value “{“OID”:”/1/15/0/2/16/0",“value”:“1”}"
My question is now: I want to have a switch on HA to see the status of this switch and also have the option to change it. What would be the best approach?
Best Regards,
Johannes