I have some Tuya curtain switches to control my external blinders. I’m trying to create an automation which triggers when one switch remains accidentally on ‘open’ or ‘close’ (for more than 1min) in order to ‘stop’ it before the motor got damaged.
I tried to use state and play a bit with some values there:
platform: state
entity_id:
- cover.sunshade_garden_curtain
to: closed/closing
from:null/unknown/unavailable
for:
hours: 0
minutes: 0
seconds: 5
Go to Developer Tools > States and find cover.sunshade_garden_curtain. Its current state value will be displayed. What you see there represents the entity’s actual state value. For example, closed or open.
So if you want a State Trigger to detect when the cover’s state changes from open to closed you would configure it like this:
platform: state
entity_id:
- cover.sunshade_garden_curtain
to: closed
from: open
If you want to check if it changes to closed from multiple other states, you specify them like this:
platform: state
entity_id:
- cover.sunshade_garden_curtain
to: closed
from:
- open
- unavailable
Thanks,
It makes sense - and I also tried it like that. Now that you point me to the page where I can see the current state I also understand why is not working: state is always “unknown”. I also tried to see if the value changes while I trigger an action: opening or closing the curtain. Nope… it stays on ‘unknown’. I guess it’s related to Tuya API (which is pretty much not free).