Rappo wrote:Mirar: But I am still interested in your setup

I call the JSON interface for updates,
http://172.16.0.72:8083/ZWaveAPI/Data/0
where 172.16.0.72 is the IP number to my razberry, and 0 is the unix timestamp I want the updates since. The answer is a fairly easily parse-able JSON. It's basically Java-object-formatted same thing as you would use in home automation, so you should be able to use the same principles.
My meters come in as node.instance.50.2 with type "Electric "[sic][2] and unit "W".
The algoritm is very simple:
* measure the time when you read the value (probably .last or something?), save this as old_time
* on a new reading (not the first one), power usage will be (time_this_reading - time_previous_reading) * current value [1]
An example:
* reading 1, W_1 = 50W (watt), T_1 = 10000s (seconds)
* reading 2, W_2 = 2000W, T_2 = 10030s
* reading 3, W_3 = 400W, T_3 = 10100s
Between reading 1 and reading 2, the power usage is (10030-10000)*2000 Ws = 30*2000Ws = 30*2000/3600/1000kWh = 0.0167kWh.
Between reading 2 and reading 3, the power usage is (10100-10030)*400 Ws = 70*400Ws = 70*200/3600/1000kWh = 0.0038kWh.
Over longer time (if you don't reset the meter), you can correlate your number with the kWh-meter.
I don't know if your unit reports watt as well. Maybe it doesn't, then this is useless.
([1] not exactly true, since you don't know what happened between previous reading and this reading, but close enough. You could also do average between the readings, but it will amount to the same sum eventually.
[2] is the space in "Electric " a z-wave.me bug or a bug in the unit?)
edit: As for using the JSON interface, it's for two reasons: 1) because I want to script in another language (Pike in my case), and 2) separation of automation and network - I use telldus (433MHz) as well as apcupsd and other scripted sources for handling things like receivers (Yamaha webapi).