Add locked state to Cover #545
Replies: 9 comments 2 replies
-
I think this is a very welcomed addition. I wondered why it is not possible to lock a cover in HA. It is very cumbersome to add al sorts of conditions to cover automations in HA. And I also would like to block my cover controls of our sunscreen when it rains or is very windy. |
Beta Was this translation helpful? Give feedback.
-
This would be a good addition for the new Somfy TaHoma component as well. Currently you would need to have a look at the attributes of the entity; and integrate this in all automations. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@da-anda Please keep the architecture issues on topic. If you have a feature request for Home Assistant, please use the community forum. Thanks 👍 |
Beta Was this translation helpful? Give feedback.
-
sorry, was not aware that attributes are not part of the architecture discussion. But if I may still add something to this issue, in KNX world not only covers can have lock states but also lights, switches etc, and I assume in other bus system it is not much different. So it might make sense to support lock states in more/all HA entities and not just covers. |
Beta Was this translation helpful? Give feedback.
-
I like the idea of having such a locked/read-only flag in the Entity model, for those scenarios where the entity is not "unavailable", but an external factor currently prevents interaction. Prime example the wind speed or rain alarm from OP. If we introduce such a flag into the model, the frontend can react to it and disable the action buttons (e.g. to move a cover or switch something on/off). Looking at it from a bus system perspective such as KNX it would indeed make sense to even have that in more entities, to accurately reflect the state in HA, if due to a lock a light may not be switched on or off currently. |
Beta Was this translation helpful? Give feedback.
-
Would it help the decision making process if I provide the needed changes to the core and frontend to support the architectural change in terms of adding support for the cover entity? Maybe this could then even be integrated in the alexa and google home integrations to get appropriate feedback when moving a locked cover. |
Beta Was this translation helpful? Give feedback.
-
The alternative to purely handle that in the frontend (e.g. by allowing a cover card to specify a separate binary sensor that indicates the lock state) doesn't feel as robust, since if e.g. an automation is attempting to move a cover during the wind alarm, nothing will happen but the user cannot clearly see why. If it were controlled by the entity, it could add a logbook entry ("Moving not possible due to lock state") and that would help with automation debugging/tracing. |
Beta Was this translation helpful? Give feedback.
-
Hello, I also think that this feature is very relevant. Greetings, |
Beta Was this translation helpful? Give feedback.
-
Context
Many cover devices can be locked in a defined position so that automations or hardware buttons can't trigger movements.
Proposal
Adding a property (eg.
is_locked
orread_only
) to cover.py to indicate if the cover can be moved currently.Consequences
The frontend could visualize the locked status so that movement buttons can be deactivated when cover is locked.
When the locking condition is over some devices can resume to the last defined condition (eg. a timer triggered 50% when the cover was locked will be considered when it is unlocked) so it may be good to also distinguish between actual position and desired position (#966).
Beta Was this translation helpful? Give feedback.
All reactions