Hi,
I am using KNX and Zigbee in my house.
I would like to be able to switch the zigbee lights from a KNX wall switch. So when I press a button on the wall switch, the service light.turn_on (or off) should be called. Also, the status of the Zigbee lamp shall be sent back to KNX, so that the wall switch inbdicates the status and sends correct on / off telegrams.
An example for a KNX lamp that’s set up:
knx:
light:
- name: "Licht Wand"
address: "1/1/64"
state_address: "1/4/64"
I tried putting a blueprint together, but I can never wrap my head around programming. This is the result:
blueprint:
name: Synchronisierung zwischen KNX und Zigbee
description: sendet einen Befehl von KNX an Zigbee und meldet den Status zurück an KNX
domain: automation
input:
entity_knx:
name: KNX Entität
description: KNX Licht (Schalten und Status)
selector:
entity:
entity_zigbee:
name: Zigbee Entität description: Zigbee Leuchte
selector:
entity:
domain: light
trigger:
- platform: state
entity_id: !input entity_knx
- platform: state
entity_id: !input entity_zigbee
action:
- choose:
- conditions: "{{ trigger.entity_id == entity_knx }}"
sequence:
- service: >
{% if is_state(trigger.entity_id, 'on') %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target:
entity_id: !input entity_zigbee
- conditions: "{{ trigger.entity_id == entity_zigbee }}"
sequence:
- service: knx.send
data:
address: "{{ state_attr(entity_knx, 'state_address') }}"
payload: "{{ is_state(entity_zigbee, 'on') }}"
When I press the wall buttonl, I see that the automation is triggered. but nothing happens. Can you help me make this work?