Modbus > read/write 1 Byte unsigned

Hi,

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.


Type “WAHL” is declared as “1 Byte unsigned”

which of the available types do i have to use here? Modbus - Home Assistant

currently i stuck here:

    sensors:
      - name: Aqotec_RM360_Übergabestation_Betriebsmodus
        address: 41195
        data_type: string
        slave: 1

Thanks, Johnny

I’ve managed to get the state as a number:

    - name: HeatState_Ubergabestation
      unique_id: d3f039970-ad08-State_UbergabeStation
      unit_of_measurement: state
      slave: 1
      address: 43010
      data_type: int16
      scan_interval: 1
      state_class: measurement

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' }}