Looking for experiences with modbus/plc and HASS

I have lights working with Gavazzi SH2WEB24, using MODBUS tcp

More info: see

1 Like

Hi jacopsd, good work getting things running.
So the hope for me still lives on ;).
Thanks for the link. I Will look in to it.
Br //M

Lights and binary inputs with Gavazzi MODBUS RTP:


# Smarthouse Modbus
modbus:
  type: tcp
  host: <your IP address>
  port: 502

# SmartHouse Functions
switch:
  platform: modbus
  scan_interval: 5
  registers:
    # LIGHTS
    - name: light_switch_1
      slave: 1
      register: <register number>
      command_on: 1
      command_off: 0
    # WINDOWS      
    - name: window1_contact
      slave: 1
      register: <register number>
      register_type: input
      command_on: 1
      command_off: 0

# WINDOW CONTACT: Make binary sensor
binary_sensor:
  - platform: template
    sensors:
      window1_contact_sensor:
        friendly_name: "My great window"
        device_class: opening
        value_template: "{{ is_state('window1_contact', 'off') }}"

# Convert switch to light
light 1:
  - platform: switch
    name: Kitchen light
    entity_id: switch. light_switch_1


1 Like