Repository navigation
Conversation
…#16, #19) Adds a CloudCidMapping for control CID 103 covering all 26 V1 TOU registers (global charge/discharge current + 3 slots of 8 time registers each) as one composite 18-value string. Since SolisCloud models current per-slot but Modbus only has one global register, decode takes slot 1's values as representative and encode broadcasts the single Modbus value to all 3 cloud slots. Writes to any subset of these registers route through the existing _execute_tou_time_write (reused, not duplicated), which already generically composes a partial write against the full cached/read state. Also reads SolisCloud CID 6798 once at first poll in cloud-only mode and disables the TOU V2 entities if the device doesn't report support, matching the existing _disable_unmapped_sensors treatment. A failed read changes nothing. The V1 TOU cloud path is implemented and unit-tested but not yet live-verified against a real inverter, per the issue's own verification gate - flagged in docs/source/tou.md. Fixes #16, Fixes #19
Contributor
|
Failed to generate code suggestions for PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combines issues #16 and #19 in one PR since both relate to TOU, per request.
#19 — SolisCloud V1 TOU (Time-Charging) via control CID 103:
CloudCidMappingfor CID 103 covering all 26 V1 TOU registers (43141/43142global current + 3 slots × 8 time registers) as one composite 18-value string (ChargeCurrent, DischargeCurrent, ChargeStart, ChargeEnd, DischargeStart, DischargeEnd× 3 slots)._execute_tou_time_write, reused as-is rather than duplicated — it already generically composes a partial write against the full cached/read state.docs/source/tou.md.#16 — Enforce SolisCloud CID 6798 TOU V2 enablement gate:
CloudDataRetrievalreads CID 6798 once at first poll in cloud-only mode; if the device doesn't report support (43605), disables every sensor covering the V2 register range (43707-43791), matching the existing_disable_unmapped_sensorstreatment.Test plan
tests/test_cloud_mapping.py: V1 TOU register span, worked-example decode (from the issue spec), current-broadcast encode, rejection casestests/test_cloud_writes.py: current-broadcast write, partial time-field write preserving other registers, compose-from-cid-read fallback,TestV2EnablementGate(disable/stay-enabled/never-guess)ruff check/ruff format --checkcleanCloses #16, Closes #19