Does anyone know where I can verify all the current, and possible future, VE Bus State values and descriptions?
I added a custom ModBus register to my GX to track the Bus State (because I couldn’t find it anywhere else) to be able to display it on HA similar to the GX home screen descriptions.
My custom ModBus register is as follows:
com.victronenergy.system,/SystemState/State,d,%,4705,uint16,1,R
In HA I have a sensor to display the name associated to the numeric value.
{% set bus_states = {0 : 'Off',
1 : 'Low Power',
2 : 'Fault',
3 : 'Bulk',
4 : 'Absorption',
5 : 'Float',
6 : 'Storage',
7 : 'Equalize',
8 : 'Passthru',
9 : 'Inverting',
10 : 'Power Assist',
11 : 'Power Supply',
252 : 'Ext. Control',
256 : 'Unknown',
258 : 'Recharge'} %}
{% if has_value('sensor.ve_bus_system_state_custom') and
has_value('sensor.battery_state') and
states('sensor.ve_bus_system_state_custom') != None and
states('sensor.battery_state') != None %}
{% set battery_state = states('sensor.battery_state')|int %}
{% set bus_state = states('sensor.ve_bus_system_state_custom')|int %}
{% if bus_state == 256 and battery_state == 2 %}
Discharging
{% else %}
{{ bus_states[bus_state] if bus_state in bus_states else 'Unknown' }}
{% endif %}
{% endif %}
And it looks like this:
Thanks.