i was able to integrate Victron (RPI) with modbus in HA
i got the data in HA
now in am trying to show text instead of value for the Solar Panel
‘0’ : ‘Off’, ‘2’ : ‘Fault’, ‘3’ : ‘Bulk’, ‘4’ : ‘Absorption’,‘5’ : ‘Float’
My formula work in developer Tool but not sure where to put this in the Configuration
- V-775-MQTT Charge State:
-
0=Off;2=Fault;3=Bulk;4=Absorption;5=Float;6=Storage;7=Equalize;11=Other (Hub-1);252=External control
- value_template: >-
- {% set mapper = {‘0’ : ‘Off’, ‘2’ : ‘Fault’, ‘3’ : ‘Bulk’, ‘4’ : ‘Absorption’,‘5’ : ‘Float’ } %}
- {% set state = states.sensor.v_775_mqtt_charge_state.state %}
- {{ mapper[state] if state in mapper else ‘Unknown’ }}
My config
modbus: !include modbus.yaml
/config/modbus.yaml
modbus:
- name: victron
type: tcp
host: 192.168.X.XX
port: 502
sensors:
- name: “V-775-MQTT Charge State”
slave: 239
address: 775
Any help would be appreciate!