Template Switch Configuration

Hi,

sorry this might be a silly beginner question - I have a switch.yaml with:

  - platform: template
    switches:
      skylight:
        turn_on:
          service: switch.turn_on
          target:
            entity_id: light.RelayOUT
        turn_off:
          service: switch.turn_off
          target:
            entity_id: light.RelayOUT

and a modbus.yaml with:

lights:
      - name: RelayOUT 
        slave: 1
        address: 2023
        command_on: 1
        command_off: 0

I assume that my switch is operating the modbus output - so far the switch in HA is changing it’s state (color) but nothing is happening at my modbus device – I think the problem is one more time at the modbus side but because this is my second week with HA I’m not sure about the switch configuration either ……

kind regards
Tobi