Skip to content

ina2xx_v2: retry after I2C errors instead of disabling, fix HA last_reset offset - #41

Merged
KrX3D merged 2 commits into
0_15from
fix/ina2xx-v2-i2c-retry-and-last-reset
Nov 19, 2026
Merged

KrX3D merged 2 commits into
0_15from
fix/ina2xx-v2-i2c-retry-and-last-reset

Conversation

@KrX3D

@KrX3D KrX3D commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner
  • A failed init or an INA226 I2C error no longer sets enabled = false (a settings save made that permanent). The usermod retries with backoff from 30 s to 5 min, drops the reading taken with the error, and doesn't count energy across the gap.
  • On the first failure the I2C bus is scanned and every device logged (ported from the local copy).
  • HA last_reset: the reset timestamps are local wall-clock seconds, so timestamp_local put them 1-2 h off. The template now rebuilds the date in HA's time zone; checked in HA with Europe/Berlin, including both DST days. HA and WLED must use the same time zone; on update, HA sees the last_reset change once.
  • Touches the same files as ina2xx_v2: fix total energy doubling on every boot #33 but different hunks.

Changelog

🤖 Generated with Claude Code

KrX3D and others added 2 commits November 11, 2026 02:11
- A failed init or an INA226 I2C error no longer sets enabled=false (which a
  settings save would persist); the usermod retries with backoff 30 s..5 min
  and drops the reading taken with the error.
- On the first failure the I2C bus is scanned and every device logged
  (ported from the local copy).
- last_reset: the reset timestamps are local wall-clock seconds, so
  timestamp_local shifted them by the UTC offset. The template now rebuilds
  the date in HA's time zone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in the PRs merged into 0_15 since this branch was created, so the
diff against 0_15 no longer reverts them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@KrX3D

KrX3D commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

localy added

@KrX3D
KrX3D merged commit d160665 into 0_15 Nov 19, 2026
@KrX3D
KrX3D deleted the fix/ina2xx-v2-i2c-retry-and-last-reset branch November 19, 2026 17:12
KrX3D pushed a commit that referenced this pull request Nov 19, 2026
…tore

Brings in #41. Its last_reset template replaces this branch's (it
already treats a missing timestamp as 0); only its 'else none' becomes
'else ''' so HA skips it instead of logging an invalid last_reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
KrX3D pushed a commit that referenced this pull request Nov 19, 2026
Brings in #41 so the diff no longer reverts it. No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant