Last active
May 12, 2025 15:12
-
-
Save stikkx/42e0cfa8985c2b720eba7c89ea16cb96 to your computer and use it in GitHub Desktop.
Homeassistent KNX Switch Blueprint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: "Simple Device Control" | |
description: "Select a switch to control a socket or light source." | |
domain: automation | |
input: | |
switch_entity: | |
name: "Switch" | |
description: "The switch used to toggle the socket or light source." | |
selector: | |
entity: | |
domain: switch | |
target_entity: | |
name: "Socket/Light Source" | |
description: "The socket or light source to be controlled by the switch." | |
selector: | |
entity: | |
domain: | |
- switch | |
- light | |
trigger: | |
- platform: state | |
entity_id: !input switch_entity | |
action: | |
- service: >- | |
{% if states(trigger.entity_id).state == 'on' %} | |
homeassistant.turn_on | |
{% else %} | |
homeassistant.turn_off | |
{% endif %} | |
target: | |
entity_id: !input target_entity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment