Hey together, I hope you can figure out what I am doing wrong Thank you in advance.
My setup is an KNX switch, which I want to use to turn on / off a shelly switch. With this setup it works like a charm, when I just push the KNX switch:
The GA 10/0/22 is connected to my KNX switch, an in my knx.yaml, I use it as a binary_sensor:
binary_sensor:
- name: "Garberobe Lichtband"
state_address: "10/0/22"
sync_state: false
ignore_internal_state: true
I then use an automation to turn on the shelly switch:
- id: garderobe_licht_ein
alias: Garderobe Licht einschalten
trigger:
- platform: state
entity_id: binary_sensor.garberobe_lichtband
from: 'off'
to: 'on'
condition: []
action:
- service: switch.turn_on
entity_id: switch.shelly_garderobe
initial_state: true
mode: single
To have the correct status for the switch in my KNX system, i expose the switch.shelly_garderobe state to the state_adress GA 10/0/23.
expose:
- type: "binary"
entity_id: "switch.shelly_garderobe"
address: "10/0/23"
All this works fine, when I just use the KNX switch to turn on the shelly switch.
However, I also use some scenes and automations, which turn off and on the shelly switch, like an “turn everything off”. This is triggered by another KNX switch, and another automation is used to turn off the shelly switch. This is done in the following automation (excerpt):
- id: light_everything_off
alias: Everything_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.gebaeude_zentral_aus_switch
condition:
- condition: template
value_template: '{{ (trigger.to_state.state == "off") }}'
action:
- service: switch.turn_off
entity_id: switch.shelly_garderobe
The shelly switch turns off, the state in the KNX system updates and is correct.
But now I have to press 3 times to get the Shelly switch back on using the KNX switch for that. And this behaviour occurs not just for turning it on again, there are other scenes and automations, which turn the shelly switch off and there I also have to push the KNX switch exactly 3 times before anything happens at the Shelly switch.
I dont think that it can be a Shelly problem, because I have a similar setup with a Tuya switch and I experience the same behaviour there.
I hope, anybody can give me a hint about what I do wrong.
Thank you very much!
Stefan