Pulse button for control PLC Siemens Logo!

Hi all! I am new to HA, please help. PLC Siemens Logo connected to HA. The PLC controls the lights in the house using physical impulse switches. HA has added integration and binary sensors that display the current status of the light (on or off). I can’t figure out how to make a switch that will monitor the state of a binary sensor and, based on its status, change the position of the switch?

Scheme in Siemens Logo. B003 - Master switch off

# This configuration does not work
# /config/modbus.yaml
 - name: "Logo8"
  type: tcp
  host: 192.168.1.30
  port: 502

  lights:
      - name: "svet_balkon"
        unique_id: "id.svet_balkon"
        address: 64 # V8.0
        write_type: coil
        command_on: 1
        command_off: 1
        scan_interval: 2
        verify:
            input_type: coil
            address: 65 # V8.1
            state_on: 1
            state_off: 0

  binary_sensors:
      - name: "svet_status_balkon"
        address: 65 # V 8.1
        scan_interval: 2
        slave: 1
        input_type: coil
        device_class: light

I made the switches using the “switch template”. Now it works as it should!

Hi I am trying the same thing. Could you explain a little more of how you got it working?

Best regards