i have an openremote based system running currently and i want to see if i can bring in the sensor values from it in Home Assistant. Openremote has an API that allows pulling data from it with HTTP calls, Below is an example of HTTP request and response. Is it possible to add these sensors in HA using these calls?
Home Assistant recently had some improvements regarding automatic conversion of XML to json in the restful integrations, so that should help you too, as the responses above appear to be XML.
Thanks. I read through those pages and have the following set up
The Device i am trying to bring in with HTTP in Home Assistant is a wall switch with On/ Off / Status
the sensor is bring in the status and updating periodically as expected but if showing the raw response as below. is there any way to parse that string and only display the actual “On” or “Off”
{"sensors": {"sensor": {"@name": "zooz dimmer a switch status", "#text": "on"}}}
With regards to the Switch, it is getting added to the UI as a toggle button.
When i press the button, it seems to only send the link in the "resource field in the switch configuration i have included above. I have wireshark running and i am looking at the messages. How / when does the body_on and body_off get sent?
Thanks unfortunately that did not work. I tried the following but it seems to be sending only the link in the “resource”. i also noticed it is sending this every 30 second (maybe as a keep alive) even when the button is not pressed.
When the button is pressed, it still send the same link in “resources”
body_on and body_off is not getting appended when the button is pressed / command is sent.
the switch is to send the on / off command. it is not updating the status as a switch by itself. I tried using co,and state but its really working- it actually makes it stuck in the ON state for some reason. So I am hoping to use a seperate sensor to pull the status which seems to work but need help figuring out how to display just the “on” / “off” instead of the complete json / xml response that is getting display currently.
i think it should be doable because it is getting formatted in a json table- but i am not able to figure out the correct may to just display the #text attribute.