WTH can't a duration be easy to add for some devices?

One part I use a lot is on Triggers where the part at the bottom you enter “For x hh,mm ss”

But at times some devices and entities don’t have this option. Sometimes I don’t want that to be part of the trigger condition (it might form part of it but not just related to the trigger) OR it’s not available for a specific trigger.

For example a sensor device has a trigger as “Device offline”, But then no “Duration”

It would be great if the “Time and location” condition could be improved under say the “And IF” category to have an easy way to add FOR a certain amount of time.

It feels like a big missing area? Just to add a simple condition as “Duration” to go there OR a bolt on to all triggers even for the ones that done have it. Maybe “+ Add duration”

I think this is one of the longest running things that’s bugged me, for an easy way to add time conditions. I hope I have not missed a really simple way to do this but I’ve not stumbled across this as of yet for a simple click and type it in.

Many triggers do not have the ability to attach a duration to them because it’s not possible with the data that we have. Can you give examples of the exact trigger you’re referring to with yaml? There’s likely a way to do it with a different trigger.

Sure, i imagined that would be why it wouldn’t show up. I just imagined that HA could get a count running in the background if requested and when met actioned as duration.

A few examples.

A Zigbee device goes offline. Such as this one below.

device_id: *redacted*
domain: zha
type: device_offline
subtype: device_offline
trigger: device

Or a device enters a zone for a set amount of time.

device_id: *redacted*
domain: device_tracker
entity_id: *redacted*
type: enters
trigger: device
zone: zone.m4_bassett_underpass

As i start to look quite a few have the duration for some aspects but not others. This is where i was thinking an “And If” addition might be a good way to simply add a count in the background for the condition.

Trying to remmber a couple of specific examples I tried to get working, then I hit the wall (some have been a fair while ago as i just put them down to not being able to be done) for being able to achieve them. .

Those are event triggers, they are moments in time (think of them as a button being pressed). You can’t attach durations to them. Instead, you should be using the associated entities that represent online/offline and home/away. Those will have the ability to attach a duration to them.

1 Like