Hi,
I have a strange issue. I am trying to automate my covers and I can control them through homeassistant just fine and I can also read the current position.
Now, what I am trying to do is to trigger an action only if the cover is closed (position is 0). However, the command is also triggered if the position > 0.
I also checked the template tool within developer tools and the state is showing as I would expect there.
Remember all states in HA are strings unless converted, try : -
â{{ state_attr(âcover.cover_bedroom_leftâ, âcurrent_positionâ) | int == 0 }}â
or slightly simpler in manipulation terms : -
â{{ state_attr(âcover.cover_bedroom_leftâ, âcurrent_positionâ) == â0â }}â
But Iâd go with the first, also though your quote usage is syntactically correct we (on the forum) prefer to use doubles on the outside, singles on the inside
âis numberâ is giving me true and âis stringâ is returning false. I also tried converting the attribute to int and even treating it as a string with == â0â but nothing worked.
Let me guess, youâre clicking the TRIGGER button in the âmore infoâ window of the automation. If you do that (or use the automation.trigger service), it ignores the triggers & conditions and just runs the actions. To test the automation conditions you have to cause one of the triggers to fire.