Modbus switch config errors

Hi all,

I’m struggling with reconfiguration of modbus switch from old config, where config was under ‘switch’ into new type, in which switch configs are defined under modbus hub.

I created following config tcp_config2

Config check returns no error, but after restart i got following error

Then I manually added “verfy_state: true” key to every switch. as described in documentation

After that, config check returns this errorconfig_error_2

Is this bug or my misconfiguration :face_with_head_bandage: ?

Try true instead of True?

Didn’t help :sweat:

Could you paste in the full modbus section from configuration.yaml please? Use the code block to format it properly: no screenshots please. See rule 11.

Sure, here it is

modbus:
#########################
#
#   WEATHER STATION MODBUS
#
#########################
  - type: tcp
    name: weatherStation
    timeout: 15
    host: xxx.xxx.xxx.xxx #hidden
    port: 502
    delay: 3

    
    sensors:
      - name: Barometer
        device_class: pressure
        unit_of_measurement: mbar
        scale: 0.1
        slave: 1
        precision: 1
        input_type: holding
        address : 3
        scan_interval: 15

      - name: Zunanja temperatura
        unit_of_measurement: °C
        device_class: temperature
        scale: 0.1
        slave: 1
        precision: 1
        input_type: holding
        address : 6
        scan_interval: 15

      - name: Hitrost vetra
        unit_of_measurement: km/h
        slave: 1
        input_type: holding
        address : 7
        scan_interval: 4

      - name: Smer vetra
        unit_of_measurement: °
        slave: 1
        input_type: holding
        address : 9
        scan_interval: 5

      - name: Zunanja vlaga
        unit_of_measurement: '%'
        device_class: humidity
        scale: 1
        slave: 1
        input_type: holding
        address : 18
        scan_interval: 15

#########################
#
#   SIEMENS MODBUS
#
#########################
  - type: tcp
    name: Siemens
    timeout: 10
    host: xxx.xxx.xxx.xxx #hidden
    port: 502
    delay: 2

    sensors:
      - name: Stanje_luc_DALI_1_hodnik
        scale: 1
        slave: 2
        input_type: holding
        address : 80
        scan_interval: 2

      - name: Stanje_luc_DALI_2_pri_termostatu
        scale: 1
        slave: 2
        input_type: holding
        address : 82
        scan_interval: 2

      - name: Stanje_luc_DALI_3_pri_TV
        scale: 1
        slave: 2
        input_type: holding
        address : 84
        scan_interval: 2

      - name: Stanje_luc_DALI_4_vhod_v_hiso
        scale: 1
        slave: 2
        input_type: holding
        address : 86
        scan_interval: 2

      - name: Stanje_luc_DALI_6_letni_vrt_3_lucke
        scale: 1
        slave: 2
        input_type: holding
        address : 90
        scan_interval: 2

      - name: Stanje_luc_DALI_7_letni_vrt_2_lucke
        scale: 1
        slave: 2
        input_type: holding
        address : 92
        scan_interval: 2

      - name: Stanje_luc_DALI_8_nadstresek_3_luci
        scale: 1
        slave: 2
        input_type: holding
        address : 94
        scan_interval: 2

      - name: Stanje_luc_DALI_9_nadstresek_2_lucki
        scale: 1
        slave: 2
        input_type: holding
        address : 96
        scan_interval: 2

      - name: Stanje_luc_DALI_10_nadstresek_1_luc
        scale: 1
        slave: 2
        input_type: holding
        address : 98
        scan_interval: 2

      - name: Stanje_luc_DALI_11_pomozni_objekt
        scale: 1
        slave: 2
        input_type: holding
        address : 100
        scan_interval: 2

      - name: Stanje_luc_DALI_Dnevna_soba
        scale: 1
        slave: 2
        input_type: holding
        address : 102
        scan_interval: 2

      - name: Stanje_luc_DALI_letni_vrt
        scale: 1
        slave: 2
        input_type: holding
        address : 104
        scan_interval: 2

      - name: Stanje_luc_DALI_nadstresek
        scale: 1
        slave: 2
        input_type: holding
        address : 106
        scan_interval: 2


    switches:
      - name: luci hodnik spodaj
        slave: 1
        input_type: holding
        address : 111
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient spodaj B
        slave: 1
        input_type: holding
        address : 113
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: luci hodnik spodaj
        slave: 1
        input_type: holding
        address : 111
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient spodaj B
        slave: 1
        input_type: holding
        address : 113
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient spodaj C
        slave: 1
        input_type: holding
        address : 115
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient spodaj D
        slave: 1
        input_type: holding
        address : 117
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient zgoraj A
        slave: 1
        input_type: holding
        address : 119
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient zgoraj C
        slave: 1
        input_type: holding
        address : 121
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient zgoraj D
        slave: 1
        input_type: holding
        address : 123
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true
        
      - name: ambient alternativni set nivojev dali garaza in hisa
        slave: 1
        input_type: holding
        address : 125
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: ambient pomozni (garaža) zadaj
        slave: 1
        input_type: holding
        address : 126
        command_on: 1
        command_off: 0
        scan_interval: 2
        verify_state: true

      - name: Vklop/izklop prezračevanje klet
        slave: 1
        input_type: holding
        address : 156
        command_on: 1
        command_off: 0
        scan_interval: 2

#########################
#
#   HEATING PUMP MODBUS
#
#########################
  - type: tcp
    name: heatingPump
    timeout: 15
    host: xxx.xxx.xxx.xxx #hidden
    port: 502
    delay: 3

    sensors:
      - name: odcitek_bojlerja
        unit_of_measurement: °C
        scale: 0.1
        slave: 1
        input_type: input
        address : 109 #110
        precision: 1
        scan_interval: 30

      - name: nastavitev_bojlerja
        unit_of_measurement: °C
        scale: 0.1
        slave: 1
        input_type: holding
        address : 38 #39
        scan_interval: 20

    
    switches:
      - name: vklop rezima delovanja-hlajenje
        slave: 1
        input_type: holding
        address : 48 #49
        command_on: 2
        command_off: 1
        scan_interval: 2

      - name: vklop aktivnega hlajenja
        slave: 1
        input_type: holding
        address : 49 #50
        command_on: 1
        command_off: 0
        scan_interval: 2

    climates:
      ##########################################################################
      #
      #   Heating pump
      #
      ##########################################################################
      - name: ogrevanje sanitarne vode
        slave: 1
        data_type: int
        data_count: 1
        scale: 0.1
        offset: 0
        precision: 2
        max_temp: 55
        min_temp: 40
        temp_step: 1
        target_temp_register: 38
        current_temp_register: 109
        current_temp_register_type: input
        scan_interval: 5


      - name: Ogrevalni krog hiša
        slave: 1
        data_type: int
        data_count: 1
        scale: 0.1
        offset: 0
        precision: 2
        max_temp: 30
        min_temp: 10
        temp_step: 1
        target_temp_register: 21
        current_temp_register: 54
        current_temp_register_type: input
        scan_interval: 5


      - name: Ogrevalni krog garaža
        slave: 1
        data_type: int
        data_count: 1
        scale: 0.1
        offset: 0
        precision: 2
        max_temp: 30
        min_temp: 10
        temp_step: 1
        target_temp_register: 26
        current_temp_register: 55
        current_temp_register_type: input
        scan_interval: 5

Thank you for helping me :smiley:

I can’t see anything obviously wrong with that. verify_state should be optional according to the docs, so I wonder if there’s something else wrong with the integration.

Anyone else care to chip in?

It’s known issue, which will be fixed in 2021.5 according to this issue thread: