Hello,
I have a gate motor without sensor to know the position (state is unknow)
I see that the entity appears as a cover
I though I could manually update the state to open or closed
So I install a python script to do it than create automation trigger by the opening and closing action
I though it will work but unfortunately the state is set back to unknow.
I don’t know what I should do
My goal is to have my gate icon in blue if open and in grey if closed
I think I just need to deactivate the process that update the state specifically for this cover but after few hours of research and test I can’t solve it
Thanks for your help,
Cédric
After few more hours of reading and watch youtube tutorial I think I may be able to solve my problem by the creation of a template cover that will be a kind of a copy of my current cover.
Do you think that the way to do it?
Yes a template cover is the way to do it.
Manual update of an entity’s state is only for debugging purposes and will be overwritten the next time the entity updates.
I confirm,
I manage to create a template cover.portail_with_state which is a copy of my cover.portail entity.
In order to reproduce the change of state open > closing > close > opening > close, I created some script with timer.
I also create a script for the stop option that put the state to open and the attribute current_position to 50 to have access to all button.
I have just on extra question.
I use the set_state.py script to change my template state and attribute. Is it the way to do it ? Because I understand that there is no meaning of changing a state of a real entity but it’s maybe different for a template entity ?
I just like to be as simple as possible to do what I need but it’s working prety well right now
That set_state.py
script is a hack and not how the system is meant to work. If you have a template cover, use input_boolean
(Toggle) or other helpers to represent the inputs and read these into the template.