to prevent being locked out when being in the garden, I wrote a simple script that does the following to my garden door covers (rollershutter):
close cover to 1/10th, if it is open (go from 100 “fully open” to 90)
wait 1min
if cover is still at 1/10, close it completely.
This simple script is giving outsiders 1 minute time to go inside, fully open the cover again and keep it from closing automatically. That did work from the very beginning, but it stopped working somewhere before 0.49. As you can image, I did not track the functionality every day but discovered the error once I was outside when covers went down. At this time, HASS was at 0.49
Amazingly enough, checking the cover position using is_state_attr(entity_id,‘current_position’,90) in parallel to script execution returns True. I can only imagine some caching issue or condition evaluation at script start time, not after the 1min delay.
It didn’t. Besides, I wouldn’t expect the script to work at all, if the entity id was invalid. But as I said, the only thing that stopped working is the “only close after 1min if cover is still at 1/10th”. Now it always closes after 1min, even if I ran inside and opened it 100%.
Obviously the key here is that the is_state_attr function is returning true, so the condition is passing.
When the cover is in the partly closed mode, use the state inspector <> to examine the attributes of the cover. Does that show that the current_position is 90. Also I’ve seen a lot of errors where users assume that the value is numeric when in fact it is a string. Although truthfully, that should return “false” errors, not “true” errors. But just to be sure, you can try a filter to convert the value to an integer and see if that helps.
I did that, called {{ is_state_attr(entity_id,'current_position',90) }} as the cover was 10% closed and it returned True. Besides, rolling down the shutter only starts if {{ is_state_attr(entity_id,'current_position',100) }} returns True and this is the same syntax.
In the meantime i figured out, that the current cover’s position is not updated in Home-Assistant. When closing the cover to 90 open (fully open = 100) using cover.set_cover_position, the entity’s attribute “current_position” is properly returned as 90. But, when opening the cover by hand, using the wall switches, the attribute “current_position” remains unchanged at 90, while it should be 100.
That behaviour is still present with 0.53.0, I’m just not sure if this issue was introduced by a Home-Assistant update or by a Homegear update.