core: Error turning on the yeelight bedside lamp d2 after a long period of inactivity

The problem

I have automation configured. Every morning at 8.00 the yeelight bedside lamp d2 is turned on with a brightness setting of 5 and a gradual increase to 255. So sometimes the automation doesn’t work and gives an error

2024-02-24 08:00:30.393 ERROR (MainThread) [homeassistant.components.automation.svetovoi_budilnik] Ночник. Световой будильник: Error executing script. Error for call_service at pos 2: Timed out when calling _async_turn_on for bulb Yeelight Bslamp3 0x1243c06d at 192.168.1.130: <class 'TimeoutError'>
2024-02-24 08:00:30.394 ERROR (MainThread) [homeassistant.components.automation.svetovoi_budilnik] Error while executing automation automation.svetovoi_budilnik: Timed out when calling _async_turn_on for bulb Yeelight Bslamp3 0x1243c06d at 192.168.1.130: <class 'TimeoutError'>

Also, after the yeelight device has not been used for a long time (not turned on/off), then when you press the button to turn on the device in HA, it does not turn on, freezes for a few seconds and only then can it be turned on and off. It is often in the “Unavailable” state

My automatization:

alias: Ночник. Световой будильник
description: ""
trigger:
  - platform: time
    at: input_datetime.nachalo_svetovogo_budilnika
condition:
  - condition: state
    entity_id: input_boolean.svetovoi_budilnik
    state: "on"
  - condition: state
    entity_id: light.yeelight_bslamp3_0x1243c06d
    state: "off"
    enabled: true
action:
  - service: automation.turn_off
    metadata: {}
    data:
      stop_actions: true
    target:
      entity_id:
        - automation.lights_yeelight
  - service: light.turn_on
    metadata: {}
    data:
      kelvin: 4000
      brightness_pct: 1
    target:
      entity_id: light.yeelight_bslamp3_0x1243c06d
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - repeat:
      sequence:
        - service: light.turn_on
          metadata: {}
          data:
            kelvin: 4000
            brightness_step: 5
          target:
            entity_id: light.yeelight_bslamp3_0x1243c06d
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
      until:
        - condition: or
          conditions:
            - condition: state
              entity_id: light.yeelight_bslamp3_0x1243c06d
              state: "off"
              enabled: true
            - condition: template
              value_template: >-
                {{(state_attr('light.yeelight_bslamp3_0x1243c06d',
                'brightness')|int) == 255 }}
          enabled: true
    enabled: true
  - service: automation.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: automation.lights_yeelight
mode: single

What version of Home Assistant Core has the issue?

2024.2.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 27 (5 by maintainers)

Most upvoted comments

Try turning on music mode in the yeelight settings

+1

Looks like there are two issues at play - one is yeelight firmware I suppose - easily 100% reproducible - simply reload your integration more than once, it stops working until you power cycle the lightbulb.

The second issue is why it even gets to that point in the first place - it’s not only time (after n-hours of not using it) dependent but messing with the lights extensively, turning them on and off, using scenes, they eventually stop functioning - even under one hour since last “powercycle.”