question

fenix avatar image
fenix asked

HA with Victron with modbus

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




1640136198023.png






Modbus TCPvictron productsVEConfigure 3
1640136198023.png (31.9 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

0 Answers

Related Resources

Modbus TCP Basics

Additional resources still need to be added for this topic