If main node comes up but the BMS Modbus server is not available, it may use invalid values (for example 65535 % SoC).
Add a check if Modbus server is online.
Moves the update logic for the inverter_com_status sensor outside of the
conditional BMS check.
This ensures the status display is always kept in sync with the component's
state, even after the BMS has disconnected.
Previously, the data-forwarding logic would only execute if a BMS was
connected. When the BMS disconnected, the logic would halt, leaving
the proxy sensors with their last known values. This caused stale data
to be sent to the inverter.
This change refactors the YAML logic to explicitly handle the BMS
offline state.
When a BMS is no longer available, all numeric proxy sensors are now
invalidated by publishing `NAN`, and all binary alarm/protection
sensors are reset to `false`. This ensures the C++ component receives
a clear signal that the data is no longer valid, allowing its
fail-safe mechanisms to engage and stop communication.
This fix improves overall system robustness by preventing stale state
and ensuring a predictable response to a BMS disconnect.
Introduces a new configuration option requested_force_charge to the
Pylontech RS485 integration, allowing for external control of the
force charge request.
Implement a new binary sensor to monitor the inverter communication status.
This sensor's state is dependent on the `rs485_switch_inverter_heartbeat_monitoring`
switch, only reporting the actual inverter communication status when
heartbeat monitoring is enabled.
Refactor inverter heartbeat and communication status handling to be
managed directly by the `pylontech_rs485` component. This provides a
more reliable and accurate indication of the inverter's communication
state, ensuring the true status is reflected.