Hue bulb state not updating

I’ve got a (not-Hue) Zigbee bulb added via the Hue integration. I’m monitoring the bulb in an automation to trigger a routine when the bulb’s state changes from “on” to “unavailable”.

All was working well until a few weeks ago when HA suddenly stopped being informed that the status has changed. Now, HA always says the bulb is on when it is unavailable. Both the Hue and Google Home app apps on my iphone both correctly show that the bulb is unavailable.

The only difference between the “unavailable to on” and “on to unavailable” automations is that, in the troublesome “on to unavailable” one, the bulb must have been unavailable for 5 seconds before the automation is triggered (to counter the zigbee bulb dropping off momentarily, which seems to happen a lot on my network).

The odd thing is that I also have another automation that triggers when the bulb goes from unavailable to on, and that is working as you would expect, which makes me wonder if there’s a bug in either HA or the Hue integration somewhere.

The automation is:

alias: Kitchen lights off
description: ''
trigger:
  - platform: state
    entity_id: light.kitchen_light_1
    from: 'on'
    to: unavailable
    for:
      hours: 0
      minutes: 0
      seconds: 5
condition: []
action:
  - service: light.turn_off
    target:
      entity_id:
        - light.sonoff_10006a93b8
        - light.sonoff_10006a6382
        - light.under_stairs
        - light.stairs
mode: single

Any ideas?

Cheers

Which HA version are you running?

It’s the latest & greatest, 2021.12.9.

Actually I was wondering about the timing of this as it’s always been fine in over a year of use, but since the beginning of the year it’s been troublesome. So I’m wondering if the 2021.12.7, .8 or .9 updates has caused the problem.

Cheers

I can confirm that from version 12 seven onwards, the integration has been anything but better. You might want to raise an issue.