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
831 stars 248 forks source link

Bug - Command name incorrect for Philips Hue Dimmer using Zigbee2MQTT #541

Open RobertClarke64 opened 1 year ago

RobertClarke64 commented 1 year ago

Blueprint name

Controller - Philips 324131092621 Hue Dimmer switch

Home Assistant Core Version

2023.4.6

Home Assistant Installation Type

Home Assistant Operating System

Description

I recently migrated from using ZHA to Zigbee2MQTT. While converting my automations, I selected the Zigbee2MQTT option in the Hue Dimmer blueprint, and filled in the required fields. This however doesn't work properly as the blueprint is expecting commands with hyphens instead of underscores. e.g. on-press or off-hold-release. For ZHA and deCONZ, they're set to on_press and off_hold_release.

My Zigbee2MQTT setup is giving the Hue dimmer commands with underscores. After editing the blueprint source to use underscores, it worked as expected.

Problem Blueprint Code

Link to code

    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]

Should be:

    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]

To Reproduce

  1. Import automation blueprint and set up an automation using a Hue Dimmer set up with Zigbee2MQTT.
  2. Add test sequence in one of the button actions (e.g. turn a light on)
  3. Press button on remote

This will set the last command helper properly, but won't actually do anything, because the automation is looking for command IDs with hyphens instead of underscores.

Expected behavior

The remote buttons should trigger some automation to happen.

Actual Behaviour

The remote buttons do not cause any automation to happen.

Additional Details

RobertClarke64 commented 1 year ago

These updated command names are already reflected in the v2 dimmer blueprint, but not in the v1.

lyricnz commented 1 year ago

I had the same issue, most annoying to debug!