Skip to content

Add TOU V2 cloud mapping, review fixes, docs and credits - #1

Merged
fboundy merged 3 commits into
mainfrom
tou-v2-and-review-fixes
Jul 3, 2026
Merged

fboundy merged 3 commits into
mainfrom
tou-v2-and-review-fixes

Conversation

@fboundy

@fboundy fboundy commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • TOU V2 over SolisCloud: maps the verified CID family 5916-5987 into the local 43707-43791 register model (slot-enable bitfield, SOC/current/voltage companions, HH:MM-HH:MM time slots composed from HA hour/minute writes). Time parsing is lenient and unset slots decode to 00:00-00:00.
  • Review fixes:
    • Modbus writes execute directly and raise HomeAssistantError on failure — dual-mode write fallback now works, and the leaked write-queue task per protocol switch is gone.
    • Sensor staleness watchdog now treats poll speeds as seconds (was minutes; cloud sensors previously stayed "available" ~5h after going stale).
    • Protocol switching serialized with a lock; cloud write-verify tasks cancelled on unload.
  • Docs/credits: acknowledges Pho3niX90/solis_modbus (fork origin), mkuthan/solis-cloud-control and hultenvp/solis-sensor; new protocols doc page; HACS brand icon.

Behavior note

Modbus writes no longer queue while the link is down — they fail fast and, in dual modes, fall back to the healthy protocol.

Test plan

  • Full suite: 264 passed, 29 warnings (12 new tests: direct-write failure propagation, watchdog units, concurrent protocol switches, verify-task cancellation, lenient/empty TOU time parsing).
  • ruff check + format clean.
  • Live TOU write verification against the real inverter still pending (CID 6798 gate remains a known follow-up).

🤖 Generated with Claude Code

fboundy and others added 2 commits July 3, 2026 14:10
TOU V2 timed slots over SolisCloud:
- Map the verified CID family 5916-5987 into the local 43707-43791
  register model: slot enable bitfield, SOC/current/voltage companions,
  and HH:MM-HH:MM time slots composed from HA's hour/minute registers.
- Lenient time parsing (single-digit fields, whitespace); empty/unset
  slots decode to 00:00-00:00 instead of silently never updating.

Repo review fixes:
- Modbus writes now execute directly and raise HomeAssistantError on
  failure (write queue removed; serialization is already guaranteed by
  the shared per-link lock). This makes dual-mode write fallback work,
  surfaces write errors to entities/services, and removes the leaked
  queue-consumer task per protocol switch.
- Sensor staleness watchdog treats poll speeds as seconds, not minutes;
  cloud controller reports its poll interval in seconds accordingly.
- Protocol switching is serialized with a lock.
- Cloud write-verify tasks are tracked and cancelled on unload.

Docs:
- Credit Pho3niX90/solis_modbus (fork origin), mkuthan/
  solis-cloud-control and hultenvp/solis-sensor (SolisCloud references).
- New protocols page; README protocol matrix and cloud limits.
- Add HACS brand icon; gitignore local working notes.

Tests: 264 passed (12 new).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fboundy
fboundy merged commit c5c653f into main Jul 3, 2026
6 checks passed
@fboundy
fboundy deleted the tou-v2-and-review-fixes branch July 3, 2026 13:14
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