KNX switch with ESPHOME switch

I have a switch in a ESPHOME device which I want to control also with a KNX switch. Currently I have the entity exposed with KNX expose and I can see entity changes on KNX bus when I switch the enttity on ESPHOME side.
If I switch the entity from KNX side, nothing happen on the ESPHOME side, it looks like it is one-way currently.
I am unsure, if KNX expose should work two-way or it is only one-way.

Any idea how to configure a KNX switch to control an entity in a ESPHOME device?


Hi :wave:!

It is supposed to work one way. HA > Knx

There are plenty of threads about controlling a HA entity from Knx. See eg. KNX switch to call HA scenes - #3 by sunstarfire

1 Like

Thanks for the expose explanation.

Well, then I guess automation is the only way to do that. I was hoping there was a simpler solution with ESPHOME and KNX.

FYI There are no (afaik) direct interactions in HA between integrations. So an integration interacts with HA and HA handles interactions with other integrations. So there is no special between KNX and ESPHome (or any other integration) by design.

Hm… HA is cool, but openhab could deal with this without doing anything. Now it seems I need 4 automations or 2 “complex” ones to switch two entities… would be nice to have something like “expose” to interconnect KNX with HA entities two-way

Imho it’s not that complex. Use Knx interface device triggers and set trigger ids for them. In the action call a service according to the trigger id (and if needed trigger data - brightness or something like that). That should fit in a single automation. Maybe you can even find a blueprint for this.

On the other hand, it would indeed be cool to have a two-way expose too. If you know some python feel free to contribute :snake::wink:

1 Like

I managed it with 2 automations and expose. Works now.

I know python not very good, I am more on C/C++ :slight_smile: