Smart Bulb retains it's state when power loss

Hello there,

I have a Smart Bulb type EMOS GoSmart A65 connected via zigbee to my home assistant on raspberry pi. I wanted to monitor its unavailability(power loss) using uptime kuma. The issue is that the smart bulb retains it’s state event after power loss, meaning that when the state of it was for example ON and then there is a power loss like for example when I turn it off manually via normal switch, the state is still on in a response from the endpoint.

This is the part in configuration.yaml for the enpoint:

sensor:
  - platform: template
    sensors:
      living_room_smart_bulb_status:
        friendly_name: "Living Room Smart Bulb Status"
        value_template: "{{ states('light.tz3210_grzkr4mu_ts0505b_light') }}"

And this is what the response looks like:

{
    "entity_id": "sensor.living_room_smart_bulb_status",
    "state": "on",
    "attributes": {
        "friendly_name": "Living Room Smart Bulb Status"
    },
    "last_changed": "2024-05-24T07:51:12.650134+00:00",
    "last_reported": "2024-05-24T07:51:12.650134+00:00",
    "last_updated": "2024-05-24T07:51:12.650134+00:00",
    "context": {
        "id": "01HYMSA70AP6W33K905GVN07E1",
        "parent_id": null,
        "user_id": null
    }
}

How can I tackle this issue?

You don’t specify if you’re using the ZHA or Z2MQTT integration for ZigBee.

For Z2MQTT, there’s definitely a setting for how long to wait before considering the device as unavailable (defaults to 24h for routing devices).

Not sure if there’s an equivalent setting in ZHA. You might need to have a look at the docs.

Edit: Found the setting in ZHA. Go to the ZHA Integration page > Configure > Consider mains devices as unavailable after (network tab under global options).
Default is 7200s (2 hours) for mains devices. Remember to click Update Configuration after applying your changes.

In deconz and that would be available I guess on other integrations, in the device, there are some default parameters that you can change for power loss.

Here it will remain but you can put off.

Works like a charm, thank you :pray:

1 Like