Disabling Items/taking them out of groups when offline

Hi I’m after some suggestions how to improve my temperature monitoring setup.

I’ve currently got a collections of temperature sensors arround the house, some are Bluetooth via openmqttgateway and some are the Dallas one wire via a mysensors gateway and a couple of others. I’ve got these in two groups as averages for upstairs and downstairs, then use one of these depending on time of day as my heating thermostat with a sonoff 4channel Pro relay replacing the old stat stuck in one room.

That works well except, the other day the Bluetooth gateway(openmqttgateway) died and needed replacing, what I wanted to happen was the averages to ignore these while it was down. I adding datetime updates to all the sensors so I could tell when they last changed and did a rule so if these hadn’t changed for 20 minutes I thought I’d disable the item. I’ve got some rules which disable http things if they are ping able, however I quickly realised items can’t be enabled/disabled in the same way.

Are my only options:
Live with the possibly that a dead battery in a bt sensor could skew the averages
Manually calculate the average on a timer or something

I’m using 3.1 in a Docker container.

I think an Item’s state is ignored when a Group is calculating it’s aggregation when it is NULL or UNDEF. So use the Expire metadata to set the Item to UNDEF or NULL when it is not updated for too long a time. Then the Group average calculation will ignore that Item.

If that doesn’t work you’ll need to use a rule. Since you have to write a rule anyway, I’d move the average calculation to that rule and you can just ignore the Items you know to not be working. But again, you can use the Expire metadata or otherwise set the Item’s state to NULL or UNDEF as a universal flag to indicate the Item’s state is unknown.

Perfect thanks, didn’t know about the expire metadata option.