Rule to check if a sensor is still alive

I have a fan control rule that uses a comparison between an indoor and outdoor sensor's (Inovelli 4-in-1 device) temperature reading to decide if the fan should run. I'd like to add a check to see if one of these sensors has disappeared, maybe the battery is dead or the wireless connection is lost. Hubitat tends to keep a sensor's last reading recorded as "the" reading. My thinking is I could look at lastActivity to see if it's been a while since it last checked in, but maybe that's only for motion.

What I'd like to know is if its been >12 hours since I've recorded anything from a particular sensor and if so, pause the rule.

I think lastActivity will provide the date of the last activity, whatever it is. That should work for your needs.

There are also a couple of apps out there that can send you a notification if certain devices are offline based on lastActivity or other parameters.

There is a new condition called "Time Since Event". This can be used to test how long it's been since any particular device event, or any device event, has happened. So it's easy to construct a rule with this condition that would pause a rule.

3 Likes

Download the Hubitat app