Automation - setting a simple period of time

Hi I’m just starting with the automation configuration through homeassistant rather than in YAML.
I have created an automation using an MQTT sensor to advise if my garage door is open. However I want to add a condition that its open for say 60 mins. Given its a MQTT sensor and not an entity how do I achieve this?
Thanks

Use

for:
  minutes: 60

In the trigger

There’s not that option as I’m not using YAML - I’m using the drop downs in the automation section under configuration.
I could add another trigger type of time but thats not really a “for”.
Appreciate advice.

Make a binary MQTT sensor for the door status, and then you can use a state trigger, as suggested by Marc

Why can’t you use for in the automation editor? It’s there for me…

Its because as Tinkerer says I need to make a Binary sensor for the MQTT sensor then it will be there. Thanks for all advice, I now need to find how to make a binary sensor and should be ok.

Why does it need to be a binary sensor? Any kind of sensor will do and you said you already had an mqtt sensor :man_shrugging:

I don’t know. But I’ve seen a mention of that elsewhere. The MQTT isn’t actually a sensor I guess. Perhaps someone else can answer. All I know is it doesn’t actually appear as a sensor.

See the docs

A binary sensor makes most sense for a door, and then you can apply a device class of garage_door so that it looks like one in the UI.

I cannot get the drop down:
Theres no From/To/For as in your example. What am I missing?
Screenshot 2020-09-20 110511

For goes on the trigger not the condition, usually. ie trigger when garage door is in state open for 60 minutes.

Are you on a really old version of homeassistant?

No Im an Idiot! Yes of course its a TRIGGER! Many thanks - sorry to waste your time. All sorted.

1 Like

Ha, no worries, glad you’re sorted :slightly_smiling_face: