Cooldown Period

Hey all, been building dashboards for a few weeks now. Really liking the level of customization. Now for my first question…

I have a tile for my door sensor. Red when it’s open and green when closed. Pretty simple. What I haven’t figured out is how to make the tile stay yellow for five minutes after the door is closed (the cooldown period). This way I can tell at a glance if the door recently closed. If the door reopens before the cooldown, then the tile goes back to red immediately. Is this possible?

You might be able to do it with a rule and a variable.

For example, you might set it up as:

  • Text Variable: $doorStatus
  • Two Rules:
    1. Basic Open/Closed Status
    2. Stayed Closed Status

Rule 1: Basic Open/Closed Status

- Contact changes to closed
- Contact changes to open

IF $context.event.value is open
THEN Set $doorStatus to open
ELSE Set $doorStatus to closed-recently

:information_source: Using $context.event.value in the IF condition makes the rule run faster. Rather than asking your smart home hub for the status of the door again, it uses the triggering event value as the condition.

It’s under Variable → Context Variables (tab): Event > Location/Device Event > Value

Rule 2: Stayed Closed Status

- Contact stays closed for 5 minutes

Set $doorStatus to closed

Dashboard / Tiles

That would give you a variable $doorStatus which has three possible values:

  • open
  • closed-recently
  • closed

Then you could either just add that variable directly to your dashboard and then customize the icon / style as you see fit. Or you could use a Super Tile which gives you more control over how things are displayed.


Here’s an example of the style configuration of a tile using the above variable concept:


Ah that’s brilliant! I haven’t tried it yet but your logic makes sense. Thank you very much.

1 Like