Skip to content

Instantly share code, notes, and snippets.

@stikkx
Last active May 12, 2025 15:12
Show Gist options
  • Save stikkx/42e0cfa8985c2b720eba7c89ea16cb96 to your computer and use it in GitHub Desktop.
Save stikkx/42e0cfa8985c2b720eba7c89ea16cb96 to your computer and use it in GitHub Desktop.
Homeassistent KNX Switch Blueprint
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