The switch is supposed to arm the alarm_system when its unarmed and unarm when its armed.
Arm and Unarm are 2 different actions on 2 different KNX group addresses. If I just create two buttons for arm using switch.alarm_innen_scharf and the other one with switch.alarm_innen_unscharf I can enable and disable the alarm system. Also the status works (binary_sensor.alarm_status_intern_scharf).
But when I want to combine this to only one button it does not work.
Your YAML doesn’t appear to be indented properly, plus you can eliminate the if…then…else since the device state is the same as what you want to represent.
Also, and maybe this is just semantics, I have my templates set up like this, it is a bit different than yours where I’m including the switch entity:
Yes that’s the problem. The KNX connector for the alarm system resolves the arm and unarm action to 2 different group addresses. So one is “arm” and one is “unarm”. If I create 2 buttons it both buttons work and I can turn on and off the alarm. But I want to configure it into one “normal” switch.
I’d guess your switch.alarm_innen_scharf is always on and switch.alarm_innen_unscharf is always off. so no state change happens and nothing is sent to the bus?
I guess… but you could also just use the state_address of the switches to set the state of your switch correctly.
Or completely omit the 2 switches and use knx.send service instead.
This is the third topic I’ve seen this week where, after receiving assistance from several people, the author marks their own post as the Solution. It’s impressive how they solved their own problem.
Ultimately, its your decision to select a reply that best describes what is wrong and how to fix it.
In this case, the problem was far more fundamental than what was associated with turn_on and turn_off. It had incorrect indentation and an invalid value_template. Unless those basic errors were fixed, it didn’t matter what was in turn_on and turn_off.