i’m trying to set the modbus sensor for the following address:
It should have an input-select as a result to be able to choose one of the available values.
It should be possible to convert this value using the ENUM template, but in my case this did not work. Unfortunately I don’t have the time to play with it, but maybe it will be a starting point for you:
# Platform Template:
- platform: template
sensors:
heat_state_ubergabestation:
friendly_name: "HeatState_Ubergabestation_Act"
unique_id: d3f039970-ad08-State_UbergabeStation_Act
device_class: "enum"
value_template: >
{% set states = {
0: 'AUS',
1: 'EIN im Normalbetrieb',
2: 'Station in RL-Begrenzung',
3: 'Station in Leistungsbegrenzung',
4: 'extern Aus',
5: 'Handbetrieb Ventil'
} %}
{{ states[states('sensor.heat_state_ubergabestation')] if states('sensor.heat_state_ubergabestation')|int in states else 'Unknown' }}