EPMatt / awesome-ha-blueprints

A curated collection of automation blueprints for Home Assistant.
https://epmatt.github.io/awesome-ha-blueprints
GNU General Public License v3.0
867 stars 254 forks source link

Bug - philips_324131092621 - toggle buggy #604

Open cbird808 opened 8 months ago

cbird808 commented 8 months ago

Blueprint name

philips_324131092621

Home Assistant Core Version

2024.3.0

Home Assistant Installation Type

Home Assistant Supervised

Description

The toggle function produces unpredictable results. I have several hue lights in a room and have a switch set up to toggle the lights on/off. Sometimes the lights don't change state, sometimes only certain lights change state, and sometimes they all change as expected. In all cases, I can see the log has registered the button press. Triggering a lights off or lights on event seems to elicit more reliable toggling behavior. I presume that the helper variable is not being set correctly with the toggle.

Automation YAML config

alias: Livingroom Lights Toggle
description: ""
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: ZHA
    controller_device: 4bb90a96f300f1bede4ab409fdf63816
    helper_last_controller_event: input_text.switch_1_input_text
    action_button_on_short:
      - service: light.toggle
        metadata: {}
        data:
          brightness_pct: 100
        target:
          area_id: living_room
    action_button_off_short:
      - service: light.turn_off
        metadata: {}
        data: {}
        target:
          area_id: living_room
    action_button_up_short:
      - device_id: 131afba61339ddb1e10b401f79dec2db
        domain: light
        entity_id: 858f5df48bd54926d37bb4234603faf6
        type: brightness_increase
      - device_id: ba97aaa8b2feeb978ff2a61ac1d364c2
        domain: light
        entity_id: b2f502e19c7c70e1e9bfa255b78ffb65
        type: brightness_increase
      - device_id: 82523526e97cdb2789f05f2dc731efb9
        domain: light
        entity_id: 52c8e0e35db7b7e0152b26f71c69bc48
        type: brightness_increase
      - device_id: ed31dc5d3b450ac572d8e54a6ff69710
        domain: light
        entity_id: 05b0bddc8e846f8ecffcc0af48cb58cb
        type: brightness_increase
    action_button_up_long:
      - device_id: 131afba61339ddb1e10b401f79dec2db
        domain: light
        entity_id: 858f5df48bd54926d37bb4234603faf6
        type: brightness_increase
      - device_id: ba97aaa8b2feeb978ff2a61ac1d364c2
        domain: light
        entity_id: b2f502e19c7c70e1e9bfa255b78ffb65
        type: brightness_increase
      - device_id: 82523526e97cdb2789f05f2dc731efb9
        domain: light
        entity_id: 52c8e0e35db7b7e0152b26f71c69bc48
        type: brightness_increase
      - device_id: ed31dc5d3b450ac572d8e54a6ff69710
        domain: light
        entity_id: 05b0bddc8e846f8ecffcc0af48cb58cb
        type: brightness_increase
    action_button_down_short:
      - device_id: 131afba61339ddb1e10b401f79dec2db
        domain: light
        entity_id: 858f5df48bd54926d37bb4234603faf6
        type: brightness_decrease
      - device_id: ba97aaa8b2feeb978ff2a61ac1d364c2
        domain: light
        entity_id: b2f502e19c7c70e1e9bfa255b78ffb65
        type: brightness_decrease
      - device_id: 82523526e97cdb2789f05f2dc731efb9
        domain: light
        entity_id: 52c8e0e35db7b7e0152b26f71c69bc48
        type: brightness_decrease
      - device_id: ed31dc5d3b450ac572d8e54a6ff69710
        domain: light
        entity_id: 05b0bddc8e846f8ecffcc0af48cb58cb
        type: brightness_decrease
    action_button_down_long:
      - device_id: 131afba61339ddb1e10b401f79dec2db
        domain: light
        entity_id: 858f5df48bd54926d37bb4234603faf6
        type: brightness_decrease
      - device_id: ba97aaa8b2feeb978ff2a61ac1d364c2
        domain: light
        entity_id: b2f502e19c7c70e1e9bfa255b78ffb65
        type: brightness_decrease
      - device_id: 82523526e97cdb2789f05f2dc731efb9
        domain: light
        entity_id: 52c8e0e35db7b7e0152b26f71c69bc48
        type: brightness_decrease
      - device_id: ed31dc5d3b450ac572d8e54a6ff69710
        domain: light
        entity_id: 05b0bddc8e846f8ecffcc0af48cb58cb
        type: brightness_decrease
    button_on_long_loop: true
    button_off_long_loop: true
    button_up_long_loop: true
    button_down_long_loop: true
    button_up_long_max_loop_repeats: 20
    button_off_long_max_loop_repeats: 5
    button_down_long_max_loop_repeats: 20
    helper_debounce_delay: 0
    action_button_on_long:
      - service: light.turn_on
        metadata: {}
        data:
          brightness_pct: 100
        target:
          area_id: living_room
    button_on_long_max_loop_repeats: 5
    action_button_off_long:
      - service: light.turn_off
        metadata: {}
        data: {}
        target:
          area_id: living_room

To Reproduce

  1. Trigger the On Button Short Press which is set to toggle lights

Expected behavior

If lights are on, they should turn off, and vice versa

Actual Behaviour

Unpredictable

Sometimes the lights don't change state, sometimes only certain lights change state, and sometimes they all change as expected. In all cases, I can see the log has registered the button press. Triggering a lights off or lights on event seems to elicit more reliable toggling behavior.

Additional Details

Screenshots

No response

Additional context

No response