Reading a DirectLogic PLC with Modbus

I have a DirectLogic 205/H2-ECOM100 with a Green, Blue, Orange, Red & Sound light tower for alarms. I wish to just read the status of the light tower. As the conditions of the light tower changes, HA reports all lights are off with no status changes.

It must be something right in front of me but I just can’t see it.

Here is my code.

modbus:
  - name: hub1
    type: tcp
    host: 192.168.xxx.yyy
    port: 502
    binary_sensors:
      - name: "Status Green"
        device_class: light
        address: 2058 # for Y11 output coil
      - name: "Status Blue"
        device_class: light
        address: 2059 # for Y12 output coil
      - name: "Status Orange"
        device_class: light
        address: 2060 # for Y13 output coil
      - name: "Status Red"
        device_class: light
        address: 2061 # for Y14 output coil
      - name: "Status Alarm Sound"
        device_class: problem 
        address: 2062 # for Y15 output coil

Did you need to specify a slave address?

I’m really not sure about why I need the “slave”, but with or without I’m not seeing the current correct value in the history log.

But I did see better responses when my DL205 communicated with my DL05 early this morning. So it may be my H2-ECOM100.

As an experiment, I set up a peer to peer with the ECOM100 to my HA IP . Also I increased the scan interval time to 2 seconds and added slave: 255. No change but I’ll let it run for a few hours to see if there is any pattern I can detect.

So now my code is

modbus:
  - name: hub1
    type: tcp
    host: 192.168.xxx.yyy
    port: 502
    binary_sensors:
      - name: "Status Green"
        device_class: light
        address: 2058
        scan_interval: 2
        slave: 255
      - name: "Status Blue"
        device_class: light
        address: 2059
        scan_interval: 2
        slave: 255
      - name: "Status Orange"
        device_class: light
        address: 2060
        scan_interval: 2
        slave: 255
      - name: "Status Red"
        device_class: light
        address: 2061
        scan_interval: 2
        slave: 255
      - name: "Status Alarm Sound"
        device_class: problem 
        address: 2062
        scan_interval: 2
        slave: 255

Turns out it was a wrong register number error on my part. I read the instructions given by Automation Direct. There is even a Excel Spreadsheet that can, supposedly, help determine the correct Modbus register number. But it was off my 1.

So here is my code… that’s working :grinning:

modbus:
  - name: hub1
    type: tcp
    host: 192.168.xxx.yyy
    port: 502
    delay: 5
    timeout: 5
    binary_sensors:
      - name: "Status Green"
        device_class: light
        address: 2057 # for Y11 output coil
        scan_interval: 20
        slave: 255
      - name: "Status Blue"
        device_class: light
        address: 2058  # for Y12 output coil
        scan_interval: 20
        slave: 255
      - name: "Status Orange"
        device_class: light
        address: 2059  # for Y13 output coil
        scan_interval: 20
        slave: 255
      - name: "Status Red"
        device_class: light
        address: 2060  # for Y14 output coil
        scan_interval: 20
        slave: 255
      - name: "Status Alarm Sound"
        device_class: problem 
        address: 2061  # for Y15 output coil
        scan_interval: 20
        slave: 255

I’ll eventually clean it up but for now, I’m good and out.

1 Like