nilskaa / Smartthings

My smartthings projects
17 stars 19 forks source link

Fix for reporting power and energy #6

Closed rboy1 closed 4 years ago

rboy1 commented 5 years ago

Track and report the energy updates from the device, take power input from the user

golfster187 commented 4 years ago

Changed line 192 to fix some math:

state.lastKWh = (state.lastKWh ?: 0.0) + ((watts ?: 0.0) (lrv/3.333)) / (60 60 * 1000)