Add “max_age” parameter to sensor groups to ignore “dead” sensors

Scenario:
Creating a group of temperature sensors, as an “average”-group. One of the sensors run out of battery and stops reporting. The sensor will affect the group average wrongly.

Suggestion:
Add “max_age” as a parameter for the sensor groups, making the group ignore sensors that has not “last_updated” for e.g 1 hour.

Bad idea - configuration that dynamically changes based on rules that are easy for the admin to forget.

Make it error out and easy to fix.

If it’s there there’d be no way I’d ever set it up.

Yes. We shouldn’t cure the symptoms. That sensor should go unavailable and hence be excluded by such.

1 Like

How can I define that a regular sensor gets a state of “unavailable” after X hours of inactivity?

That you can’t. It should be managed by whatever integration it is that is providing the sensor.

Currently using two different - Zigbee2MQTT and Netatmo. Neither of them seem to do that. Will expand with Z-Wave and 433 MHz devices later, but I don’t expect those integrations will do that either?

So since your suggestion isn’t implemented in the integrations, do you have another suggestion on how to best approach this problem? Ignoring them was my best idea…

There are settings in Z2M to control when sensors go unavailable. I suggest heading over to their forum/discord to find out more.

Settings → Availability → Advanced.

1 Like

Thanks, I’ll play around a bit with the availability-setting. It’s at default now (25 hours), but I can’t remember seeing “dead” sensors become unavailable, but might just have missed it (it’s months between each time it happens, so I might very well have missed it). :slight_smile:

But that solves just 1/4 of the sensors.
Should I make suggestion for similar functionality in the 3 other integrations too?

It depends on what the integrations are. If they are MQTT based integrations, that’s up to whoever set up the discovery information because the MQTT integration can handle it.

Netatmo has a very complicated availability logic and the hardware determines how the availability behaves.

As a last resort you can use templates for handling more advanced logic but I’m not sure that’s a logical path to take

1 Like