Modbus X-410 sensor error

I’m trying to setup modbus to read some 1-wire temperature sensors that are connected to a ControlbyWeb X-410 relay module. It works using snmp but I wanted to switch to modbus for monitoring and control.
What’s odd is that I have one binary water leak sensor connected to the x-410 and it reads that ok in HA but not the one-wire sensors. The x-410 logs the requests from HA and doesn’t show any errors but I get this error in the HA logs:

Pymodbus: x-410: Error: device: 1 address: 20 → pymodbus returned isError True

Here’s what I have in yaml:

modbus:
  - type: tcp
    host: xxx.xxx.xxx.x
    port: 502
    name: x-410
    
    binary_sensors:
         - name: "sensor1"
           slave: 1
           address: 0
           unique_id: 2512e9fd-bf1d-4a76-8c9c-5ac2ffd183eb
           
    sensors:
        - name: "sensor2"
          slave: 1
          address: 20
          unique_id: 2d68bc9f-5e9b-469e-a281-d676daa7375e
          unit_of_measurement: °F
          device_class: temperature
          precision: 1
          input_type: input
          
        - name: "sensor3"
          slave: 1
          address: 22
          unique_id: 9607bd32-6eae-41db-ba09-326147980c2e
          unit_of_measurement: °F
          device_class: temperature
          precision: 1
          input_type: input 

Hopefully I just am missing something obvious but if anyone has any suggestions I’d appreciate the help.

Thanks

Maybe slave id it’s different

There’s only the one device and I’ve tried it without specifying the slave (default 0) but same error. Does the slave need to match anything for the device?

I enabled debug for modbus and here is the log file:

2024-01-30 19:05:27.891 DEBUG (SyncWorker_2) [pymodbus.logging] Running transaction 3
2024-01-30 19:05:27.892 DEBUG (SyncWorker_2) [pymodbus.logging] SEND: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x16 0x0 0x1
2024-01-30 19:05:27.892 DEBUG (SyncWorker_2) [pymodbus.logging] New Transaction state “SENDING”
2024-01-30 19:05:27.892 DEBUG (SyncWorker_2) [pymodbus.logging] Changing transaction state from “SENDING” to “WAITING FOR REPLY”
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] Changing transaction state from “WAITING FOR REPLY” to “PROCESSING REPLY”
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] RECV: 0x0 0x3 0x0 0x0 0x0 0x3 0x1 0x84 0x1
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] Processing: 0x0 0x3 0x0 0x0 0x0 0x3 0x1 0x84 0x1
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] Factory Response[132]
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] Adding transaction 3
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] Getting transaction 3
2024-01-30 19:05:27.904 DEBUG (SyncWorker_2) [pymodbus.logging] Changing transaction state from “PROCESSING REPLY” to “TRANSACTION_COMPLETE”
2024-01-30 19:05:27.905 DEBUG (SyncWorker_2) [homeassistant.components.modbus.modbus] Pymodbus: x-410: Error: device: 1 address: 22 → pymodbus returned isError True
2024-01-30 19:05:27.921 DEBUG (SyncWorker_6) [pymodbus.logging] Current transaction state - TRANSACTION_COMPLETE

Thanks

You need configure sensors.

And view or change this table

register_type it’s float32

I did already generate the modbus address table which is where I got the address from. I don’t see a register_type … did you mean data_type with float32?

Can you share your yaml for the 1-wire Thermocouple?

Thanks

        - name: "sensor2"
          slave: 1
          address: 20
          unique_id: 2d68bc9f-5e9b-469e-a281-d676daa7375e
          unit_of_measurement: °F
          device_class: temperature
          precision: 1
          input_type: holding
          data_type: float32
          #swap: word # if needed
1 Like

Adding “swap: word” fixed it. The history graph x y is showing hex instead of degrees but I should be able to figure that out.

Thanks again for all your help!

1 Like