This page last changed on Nov 15, 2014 by aleksey_z.

Tell me, please, how to extract data (underlined in the screenshot).
The request looks like this: http://192.168.1.7:4020/admin/pass/data=devices
How will the regular expression to extract the data?


id2.jpg (image/jpeg)
id3.jpg (image/jpeg)
id2.jpg (image/jpeg)
id2.jpg (image/jpeg)
7Status.png (image/png)
On.jpg (image/jpeg)
Off.jpg (image/jpeg)
id3.jpg (image/jpeg)
var1.jpg (image/jpeg)
var2sens.jpg (image/jpeg)
var1sensres.jpg (image/jpeg)
var2.jpg (image/jpeg)
var2sens.jpg (image/jpeg)
var2sensres.jpg (image/jpeg)
id3.1.jpg (image/jpeg)
Off1.jpg (image/jpeg)
On1.jpg (image/jpeg)

1) Where does this apparant Z-Wave data come from? What do you intend to do with it?
2) The data presented here is an incomplete XML file. So without additional knowledge I think using XPATH would be more suited than trying RegEx.

Posted by pz1 at Nov 15, 2014 11:13

These data - the response from the SynoZwave API http://wiki.synozwave.com/index.php?title=Requ%C3%AAtes_HTTP

The command is:

Switch1.1 http://192.168.1.7:4020/admin/passw/data=devices&action=edit&deviceNum=3&valueNum=2&setValue=1 - on http://192.168.1.7:4020/admin/passw/data=devices&action=edit&deviceNum=3&valueNum=2&setValue=0 - off

I send them out Openremote and it works. I want to create a team to determine the Status 0/1 or True/False value for Switch1.1Sensor, as in the example with Razberry.

And I do not like I can choose to receive data from a query.

In IE11: edit 1 post

Posted by aleksey_z at Nov 15, 2014 11:42

I want to create a team to determine the Status

I quess you did use Google translate from Russian. What does team mean? Command?, Sensor?

Posted by pz1 at Nov 15, 2014 14:15

Yes, sorry for my english.
Meant command as in the example of Razberry. For Sensor.

Posted by aleksey_z at Nov 15, 2014 14:56

So can you please select and copy what you receive from your call and paste that here in a reply.
Place that inclosed on {code}..{code} tags so I does not get distorted. It will give me a better view on it with my own tools.

Posted by pz1 at Nov 15, 2014 15:23

In Google Chrome:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<?xml version="1.0" encoding="ISO-8859-1"?>
<Root>
<Response>
<Status/>
<ErrorCode/>
<ErrorMessage/>
</Response>
<Data>
<device id="2" type="Multilevel Power Switch" name="" location="" manufacturer="FIBARO System" product="FGD211 Universal Dimmer 500W" query_stage="Complete" time="1416225200">
<value id="1" genre="user" type="byte" class="SWITCH MULTILEVEL" instance="1" index="0" label="Level" units="" readonly="false" polled="false" value="0"/>
<value id="2" genre="user" type="button" class="SWITCH MULTILEVEL" instance="1" index="1" label="Bright" units="" readonly="false" polled="false" value="False"/>
<value id="3" genre="user" type="button" class="SWITCH MULTILEVEL" instance="1" index="2" label="Dim" units="" readonly="false" polled="false" value="False"/>
<value id="4" genre="config" type="list" class="CONFIGURATION" instance="1" index="1" label="1. Enable/Disable ALL ON/OFF" units="" readonly="false" count="4" current="ALL ON active / ALL OFF active">
<item>ALL ON disabled/ ALL OFF disabled</item>
<item>ALL ON disabled/ ALL OFF active</item>
<item>ALL ON active / ALL OFF disabled</item>
<item>ALL ON active / ALL OFF active</item>
<help>Activate/Deactive ALL ON/OFF</help>
</value>
<value id="5" genre="config" type="list" class="CONFIGURATION" instance="1" index="6" label="6. Separation of association sending (key 1)" units="" readonly="false" count="3" current="Map status to all devices in group 1 (default)">
<item>Map status to all devices in group 1 (default)</item>
<item>
Map OFF status to all devices in group 1, Double click on key 1 will send ON to all devices in group 1, all dimmers set to prev.value
</item>
<item>
Map OFF status to all devices in group 1, Double click on key 1 will send ON to all devices in group 1, all dimmers set to 100%
</item>
<help>
Activate/Deactivate association sending for group 1 - Note: Parameter 15 must set to 1 to work properly.
</help>
</value>
<value id="6" genre="config" type="list" class="CONFIGURATION" instance="1" index="7" label="7. Control key #2 behaviour" units="" readonly="false" count="2" current="Device status is checked">
<item>Device status is not checked</item>
<item>Device status is checked</item>
<help>
Key no.2 is not represented by any physical device except of devices on association list. This functionality prevents of lack of reaction on pressing key no.2 through polling devices from association list one by one and checking their actual statuses.
</help>
</value>
<value id="7" genre="config" type="byte" class="CONFIGURATION" instance="1" index="8" label="8. Dimming step at automatic control" units="%" readonly="false" value="1">
<help>Options for changing parameter 1-99</help>
</value>
<value id="8" genre="config" type="byte" class="CONFIGURATION" instance="1" index="9" label="9. Time of MANUALLY moving between the extreme dimming values" units="ms" readonly="false" value="5">
<help>Options for changing parameter 1-255 (10ms - 2,5s)</help>
</value>
<value id="9" genre="config" type="byte" class="CONFIGURATION" instance="1" index="10" label="10. Time of AUTOMATIC moving between the extreme dimming values" units="ms" readonly="false" value="1">
<help>
Options for changing parameter 1-255 (10ms - 2,5s) - 0: this value disables the smooth change in light intensity. NOTE: value 0 is required for inductive and capacitive devices unsuitable for dimming (e.g. fluorescent lamps, motors, etc...)
</help>
</value>
<value id="10" genre="config" type="byte" class="CONFIGURATION" instance="1" index="11" label="11. Dimming step at manual control" units="%" readonly="false" value="1">
<help>Options for changing parameter 1-99</help>
</value>
<value id="11" genre="config" type="byte" class="CONFIGURATION" instance="1" index="12" label="12. Maximum dimmer level control" units="%" readonly="false" value="99">
<help>Options for changing parameter 2-99</help>
</value>
<value id="12" genre="config" type="byte" class="CONFIGURATION" instance="1" index="13" label="13. Minimum dimmer level control" units="5" readonly="false" value="2">
<help>Options for changing parameter 1-98</help>
</value>
<value id="13" genre="config" type="list" class="CONFIGURATION" instance="1" index="14" label="14. Inputs Button/Switch configuration" units="" readonly="false" count="2" current="Mono-stable input (button)">
<item>Mono-stable input (button)</item>
<item>Bi-stable input (switch)</item>
<help>Binary inputs type configuration</help>
</value>
<value id="14" genre="config" type="list" class="CONFIGURATION" instance="1" index="15" label="15. Double click option" units="" readonly="false" count="2" current="Enable double click">
<item>Disable double click</item>
<item>Enable double click</item>
<help>Double-click set lighting at 100%</help>
</value>
<value id="15" genre="config" type="list" class="CONFIGURATION" instance="1" index="16" label="16. Saving state before power faillure" units="" readonly="false" count="2" current="State saved at power failure, all outputs are set to previous state upon power restore">
<item>
State NOT saved at power failure, all outputs are set to OFF upon power restore
</item>
<item>
State saved at power failure, all outputs are set to previous state upon power restore
</item>
<help>Saving state before power faillure</help>
</value>
<value id="16" genre="config" type="list" class="CONFIGURATION" instance="1" index="17" label="17. 3-way switch" units="" readonly="false" count="2" current="Disable">
<item>Disable</item>
<item>Enable</item>
<help>
The function of 3-way switch provides the option to double key no. 1. The dimmer may control two bi-stable push-buttons or an infinite number of mono-stable push-buttons. (default value 0)
</help>
</value>
<value id="17" genre="config" type="list" class="CONFIGURATION" instance="1" index="18" label="18. Synchronizing light level for associated devices" units="" readonly="false" count="2" current="Disable">
<item>Disable</item>
<item>Enable</item>
<help>
The dimmer communicate the level to the associated devices. (default value 0)
</help>
</value>
<value id="18" genre="config" type="list" class="CONFIGURATION" instance="1" index="19" label="19. Change [On-Off] bi-stable keys" units="" readonly="false" count="2" current="Disable">
<item>Disable</item>
<item>Enable</item>
<help>
This function allow user to change [On-Off] bi-stable keys (parameter no. 14) (default value 0)
</help>
</value>
<value id="19" genre="config" type="byte" class="CONFIGURATION" instance="1" index="20" label="20. ADVANCED Impulse length" units="" readonly="false" value="110">
<help>
This function will enable decreasing the minimum level of the Dimmer by extending the control impulse.[100 - 170] By changing the minimem level, the user may completely dim LED bulbs. Not all LED bulbs available on the market have the dimmming option. WARNING: Wrong setting of the function may cause incorrect operation of the Dimmer.
</help>
</value>
<value id="20" genre="config" type="list" class="CONFIGURATION" instance="1" index="30" label="30. Alarm" units="" readonly="false" count="4" current="ALARM FLASHING - device will turn ON and OFF periodically (see param.39)">
<item>DEACTIVATION - no response to alarm frames</item>
<item>
ALARM DIMMER ON - device turn ON upon receipt of alarm frame
</item>
<item>
ALARM DIMMER OFF - device will turn OFF upon receipt of alarm frame
</item>
<item>
ALARM FLASHING - device will turn ON and OFF periodically (see param.39)
</item>
<help>
Alarm of any type (general alarm, water flooding alarm, smoke alarm: CO, CO2, temperature alarm) défault value 3-alarm flashing
</help>
</value>
<value id="21" genre="config" type="short" class="CONFIGURATION" instance="1" index="39" label="39. ALARM FLASHING alarm time" units="s" readonly="false" value="600">
<help>
Amount of time the device keeps on flashing after receipt of Alarm Frame (1s-65535s)
</help>
</value>
<value id="22" genre="system" type="bool" class="SWITCH MULTILEVEL" instance="1" index="3" label="Ignore Start Level" units="" readonly="false" polled="false" value="True"/>
<value id="23" genre="system" type="byte" class="SWITCH MULTILEVEL" instance="1" index="4" label="Start Level" units="" readonly="false" polled="false" value="0"/>
<value id="24" genre="system" type="list" class="SWITCH ALL" instance="1" index="0" label="Switch All" units="" readonly="false" polled="false" count="4" current="On and Off Enabled">
<item>Disabled</item>
<item>Off Enabled</item>
<item>On Enabled</item>
<item>On and Off Enabled</item>
</value>
<value id="25" genre="system" type="list" class="POWERLEVEL" instance="1" index="0" label="Powerlevel" units="dB" readonly="false" polled="false" count="10" current="Normal">
<item>Normal</item>
<item>-1dB</item>
<item>-2dB</item>
<item>-3dB</item>
<item>-4dB</item>
<item>-5dB</item>
<item>-6dB</item>
<item>-7dB</item>
<item>-8dB</item>
<item>-9dB</item>
</value>
<value id="26" genre="system" type="byte" class="POWERLEVEL" instance="1" index="1" label="Timeout" units="seconds" readonly="false" polled="false" value="0"/>
<value id="27" genre="system" type="button" class="POWERLEVEL" instance="1" index="2" label="Set Powerlevel" units="" readonly="false" polled="false" value="False"/>
<value id="28" genre="system" type="byte" class="POWERLEVEL" instance="1" index="3" label="Test Node" units="" readonly="false" polled="false" value="0"/>
<value id="29" genre="system" type="list" class="POWERLEVEL" instance="1" index="4" label="Test Powerlevel" units="dB" readonly="false" polled="false" count="10" current="Normal">
<item>Normal</item>
<item>-1dB</item>
<item>-2dB</item>
<item>-3dB</item>
<item>-4dB</item>
<item>-5dB</item>
<item>-6dB</item>
<item>-7dB</item>
<item>-8dB</item>
<item>-9dB</item>
</value>
<value id="30" genre="system" type="byte" class="POWERLEVEL" instance="1" index="5" label="Frame Count" units="" readonly="false" polled="false" value="108"/>
<value id="31" genre="system" type="button" class="POWERLEVEL" instance="1" index="6" label="Test" units="" readonly="false" polled="false" value="False"/>
<value id="32" genre="system" type="button" class="POWERLEVEL" instance="1" index="7" label="Report" units="" readonly="false" polled="false" value="False"/>
<value id="33" genre="system" type="list" class="POWERLEVEL" instance="1" index="8" label="Test Status" units="" readonly="true" polled="false" count="3" current="Failed">
<item>Failed</item>
<item>Success</item>
<item>In Progress</item>
</value>
<value id="34" genre="system" type="byte" class="POWERLEVEL" instance="1" index="9" label="Acked Frames" units="" readonly="true" polled="false" value="61"/>
<value id="35" genre="system" type="string" class="VERSION" instance="1" index="0" label="Library Version" units="" readonly="true" polled="false" value="3"/>
<value id="36" genre="system" type="string" class="VERSION" instance="1" index="1" label="Protocol Version" units="" readonly="true" polled="false" value="3.52"/>
<value id="37" genre="system" type="string" class="VERSION" instance="1" index="2" label="Application Version" units="" readonly="true" polled="false" value="2.02"/>
<Associations>
<Association max_association="5" group_num="1" label="Group 1">
<node id="1"/>
</Association>
<Association max_association="5" group_num="2" label="Group 2">
<node id="1"/>
</Association>
<Association max_association="1" group_num="3" label="Controller Updates">
<node id="1"/>
</Association>
</Associations>
</device>
<device id="3" type="Binary Power Switch" name="" location="" manufacturer="FIBARO System" product="FGS221 Double Relay Switch 2x1.5kW" query_stage="Complete" time="1416225459">
<value id="1" genre="basic" type="byte" class="BASIC" instance="2" index="0" label="Basic" units="" readonly="false" polled="false" value="0"/>
<value id="2" genre="user" type="bool" class="SWITCH BINARY" instance="1" index="0" label="Switch1.1" units="" readonly="false" polled="false" value="False"/>
<value id="3" genre="user" type="bool" class="SWITCH BINARY" instance="2" index="0" label="Switch1.2" units="" readonly="false" polled="false" value="False"/>
<value id="4" genre="config" type="list" class="CONFIGURATION" instance="1" index="1" label="1. Enable/Disable ALL ON/OFF" units="" readonly="false" count="4" current="ALL ON active / ALL OFF active">
<item>ALL ON disabled/ ALL OFF disabled</item>
<item>ALL ON disabled/ ALL OFF active</item>
<item>ALL ON active / ALL OFF disabled</item>
<item>ALL ON active / ALL OFF active</item>
<help>Activate/Deactive ALL ON/OFF</help>
</value>
<value id="5" genre="config" type="list" class="CONFIGURATION" instance="1" index="3" label="3. Enable/Disable OFF-delay" units="" readonly="false" count="4" current="Auto OFF disabled for both relays">
<item>Auto OFF disabled for both relays</item>
<item>Auto OFF active only for relay 1</item>
<item>Auto OFF active only for relay 2</item>
<item>Auto OFF active for both relays</item>
<help>
Activate/Deactivate Automatic turning off relay after set time
</help>
</value>
<value id="6" genre="config" type="byte" class="CONFIGURATION" instance="1" index="4" label="4. Relay 1: OFF-delay time (10ms)" units="" readonly="false" value="20">
<help>
Automatic turning off relay 1 after set time, in 10ms increments (default: 200ms)
</help>
</value>
<value id="7" genre="config" type="byte" class="CONFIGURATION" instance="1" index="5" label="5. Relay 2: OFF-delay time (10ms)" units="" readonly="false" value="20">
<help>
Automatic turning off relay 2 after set time, in 10ms increments (default: 200ms)
</help>
</value>
<value id="8" genre="config" type="list" class="CONFIGURATION" instance="1" index="6" label="6. Separation of association sending (key 1)" units="" readonly="false" count="3" current="Map status to all devices in group 1 (default)">
<item>Map status to all devices in group 1 (default)</item>
<item>
Map OFF status to all devices in group 1, Double click on key 1 will send ON to all devices in group 1, all dimmers set to prev.value
</item>
<item>
Map OFF status to all devices in group 1, Double click on key 1 will send ON to all devices in group 1, all dimmers set to 100%
</item>
<help>
Activate/Deactivate association sending for group 1 - Also see param #16
</help>
</value>
<value id="9" genre="config" type="list" class="CONFIGURATION" instance="1" index="7" label="7. Control key #2 behaviour" units="" readonly="false" count="2" current="Device status is checked">
<item>Device status is not checked</item>
<item>Device status is checked</item>
<help>
Key no.2 is not represented by any physical device except of devices on association list. This functionality prevents of lack of reaction on pressing key no.2 through polling devices from association list one by one and checking their actual statuses.
</help>
</value>
<value id="10" genre="config" type="list" class="CONFIGURATION" instance="1" index="13" label="13. Inputs behaviour" units="" readonly="false" count="2" current="Toggle">
<item>Toggle</item>
<item>Follow switch contact (closed=ON, open=OFF)</item>
<help>
In case of bi-stable switches, define their behaviour (toggle or follow)
</help>
</value>
<value id="11" genre="config" type="list" class="CONFIGURATION" instance="1" index="14" label="14. Inputs Button/Switch configuration" units="" readonly="false" count="2" current="Bi-stable input (switch)">
<item>Mono-stable input (button)</item>
<item>Bi-stable input (switch)</item>
<help>Binary inputs type configuration</help>
</value>
<value id="12" genre="config" type="list" class="CONFIGURATION" instance="1" index="15" label="15. Dimmer/Roller shutter control" units="" readonly="false" count="2" current="Disable Dimmer/Roller shutter control">
<item>Disable Dimmer/Roller shutter control</item>
<item>Enable Dimmer/Roller shutter control</item>
<help>
Enable/Disable opoeration of dimmer or roller shutter devices associated to group 1. Available only when using mono-stable inputs (buttons) - Hold button 1 or double-tap for operation
</help>
</value>
<value id="13" genre="config" type="list" class="CONFIGURATION" instance="1" index="16" label="16. Saving state before power faillure" units="" readonly="false" count="2" current="State saved at power failure, all outputs are set to previous state upon power restore">
<item>
State NOT saved at power failure, all outputs are set to OFF upon power restore
</item>
<item>
State saved at power failure, all outputs are set to previous state upon power restore
</item>
<help>Saving state before power faillure</help>
</value>
<value id="14" genre="config" type="list" class="CONFIGURATION" instance="1" index="30" label="30. Relay 1: Response to General Alarm" units="" readonly="false" count="4" current="ALARM FLASHING - relay will turn ON and OFF periodically (see param.39)">
<item>DEACTIVATION - no response to alarm frames</item>
<item>
ALARM RELAY ON - relay will turn ON upon receipt of alarm frame
</item>
<item>
ALARM RELAY OFF - relay will turn OFF upon receipt of alarm frame
</item>
<item>
ALARM FLASHING - relay will turn ON and OFF periodically (see param.39)
</item>
</value>
<value id="15" genre="config" type="list" class="CONFIGURATION" instance="1" index="31" label="31. Relay 1: Response to Water Flood Alarm" units="" readonly="false" count="4" current="ALARM RELAY OFF - relay will turn OFF upon receipt of alarm frame">
<item>DEACTIVATION - no response to alarm frames</item>
<item>
ALARM RELAY ON - relay will turn ON upon receipt of alarm frame
</item>
<item>
ALARM RELAY OFF - relay will turn OFF upon receipt of alarm frame
</item>
<item>
ALARM FLASHING - relay will turn ON and OFF periodically (see param.39)
</item>
</value>
<value id="16" genre="config" type="byte" class="CONFIGURATION" instance="1" index="32" label="32. Relay 1: Response to Smoke, CO, CO2 Alarm" units="" readonly="false" value="3"/>
<value id="17" genre="config" type="byte" class="CONFIGURATION" instance="1" index="33" label="33. Relay 1: Response to Temperature Alarm" units="" readonly="false" value="1"/>
<value id="18" genre="config" type="byte" class="CONFIGURATION" instance="1" index="39" label="39. ALARM FLASHING alarm time" units="" readonly="false" value="88">
<help>
Amount of time (ms) the device keeps on flashing after receipt of Alarm Frame
</help>
</value>
<value id="19" genre="config" type="list" class="CONFIGURATION" instance="1" index="40" label="40. Relay 2: Response to General Alarm" units="" readonly="false" count="4" current="ALARM FLASHING - relay will turn ON and OFF periodically (see param.39)">
<item>DEACTIVATION - no response to alarm frames</item>
<item>
ALARM RELAY ON - relay will turn ON upon receipt of alarm frame
</item>
<item>
ALARM RELAY OFF - relay will turn OFF upon receipt of alarm frame
</item>
<item>
ALARM FLASHING - relay will turn ON and OFF periodically (see param.39)
</item>
</value>
<value id="20" genre="config" type="list" class="CONFIGURATION" instance="1" index="41" label="41. Relay 2: Response to Water Flood Alarm" units="" readonly="false" count="4" current="ALARM RELAY OFF - relay will turn OFF upon receipt of alarm frame">
<item>DEACTIVATION - no response to alarm frames</item>
<item>
ALARM RELAY ON - relay will turn ON upon receipt of alarm frame
</item>
<item>
ALARM RELAY OFF - relay will turn OFF upon receipt of alarm frame
</item>
<item>
ALARM FLASHING - relay will turn ON and OFF periodically (see param.39)
</item>
</value>
<value id="21" genre="config" type="byte" class="CONFIGURATION" instance="1" index="42" label="42. Relay 2: Response to Smoke, CO, CO2 Alarm" units="" readonly="false" value="3"/>
<value id="22" genre="config" type="byte" class="CONFIGURATION" instance="1" index="43" label="43. Relay 2: Response to Temperature Alarm" units="" readonly="false" value="1"/>
<value id="23" genre="system" type="list" class="SWITCH ALL" instance="1" index="0" label="Switch All" units="" readonly="false" polled="false" count="4" current="On and Off Enabled">
<item>Disabled</item>
<item>Off Enabled</item>
<item>On Enabled</item>
<item>On and Off Enabled</item>
</value>
<value id="24" genre="system" type="list" class="POWERLEVEL" instance="1" index="0" label="Powerlevel" units="dB" readonly="false" polled="false" count="10" current="Normal">
<item>Normal</item>
<item>-1dB</item>
<item>-2dB</item>
<item>-3dB</item>
<item>-4dB</item>
<item>-5dB</item>
<item>-6dB</item>
<item>-7dB</item>
<item>-8dB</item>
<item>-9dB</item>
</value>
<value id="25" genre="system" type="byte" class="POWERLEVEL" instance="1" index="1" label="Timeout" units="seconds" readonly="false" polled="false" value="0"/>
<value id="26" genre="system" type="button" class="POWERLEVEL" instance="1" index="2" label="Set Powerlevel" units="" readonly="false" polled="false" value="False"/>
<value id="27" genre="system" type="byte" class="POWERLEVEL" instance="1" index="3" label="Test Node" units="" readonly="false" polled="false" value="0"/>
<value id="28" genre="system" type="list" class="POWERLEVEL" instance="1" index="4" label="Test Powerlevel" units="dB" readonly="false" polled="false" count="10" current="Normal">
<item>Normal</item>
<item>-1dB</item>
<item>-2dB</item>
<item>-3dB</item>
<item>-4dB</item>
<item>-5dB</item>
<item>-6dB</item>
<item>-7dB</item>
<item>-8dB</item>
<item>-9dB</item>
</value>
<value id="29" genre="system" type="byte" class="POWERLEVEL" instance="1" index="5" label="Frame Count" units="" readonly="false" polled="false" value="9"/>
<value id="30" genre="system" type="button" class="POWERLEVEL" instance="1" index="6" label="Test" units="" readonly="false" polled="false" value="False"/>
<value id="31" genre="system" type="button" class="POWERLEVEL" instance="1" index="7" label="Report" units="" readonly="false" polled="false" value="False"/>
<value id="32" genre="system" type="list" class="POWERLEVEL" instance="1" index="8" label="Test Status" units="" readonly="true" polled="false" count="3" current="Failed">
<item>Failed</item>
<item>Success</item>
<item>In Progress</item>
</value>
<value id="33" genre="system" type="byte" class="POWERLEVEL" instance="1" index="9" label="Acked Frames" units="" readonly="true" polled="false" value="101"/>
<value id="34" genre="system" type="string" class="VERSION" instance="1" index="0" label="Library Version" units="" readonly="true" polled="false" value="3"/>
<value id="35" genre="system" type="string" class="VERSION" instance="1" index="1" label="Protocol Version" units="" readonly="true" polled="false" value="3.42"/>
<value id="36" genre="system" type="string" class="VERSION" instance="1" index="2" label="Application Version" units="" readonly="true" polled="false" value="2.01"/>
<Associations>
<Association max_association="16" group_num="1" label="Group 1"/>
<Association max_association="16" group_num="2" label="Group 2"/>
<Association max_association="1" group_num="3" label="Send updates">
<node id="1"/>
</Association>
</Associations>
</device>
</Data>
</Root>

Posted by aleksey_z at Nov 15, 2014 17:05

That looks like the whole devices tree, instead of just the status of one single device.
You do get here 300 lines per device! This information could be usefull as a source to import devices into OpenRemote.
Unfortuately OR does not have a standardised import format for that (yet)

It is not practical to load this whole blurp to just get one value. It will make your system very slow.
And you only have 2 devices now. The OR http protocol does only extract one value at a time per POST/GET.

I have gone through the SynoZwave help, but did not find a clue there how to get data fro a single device or even better
a single sensor.

Posted by pz1 at Nov 15, 2014 19:58

This all experiments.
Now to Sinozwave connect 2 z-wave devices, dimmer and dual-channel switch.
From Openremote I can control the devices on HTTP. For example, to turn on channel 1 in dual-channel switch, I send the command: http://192.168.1.7:4020/admin/stalingrad/data=devices&action=edit&deviceNum=3&valueNum=2&setValue=1

To turn off channel 1 in dual-channel switch, I send the command: http://192.168.1.7:4020/admin/stalingrad/data=devices&action=edit&deviceNum=3&valueNum=2&setValue=0

Similarly, for channel 2, but the command: &deviceNum=3&valueNum=3&setValue=0/1
It works very quickly.
Of all the lines, for FGS221 value is changed in only one place:
value="False" - if command Off
value="True" - if command On

To track the status of the switch (channel 1), I wanted to make the command:

http://192.168.1.7:4020/admin/pass/data=devices
GET
//response/device id=3/value id=1/value - (and many other options)
2s

But do not get anything back. How can I track the status of the devices?

Posted by aleksey_z at Nov 16, 2014 11:48

I have been wrestling with the XPath a bit on the full XML you posted above.
Unfortunately that XML is different from what you show underlined in the screendumps.
For example in the big blurp I can not find the underlined text <device id="3".
As a result my experiments do fail, because the structure is different.

The top element of the XML you provided is Root, with two children: Response and Data.
My Guess is that you latest XML is the Response part. I infer that from your XPath statement.

If so, your path is probably incomplete and should be something like
//Root/Response/device id=3/value id=1/value

I am not sure, but I think the attribute specification is also wrong. Try
//Root/Response/device [@id="3"]/value [@id="1"]/value

Posted by pz1 at Nov 16, 2014 15:02

Thank you, that is trying to help me.
Big blurp, an response in IE11. In the screenshot (underlined), a response to Google Chrome.

So I tried:
//Root/Response/device id=3/value id=1/value
but unanswered. Only Root and Response I wrote in small letters.

So try tomorrow:
//Root/Response/device [@id="3"]/value [@id="1"]/value

Posted by aleksey_z at Nov 16, 2014 16:16

No, unfortunately, does not work.

Above I have changed the result of a response to Google Chrome.

If //Root/Response/device id=3/value id=2/value

If //Root/Response/device [@id="3"]/value [@id="2"]/value

The values are not returned, although the file they change.

Posted by aleksey_z at Nov 17, 2014 12:29

Ok this new sample is fine. Got it working with:

//Root/Data/device[@id="2"]/value[@id="1"]/@value

On my test screen in OpenRemote it showed 0, and False with your id's
I did test with http://www.freeformatter.com/xpath-tester.html, which is much faster than going through Designer/Sync sessions.

If you haven't done so before have a look at this page that I wrote a while ago:
http://www.openremote.org/display/docs/OpenRemote+2.0+How+To+-+Use+XML+Data+Sources

Posted by pz1 at Nov 17, 2014 13:39

Now try.

Yes, it works. Thank you very much for your help, and for the link to the tester.

Now would still deal with a slider for FGD211 dimmer.

Posted by aleksey_z at Nov 17, 2014 13:49
Document generated by Confluence on Jun 05, 2016 09:36