Reading value of power consumption

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
jchabik
Posts: 5
Joined: 11 Oct 2014 22:22

Reading value of power consumption

Post by jchabik »

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!
jchabik
Posts: 5
Joined: 11 Oct 2014 22:22

Re: Reading value of power consumption

Post by jchabik »

Found it:

http://MY_IP:8083/ZWaveAPI/Run/devices[2].instances[0].Meter.data[2].val.value
Post Reply