Create a Template Sensor that reports the value of your existing temperature sensor but only if it’s not offline. If it is then the Template Sensor reports the value of a secondary temperature sensor.
Configure your Generic Thermostat to use the Template Sensor as its reference.
Let me know if you need help to compose the template for the Template Sensor. I’ll need to know the entity names of the primary and secondary temperature sensors and what they report when they’re offline (I assume it’s unavailable or is it something else?).
That’s what I figured out after I posted the above (got to love search and the HA community). I’ve abstracted the physical temperature sensors away from the thermostat and placed them behind a virtual one (template).
Really appreciate you confirming that’s the right way of doing it
I just need to play about and see what the state changes to when the sensor goes offline. I’ve had two scenarios, one where HA detects it as offline (so I’m hoping there is a value/state for that), the other scenario is where HA thinks it’s still online but the temperature hasn’t changed in a long period of time (I’m hoping I can use something like a last updated value).
This is all new to me, so I’m stumbling about and searching for snippets of code that I can then cobble together I still haven’t got my head around the various states of entities. I believe low level they are either on/1 or off/0 but depending on their type they can have aliases that represent the on/off (eg: open/close)?
A binary_sensor’s valid state values are on and off. If you set its device_class to one of the documented values (like door) then its state values are displayed differently in the UI (but for templating purposes they remain as on and off).