Modbus, Water level sensor QDY30A RS485 + Waveshare RS485 TO POE ETH (B), unavailable in HA

Project to check water level in water well for garden sprinklers, almost 50 m from house covered with quite thick concrete (100-150mm). I want a wire solution, have already a 50mm hose for electricity to submersible pump. I bought a level sensor QDY30A RS485 DC24V 4m range 5m cable and Waveshare RS485 TO POE ETH (B). Shall be connected to HA.

My plan is to solder level sensor with TP cable in water well, it goes into the house there I place waveshare and connect it to home network. For now I have it at my desk until I get it work.

Proxmox + HAOS
Router → POE switch → Waveshare POE ETH → water level sensor

Wiring

Settings in Vircom for Waveshare POE ETH
DHCP
Port: 502
TCP Server
Transfer Protocol: Modbus_TCP_Protocol
Baud Rate: 9600
Data bits: 8
Stop bits: 1
Modbus Gatway Type: Simple Modbus TCP to RTU

Home Assistant
Studio Code Server
configuration.yam “added: modbus: !include modbus.yaml”
new modbus.yaml file with code

I got MODBUS Level transmitter communication protocol from seller, see picture.

Found this code from tomdv:

  - name: "modbus"
    type: tcp
    host: 192.168.1.XXX
    port: 502
    timeout: 3
    sensors:
      - name: "Water_level_1"
        unique_id: "modbus_water_level"
        slave: 1
        address: 4
        data_type: int16
        unit_of_measurement: cm
        input_type: holding
        scale: 1.0
        precision: 1
        scan_interval: 5

I have tried this and many more versions but when I check Entities in HA it’s always unavailable.

Waveshare TCP connection: Established
According to leds POWER+LINK+ACT seems to work perfect at waveshare

I have now tried Wireshark to check traffic but it’s no mbtcp trafic at all. What have I missed, is it some port that I need to open at router?

Hope some skilled person can help me soon :slightly_smiling_face:

Hey mekanikless,
now we are two with the same issue. I have exactly the same issue, same sensor, same waveshare interface, same settings and no glue why I do not see values in the sensor in home assistant.
What is your current status, still searching, or did you found a solution?

I am working since a week on this problem without any idea how to solve it…
Martin

did you find a way to resolve this? I have the same error… thanks

There is my working config

modbus:
  - name: hub1
    type: tcp
    host: 192.168.1.6
    port: 502

    sensors:
      - name: water_level
        unique_id: "modbus_water_level"
        slave: 1
        address: 4
        data_type: int16
        unit_of_measurement: cm
        input_type: holding
        scale: 1.0
        precision: 1
        scan_interval: 5

and WaveShare config

Hello, sorry for not writing about how it went. In my case it was a very emabarrasing fault, sensor didn’t got any current. I asked manufactorer if I could feed with POE and use V+ and V- directly to sensor, answer was yes so I didn’t check that. After discussion with a friend about my problem and showing him the parts he said it looks like V+ and V- are only for input not output. I made a simple measurement and it was dead. I bought a link after that it worked directly. Made some smaller changes in code to get right “scale” of the water level.