Sorry if this is absolutely lame beginner question... I'm putting together simple home automation based on RasberryPi with Razberry daughter card. I installed devices, one of them is Phil Binary Power Switch PAN04-2. I can read the whole status from:
http://MY_IP:8083/ZWaveAPI/Run/devices[2].instances[0].Meter
The lines I'm interested in looks like the following:
{"invalidateTime":1407671880,"updateTime":1407671881,"type":"int","name":"sensorType","value":1},"sensorTypeString":{"invalidateTime":1407671880,"updateTime":1407671881,"type":"str","name":"sensorTypeString","value":"Electric "},"val":{"invalidateTime":1407671880,"updateTime":1413055717,"type":"float","name":"val","value":25.5},"scale":{"invalidateTime":1407671880,"updateTime":1407671881,"type":"int","name":"scale","value":2},"scaleString":{"invalidateTime":1407671880,"updateTime":1407671881,"type":"str","name":"scaleString","value":"W"},"ratetype":
...which basically means the power used is 25.5W
How do I extract this single value from URL? I tried different combination of 'scale', 'value' or 'val' but none of that works.
Can you please help me? In general, I'm interested in reading individual values from this sensor and putting them into MySQL database for further analysis. If you can point me any examples that would really help.
Thanks!
Reading value of power consumption
Re: Reading value of power consumption
Found it:
http://MY_IP:8083/ZWaveAPI/Run/devices[2].instances[0].Meter.data[2].val.value
http://MY_IP:8083/ZWaveAPI/Run/devices[2].instances[0].Meter.data[2].val.value