Modbus TCP - Binary sensor configuration - YAML help needed

Hi All,

I’m a beginner with Home Assistant, and need help how to put together a working configuration.yaml file.
I’m not able to paste this section behind the # and get it work. These are boolean, value can be only 0 or 1 in the device, identifying the Heating-Cooling and the Comfort-Economy state in my heating system.

binary_sensor:
  - platform: hikvision
    host: 192.168.7.211
    username: !secret HikvisionUser
    password: !secret HikvisionPass

  - platform: hikvision
    host: 192.168.7.212
    username: !secret HikvisionUser
    password: !secret HikvisionPass

#  - platform: modbus
#    name: Heating_ONOFF
#    hub: wavin
#    slave: 1
#    coil: 4127
#  - platform: modbus
#    name: ComfortEconomy
#    hub: wavin
#    slave: 1
#    coil: 4128

# Wavin WTC3
modbus:
  name: wavin
  type: tcp
  host: 192.168.7.80
  port: 502
  delay: 2
  
sensor:
  platform: modbus
  scan_interval: 121
  registers:
    - name: TempL01
      hub: wavin
      unit_of_measurement: °C
      slave: 1
      register: 4136
      scale: 0.1
      precision: 1
    - name: HumL01
      hub: wavin
      unit_of_measurement: "%"
      slave: 1
      register: 4137
      scale: 0.1
      precision: 1

Could you please help me what is the secret to get it work?
All support are highly welcome.

I’ve tryed to follow exactly the guide, but no luck.
My configuration.yaml:

modbus:
  - name: wavin
    type: tcp
    host: 192.168.7.80
    port: 502
    delay: 2
    binary_sensors:
      - name: ONOFF
        slave: 1
        address: 4127
      - name: CE
        slave: 1
        address: 4128
        input_type: coil

However I got the error after configuration check:

Configuration invalid

Invalid config for [modbus]: extra keys not allowed @ data['modbus'][0]['binary_sensors']. Got [OrderedDict([('name', 'ONOFF'), ('slave', 1), ('address', 4127)]), OrderedDict([('name', 'CE'), ('slave', 1), ('address', 4128), ('input_type', 'coil')])]
extra keys not allowed @ data['modbus'][0]['delay']. Got 2
extra keys not allowed @ data['modbus'][0]['host']. Got '192.168.7.80'
not a valid value for dictionary value @ data['modbus'][0]['type']. Got 'tcp'
required key not provided @ data['modbus'][0]['baudrate']. Got None
required key not provided @ data['modbus'][0]['bytesize']. Got None
required key not provided @ data['modbus'][0]['method']. Got None
required key not provided @ data['modbus'][0]['parity']. Got None
required key not provided @ data['modbus'][0]['stopbits']. Got None. (See /config/configuration.yaml, line 62). 

Line 62 is this:
modbus:

So it looks that the config doesn’t recognise the tcp settings, but want to have serial port config.

What do I wrong?
The goal is to read coils and registers from a device. I removed the registers in this config but no luck.

I am seeing the same issue. Home Assistant core-2021.3.0 running in Docker.

Turns out it works fine in core-2021.4.6

Wow, thanks for letting me know :slight_smile:

Hi Guys,
I’m absolutely a beginner and would like to understand how should connect my Wavin WTC3 base unit with Home Assistant that’s running on a Raspberry Pi. I have a WTC-Net modul and was able to control my thermostats through mywavinhome.com, but I prefer to use Home Assistant.
As I see, athes’s configuration file refers to a WTC3 so I hope that somebody can help me.
Basic questions (sorry):

  • what kind of cable do I need?
  • should I connect the WTC3 base unit with the RPI or with the router?

Thanks,
Gábor

Did you have luck with your WTC3? I’m planning to do the same, but have not yet found anyone yet with expreience on this.

Yes, I have been using it with Home Assistant for more than one year. As I remember the modbus integration in HA had a serious update and it’s easy to setup.
I have the WTC-Net module so the WTC3 base unit available on the local network.
If you also have the Net module you have to set the type of communiaction in the config file to tcp, need the IP address of the module, and the port. After that you can add all sensors one by one according to the WTC3-BMS interface document that contains the modbus commands, register addresses.
Controlling the thermostats is an other question. I assume that the WTC3 have it’s own logic so I decided not to go with the modbus climate platform and write my own Appdaemon script.

Hi, here is my config to read out one info. 4129 is the register which store the actual mode (heat/winter/value “0” OR cool/summer value “1”) state. I read it out once a day.

# Wavin WTC3
modbus:
  name: wavin
  type: tcp
  host: 192.168.7.80
  port: 502
  delay: 1
  binary_sensors:
#      - name: ONOFF
#        slave: 1
#        address: 4127
#        scan_interval: 3600
#      - name: CE_C0_E1
#        slave: 1
#        address: 4128
#        input_type: coil
#        scan_interval: 3600
      - name: HC_H0_C1
        slave: 1
        address: 4129
        input_type: coil
        scan_interval: 3600

@domos.gabor : That is great to hear! I bought a flat (under construction) where it will be built in (together with the net module), and I just wanted to prepare so that once it is ready, I can make it work with HA. I would definitely need controlling also. I do not really like the cloud-like control through mywavinhome.com. @athes : Did you manage to control the temperature and the mode through HA?