Quantcast
Channel: HomeSeer Message Board
Viewing all articles
Browse latest Browse all 4847

Calculate time between device updates

$
0
0
I would like to calculate the current watts for an energy device that only reports kWh.

I have created a virtual device that stores the previous kWh value and also updates the "Last Change" value. When the energy device updates its kWH value I would like to compare the new value with the previous one. My script is triggered by this update.

I must also be able to calculate how long it's been between updates and I don't know what would be the best way to do this? When I know the hours (will be something like 0,083 as I have ~5 mins between updates) I will be able to calculate current Watts.

W = 1000 × kWh / hr

W = 1000 x ((current kWh - previous kWh) / (current last change - previous last change)

Attached Images
 

Viewing all articles
Browse latest Browse all 4847

Trending Articles