How to run an HA script with a KNX switch

I have scripts for switching lights on and off in HA, i.e. two scripts, one switching on and one switching off, I would like to link their start to a button on the KNX switch.
How can I do it ? maybe there are some examples ?

Hi :wave:!
You can create an automation with knx.telegram trigger.

1 Like

I would like a little more details, what address should be written in the ETS for the switch buttons ? how to enter this address in the HA ?
I would just like to understand the scheme of what to do in ETS, what to do in HA
So far I understand that I need automations that will somehow react to the knx button.

the knx.telegram trigger can be configured to trigger on a specific GA (or multiple if you need to) with the destination field. See https://www.home-assistant.io/integrations/knx/#telegram-trigger

So the knx button shall send to any GA and your HA automation would listen to the same and call an action (eg. start the script you created).
If desired, you can branch on the different payloads the switch sends to call different actions. See https://youtu.be/O3p3dISvTtI

1 Like

GA is a group address ?
But I have not understood and in ETS what group address to write on the button there should be two on the action and on the status.
I have all group addresses on the buttons are somehow connected with real equipment, but when I need to run not knx equipment, but HA script that can run anything, what addresses do I need to write in ETS ? Make up new unrelated addresses and process them in HA ?

In the video also nothing about ETS, only about HA

Yes.

Yes, if you only want to use it in HA.

1 Like

Okay, let’s say I created a new group address in ETS.
How should I enter it in HA ? Is it a sensor ? Or a binary server ? Or something else ?

It doesn’t have to be any entity type. The trigger lives and works in the automation. Just set it up for the GA you want to listen to.

1 Like

Wow this really works, your video helped a lot!

But I have these settings in my trigger, should I leave them all on ?

And I don’t understand what to do with the status of the button, I have it with LED and I would like HA to send the status itself and the LED to light up with the desired light.

It depends on what you want the trigger to do :person_shrugging:
If you just want to react on a button press, you could only enable “GroupValueWrite” for “Incoming” telegrams.

The status of what exactly? If you know that, you can use an automation with knx.send action to send some data to KNX or use knx expose.

1 Like