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
860 stars 254 forks source link

Bug - Hue Dimmer Switch controller not working with Zigbee2MQTT #406

Open Insight-Rich opened 2 years ago

Insight-Rich commented 2 years ago

Blueprint name

Controller - Philips 324131092621 Hue Dimmer switch

Home Assistant Core Version

2022.8.7

Home Assistant Installation Type

Home Assistant Supervised

Description

Automation created from blueprint doesn't seem to recognise button presses from switch connected via Zigbee2MQTT.

Automation YAML config

alias: Controller - Hue Dimmer switch 1
description: ""
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: Zigbee2MQTT
    controller_entity: sensor.hue_dimmer_switch_1_action
    helper_last_controller_event: input_text.last_controller_event_hue_dimmer_switch_1
    action_button_on_short:
      - service: notify.persistent_notification
        data:
          message: hello world

To Reproduce

Short press On button of selected controller.

Expected behavior

Notification appears.

Actual Behaviour

Notification does not appear.

Additional Details

Screenshots

No response

Additional context

From having had a dig around, it looks as though the action_mappings for zigbee2mqtt (lines 323 - 335) are incorrect.

According to the zigbee2mqtt website, it uses the form "on_press", rather than "on-press" as the code here seems to expect.

Insight-Rich commented 2 years ago

trace automation.controller_hue_dimmer_switch_1 2022-09-03T11_30_19.535507+00_00.json.txt

Insight-Rich commented 2 years ago

Further investigation reveals that zigbee2mqtt also fires off undocumented *_press_release actions:

image

Bastian007 commented 2 years ago

Facing the same issue. Then I have replaced at line 372-396 minus character with underscore character. All newly created automations are running now as expected.

zigbee2mqtt:
      button_on_short:
        - on_press
      button_on_long:
        - on_hold
      button_on_release:
        - on_hold_release
      button_off_short:
        - off_press
      button_off_long:
        - off_hold
      button_off_release:
        - off_hold_release
      button_up_short:
        - up_press
      button_up_long:
        - up_hold
      button_up_release:
        - up_hold_release
      button_down_short:
        - down_press
      button_down_long:
        - down_hold
      button_down_release:
        - down_hold_release
willsy555 commented 2 years ago

Thank you... just switching over from a hue to zigbee2mqtt... this has been driving me mad this morning. Made the change as per above to the stored blueprint. All working perfectly now. Thanks!

lbarnes2 commented 2 years ago

Facing the same issue. Then I have replaced at line 372-396 minus character with underscore character. All newly created automations are running now as expected.

This fixed issue for me also.

Blubbaz commented 2 years ago

Thx @Bastian007 this issue made me crazy today. Would be cool to create PR for it, do want to do it or should I?

Bastian007 commented 2 years ago

Feel free to raise a PR :-) But I've got the feeling that this project is more or less discontinued

reelsea commented 1 year ago

same issue here - man this has been driving me NUTS! Thank you @Bastian007 !

jvanhambelgium commented 1 year ago

Same issue here - good thing I spotted this issue in the buglist! Thanks @Bastian007 !

popy2k14 commented 1 year ago

@Bastian007 Same issue here, thx for the solution! Will this be merged?