You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ad49544
Browse filesBrowse the repository at this point in the historyBrowse files
- INA226: apply the correction factor after setResistorRange(), which
rewrote the calibration register with the uncorrected value
- MQTT restore: plain wait tick plus flag (millis()|1 could time out at
once), only restore with a valid total, republish once restored
- Validate energy from the JSON API; reject shunt_resistor <= 0
- Integrate unrounded power, keep the day/month rollover for negative
power, do not integrate across a re-init or disabled period
- INA226: refresh the overflow flag on every sample
- Re-create the sensor in loop() instead of the web task (use-after-free),
subscribe when enabled while MQTT is connected, drop "enabled" from
the JSON state API (re-enabling there could never work)
- Readme: ina2xx_v2 name, nodemcuv2 example, check_interval range,
heartbeat vs check_interval, energy only after NTP sync
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| `INA2XX_ENABLED` | Enable or disable the INA2XX Usermod | `false` | `true`, `false` |
44
44
| `INA2XX_I2C_ADDRESS` | I2C address of the INA2XX sensor | `0x40` | See options below for available addresses. |
45
-
| `INA2XX_CHECK_INTERVAL` | Interval for checking sensor values (seconds) | `5` | Any positive integer |
45
+
| `INA2XX_CHECK_INTERVAL` | Interval for checking sensor values (seconds) | `5` | `1` to `600` (web UI) |
46
46
|`INA2XX_CONVERSION_TIME`| ADC conversion time |`BIT_MODE_12` (219)<br>`CONV_TIME_1100` (226) | Sensor-specific (see below) |
47
47
|`INA2XX_DECIMAL_FACTOR`| Number of decimal places for current and power readings |`3`| See options below for decimal places. |
48
48
|`INA2XX_SHUNT_RESISTOR`| Value of the shunt resistor in ohms |`0.1`| Any positive float value matching your INA2XX resistor |
@@ -127,17 +127,17 @@ The sensor is read every `check_interval` seconds. A new MQTT message is only se
127
127
- after boot or an MQTT reconnect, or
128
128
-`mqtt_publish_always` is enabled.
129
129
130
-
> **Note:** Home Assistant discovery sets `expire_after` to 1800 s, so the sensors become unavailable after 30 minutes without a message. Keep `heartbeat_interval` below 1800. With `0`, sensors whose readings stay steady go unavailable after 30 minutes.
130
+
> **Note:** Home Assistant discovery sets `expire_after` to 1800 s, so the sensors become unavailable after 30 minutes without a message. The heartbeat is only checked when the sensor is read, so a message can be up to `check_interval` late: keep `heartbeat_interval` + `check_interval` below 1800. With `0`, sensors whose readings stay steady go unavailable after 30 minutes.
131
131
132
132
---
133
133
134
134
# Compiling
135
135
136
-
To enable, add `INA2XX_v2` to your `custom_usermods`(e.g. in `platformio_override.ini`)
136
+
To enable, add `ina2xx_v2` to your `custom_usermods` (e.g. in `platformio_override.ini`). The name is case-sensitive.
0 commit comments