diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index 18ea50d0..2070ee97 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -37,6 +37,7 @@ //-------------------------------------------------------------------------------- // Custom current sensor // Check http://tinkerman.cat/your-laundry-is-done/ +// Check http://tinkerman.cat/power-monitoring-sonoff-th-adc121/ // Enable support by passing ENABLE_EMON=1 build flag //-------------------------------------------------------------------------------- diff --git a/code/espurna/emon.ino b/code/espurna/emon.ino index d866fc5f..81109430 100644 --- a/code/espurna/emon.ino +++ b/code/espurna/emon.ino @@ -144,13 +144,14 @@ void powerMonitorLoop() { if (millis() > next_measurement) { // Safety check: do not read current if relay is OFF - if (!relayStatus(0)) { - _current = 0; - } else { + // You could be monitoring another line with the current clamp... + //if (!relayStatus(0)) { + // _current = 0; + //} else { _current = emon.getCurrent(EMON_SAMPLES); _current -= EMON_CURRENT_OFFSET; if (_current < 0) _current = 0; - } + //} if (measurements == 0) { max = min = _current;