Back again with template light question

Hello community,
after some years of absence in this forum (due to my renovation of my bought house - construction date 1952 - with loads of work) i’m back now. It’s amazing how Home Assistant has progressed and what changed and improved over the last 3 years.

After creating the basics I need for the new house from the scratch, I am now at my first point i’m struggling. I hope you can help me.

I have a KNX home now and i want to control my mirror light with a KNX switch. Unfortunately the mirror light is controlled by Zigbee and i have to couple this. I tried this code but it is not working. After an hour of testing and changing things I’m a little bit lost know. Can you help me out please?

light:
  - platform: template
    lights:
      testspiegelschrank:
        friendly_name: "TestSpiegelschrank"
        value_template: "{{ is_state('light.og_ba_knx_spiegelschrank', 'on') }}"
        turn_on:
          service: light.turn_on
          target:
            entity_id: light.villeroy_und_boch_spiegellicht
        turn_off:
          service: light.turn_off
          target:
            entity_id: light.villeroy_und_boch_spiegellicht

I would not use a template light to sync two lights (because that is what you are trying to do, am I right?).

I think a template light won’t work, because the change of the state itself won’t trigger the actions (if it would, there’d be a feedback loop). Besides, the template light would introduce a third light.

I posted this automation a while ago to sync multiple lights. Just replace switch with light in the example:

If it needs to be one way, you can remove either the trigger or the action.
And if you experience a feedback loop, in the same post lower down is a version to prevent that.

You can find multiple blueprints for exactly this purpose. Just search for “knx” in the blueprint exchange topic here.

Thank you for the hint. I tested some blueprints already, but they are still a “new thing” i’m not so familiar with. I tested it and it works like a charm. Thank for the hint :slight_smile: