HTTP DEVICE - parse XML response
HTTP DEVICE - parse XML response
I want to implement my Homematic bidcos devices as HTTP DEVICE in Z-WAY. Switching on and off works without any problems. What I have not solved yet, is the query of the current device status. As a return value, I get an XML response. I am still not sure which parse string I have to enter in the HTTP DEVICE property field "Inline Javascript to parse incoming data to 'on'/'off' strings", to get the right device status back to Z-Way.
----------------------------------------------
status check
----------------------------------------------
http://192.168.99.99/config/xmlapi/stat ... nt_id=4711
----------------------------------------------
Answer: Devive ON
----------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<state>
<datapoint value="true" ise_id="4711"/>
</state>
----------------------------------------------
Answer: Devive OFF
----------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<state>
<datapoint value="false" ise_id="4711"/>
</state>
I am grateful for every proposed solution.
Best regards
Bodo
raspberry pi3 with RaZberry (z-wave), raspberry pi2 as CCU (Homematic), Z-Way as frontend
Re: HTTP DEVICE - parse XML response
Hello,
I could solve the problem. I had to enter the following values in the two fields below:
"Inline Javascript to parse incoming data to 'on'/'off' strings" --> $$.findOne('/state/datapoint/@value') === 'true' ? 'on' : 'off'
"Interval in seconds between polling requests" --> 5
Best regards
Bodo
I could solve the problem. I had to enter the following values in the two fields below:
"Inline Javascript to parse incoming data to 'on'/'off' strings" --> $$.findOne('/state/datapoint/@value') === 'true' ? 'on' : 'off'
"Interval in seconds between polling requests" --> 5
Best regards
Bodo
raspberry pi3 with RaZberry (z-wave), raspberry pi2 as CCU (Homematic), Z-Way as frontend