CRC errors writing Passive mode / Timed Control registers — worked around with Time of Use for a "storm watch" automation #1111
Oiligriv
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
I built a Home Assistant automation that force-charges the battery from the grid when Italy's Civil Protection department (DPC) issues a severe weather alert — similar to Tesla Powerwall's "Storm Watch" — so the battery is full before a possible grid outage.
While implementing this, I hit a reproducible communication error trying to use "Passive" mode, and want to share both the bug and the workaround in case it helps others.
Environment
The bug: CRC errors on specific number/select writes
Setting
select.inverter_storage_control_modetoPassiveworks reliably every time — no errors.However, writing values to these entities consistently fails:
number.inverter_passive_grid_powernumber.inverter_passive_maximum_battery_powernumber.inverter_passive_minimum_battery_powerselect.inverter_timed_control(e.g. setting it toCharge)Every attempt (single writes, isolated, several seconds apart, at different times of day) raised:
custom_components.solarman.pysolarman.umodbus.client.serial.redundancy_check.CRCError: CRC validation failed. File ".../solarman/pysolarman/umodbus/client/serial/redundancy_check.py", line 76, in validate_crc File ".../solarman/pysolarman/umodbus/client/serial/rtu.py", line 183, in parse_response_adu File ".../solarman/pysolarman/__init__.py", line 296, in _parse_adu_from_sol_response File ".../solarman/pysolarman/__init__.py", line 311, in get_response File ".../solarman/device.py", line 67, in execute File ".../solarman/entity.py", line 149, in write File ".../solarman/number.py", line 68, in async_set_native_value A single, isolated
number.set_valuecall reproduces it every time (not a burst/rate issue — I tested one write at a time with delays in between). The underlying pysolarman client appears to retry internally (~17 log lines per failed attempt) before surfacing the exception to HA. Meanwhile,select.select_optiononstorage_control_modenever failed once, across many tests over several hours.I don't have a packet capture, but happy to gather one (or test a patch) if it helps — this felt like it could be either a timing/serial issue between the Solarman logger and the inverter, or a quirk specific to how these particular registers are written vs. read.
The workaround that ended up working
Instead of
Passive+ direct power setpoints, I:select.inverter_storage_control_modebetweenSelf UseandTime of Use— nonumber.set_valuecalls at all.This has been 100% reliable in testing — confirmed with
sensor.inverter_battery_currentflipping positive (charging) immediately after switching toTime of Use, and cleanly reverting when switching back toSelf Use.Why I'm posting this
Happy to share the automation YAML for the storm-watch use case if useful for the wiki examples.
All reactions