Last active
November 8, 2025 19:14
-
-
Save ChristophWeigert/28e74183a7253f543f55e7445b29f7a1 to your computer and use it in GitHub Desktop.
knx_virtual_simple_switch.yaml
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: Virtual KNX Device - Simple Switch | |
| description: Vitual KNX Device that represant in simple switch | |
| domain: automation | |
| input: | |
| address: | |
| name: Address | |
| description: KNX group address for switching the switch on and off. DPT 1.001 | |
| state_address: | |
| name: State Address | |
| description: KNX group address for exposing the switch state of the switch. DPT 1.001 | |
| target_switch: | |
| name: Switch | |
| description: The switch to keep in sync. | |
| selector: | |
| entity: | |
| filter: | |
| - domain: switch | |
| multiple: false | |
| source_url: https://gist.github.com/ChristophWeigert/28e74183a7253f543f55e7445b29f7a1 # Based on KNX light automation from https://gist.github.com/pasarn/ecd9e7d217a4da9ea210c5eab326a0cd | |
| variables: | |
| address: !input address | |
| trigger: | |
| - trigger: homeassistant | |
| event: start | |
| - trigger: event | |
| event_type: automation_reloaded | |
| - trigger: event | |
| event_type: knx_event | |
| event_data: | |
| destination: !input address | |
| action: | |
| - choose: | |
| - conditions: | |
| - condition: template | |
| value_template: '{{ trigger is defined and trigger.platform == "event" and trigger.event.event_type == "knx_event" }}' | |
| sequence: | |
| - choose: | |
| - conditions: | |
| - condition: template | |
| value_template: '{{ trigger.event.data.destination == address and trigger.event.data.data == 1 }}' | |
| sequence: | |
| - action: switch.turn_on | |
| data: | |
| entity_id: !input target_switch | |
| - conditions: | |
| - condition: template | |
| value_template: '{{ trigger.event.data.destination == address and trigger.event.data.data == 0 }}' | |
| sequence: | |
| - action: switch.turn_off | |
| data: | |
| entity_id: !input target_switch | |
| - conditions: | |
| condition: or | |
| conditions: | |
| - condition: template | |
| value_template: '{{ trigger is not defined }}' | |
| - condition: template | |
| value_template: '{{ trigger.platform == "homeassistant" }}' | |
| - condition: template | |
| value_template: '{{ trigger.platform == "event" and trigger.event.event_type == "automation_reloaded" }}' | |
| sequence: | |
| - action: knx.event_register | |
| data: | |
| address: '{{ address }}' | |
| - action: knx.exposure_register | |
| data: | |
| address: !input state_address | |
| type: binary | |
| entity_id: !input target_switch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment