Device online or offline?

Hello Community,

is there a way to find out if a device is on- or offline?

I have several rooms equipped with two temperature sensors (e.g. Hue motion sensor with temperature and NetAtmo) To the control my heating I use the average of both of them to feed a virtual thermostat. This works fine so far, but I had some problems with the heating when one of the two devices went offline. Due to the calculation of the average to control the heating, my thermostat receives a wrong temperature information.

Is it possible to check if a device is offline before using it for a calculation?

Regards
Andreas

Just started 2 days ago with Homey, so I don’t know all ins and outs. But couldn’t you just create two variables (one for each temperature) and use a flow to update them every X minutes, but only when a temparature is actually available for the device? I assume when the device is offline, that flow would abort (leaving you with the last known temperature) or return a null/0 value (on which you can act). Either way you would always have two temperatures to calculate the average.