Better Thermostat entity unavailable

Hello, I’ve set up better thermostat for three of my radiator valves, combined with external room temperature sensors. That works great, except for every now and then, when one of them becomes unavailable.

So the problem is that the better thermostat entity is unavailable and my automations with it fail. The actual Aqara Zigbee TRV is still available, but obviously doesn’t change its set temp anymore.

To solve this, I have to remove the whole BT device and recreate it. I have already exchanged the TRV, but that doesn’t help.

How can I find out what’s causing this? Can it be caused by the zigbee device loosing connection temporarily? Not that I expect that to be very likely, the TRV and the sensor are only 4m and a thin cardboard door away from a powered router device.

And a second related question, because I always find out about these events much later. I’d like to know immediately. I have a daily automation that notifies me of disconnected devices. It’s a template as follows:

service: notify.mobile_app_cph2449
data:
  message: >-
    There are {{ states.sensor  | selectattr("state", "in", ["unavailable",
    "unknown", "none"])  | map(attribute="entity_id")  | list  | count }} problems with the following devices {{ 
      states.sensor 
        | selectattr("state", "in", ["unavailable", "unknown", "none"]) 
        | map(attribute="attributes.friendly_name") 
        | list 
    }}

But it never picks up on the unavailable better thermostat entity. How should I change it to get notified of that? Or a second template specifically for this maybe.

I am having exactly the same issue. BT device is always “Unavailable”. Did you manage to resolve this?

Hi, can you elaborate on this?

Sorry for not getting back to you earlier. Not long after my post I found out that an update for the better thermostat integration was available in HACS. After the update I had to reconfigure all BT devices with new weather settings. I don’t know if it’s coincidence or not, but I haven’t had the problem since.

Let me know if this helps.

Check the help documentation of HACS and the better thermostat integration.

Same issue here, but in my case a simple HA reboot bring it back again.
So i simply use a automation for it:

//Edit: thx to GPT which make a little Blueprint for me:

blueprint:
  name: Restart Home Assistant on Entity State Change
  description: Restart Home Assistant when any specified entity becomes unavailable, unknown, or has no state.
  domain: automation
  input:
    entities:
      name: Entities
      description: Entities to monitor for state changes
      selector:
        entity:
          multiple: true
    states_to_check:
      name: States to Check
      description: Select the states that should trigger a restart
      selector:
        select:
          multiple: true
          options:
            - unavailable
            - unknown
            - none

trigger:
  - platform: state
    entity_id: !input entities

condition:
  - condition: template
    value_template: >
      {% set states_to_check = states_to_check %}
      {{ trigger.to_state.state in states_to_check }}

action:
  - service: homeassistant.restart
    data: {}

Thanks for adding your idea.
But somehow the status unavailable from the better thermostat devices doesn’t trigger my own warning automation. Physical devices that are unavailable do trigger it.

I just figured out that it’s somehow related to the weather entity. openweathermap seems to break BT.

When setting up a new BT device without a weather entity, it works right away.

That’s more or less what I wrote too.

I configured BT with a weather service called Forecast Home. I don’t know where that came from.