Add lock a switch option

Hey Folks,

lots of KNX devices especially switch Relais offer the opportunity to lock them.
the problem is, that if you do that on KNX perspective a user of HA does not see that and will be able to use the switch in the dashboard, however the displayed switch won’t change the state of the KNX device…

mit would be nice to add lock status address to the switches. So in the dashboard the switch could become greyed out or an icon could show that.

Hi :wave:!
Unfortunately an integration has no way to “grey out” something in frontend.

The only option I would know currently is setting its state to “unavailable”. This has the downside of not being able to see the underlying state, nor trigger it (manually and I think also from automations). Some (most?) actuators support setting a new state while locked and go to that state when unlocked - this would not work from HA then.

You are right! I just read your post ‘Add locked state to Cover · Discussion #545 · home-assistant/architecture · GitHub’ and I think this is just the thing. We need another status_address for the switch, so we can show the state of the switch lock and show via css in the frontend that it is locked.

Right now, when I manually lock my KNX actuator (on the physical push button), I don’t see in the HA dashboard that it is locked. I can trigger the switch in the dashboard and after some time it falls back to the state I locked. I can imagine it is really useful to have the status if it is locked or not.

Do you think it is possible to request this feature from HA Core developers?

I don’t think that many other integrations could make use of that Schema as it is quite Knx specific imho. But I may be wrong there - don’t know that many other systems that well.
Having a feature only for a single integration makes it very unlikely to be picked up in core.

But you can always just create your custom frontend card and use eg. a sensor and a Switch where the sensor defines the style of that card. Don’t ask me how to do that though, I am clueless about frontend.

You already did - that’s what this thread is, isn’t it?