if (emeters) {
log.debug emeters.currentValue('energy')
//TODO: How to ensure latest (most accurate) energy reading?
- emeters.poll() //[configure, refresh, on, off, poll, reset]
+ //emeters.poll() //[configure, refresh, on, off, poll, reset]
// emeters.refresh() //[configure, refresh, on, off, poll, reset]
state.fansLastRunEnergy = emeters.currentValue('energy').sum()
state.fansLastRunCost = ((state.fansLastRunEnergy * price_kwh) / 100.0)