I tried to look at adapting this blueprint for zigbee2mqtt myself, and Iâm pretty stumped right now.
Here is the zigbee2mqtt documentation page for the Phillips Hue Tap Dial. Quoting from there:
Action (enum)
Triggered action (e.g. a button click). Value can be found in the published state on the action
property. Itâs not possible to read (/get
) or write (/set
) this value. The possible values are: button_1_press
, button_1_press_release
, button_1_hold
, button_1_hold_release
, button_2_press
, button_2_press_release
, button_2_hold
, button_2_hold_release
, button_3_press
, button_3_press_release
, button_3_hold
, button_3_hold_release
, button_4_press
, button_4_press_release
, button_4_hold
, button_4_hold_release
, dial_rotate_left_step
, dial_rotate_left_slow
, dial_rotate_left_fast
, dial_rotate_right_step
, dial_rotate_right_slow
, dial_rotate_right_fast
.
So for example, I have a HA entity called sensor.hue_tap_dial_1_action
- and the state value for that is initially empty. When I press the first button on the Hue tap dial, the state
value gets set to button_1_press
, then when I release the button it changes to button_1_release
, before going back to empty.
Here is a sample HA event for pressing button 1, which I got from the Developer Tools â Events page in HA:
event_type: state_changed
data:
entity_id: sensor.hue_tap_dial_1_action
old_state:
entity_id: sensor.hue_tap_dial_1_action
state: button_1_press_release
attributes:
icon: mdi:gesture-double-tap
friendly_name: hue_tap_dial_1_action
last_changed: "2022-12-26T10:36:36.960161+00:00"
last_updated: "2022-12-26T10:36:36.960161+00:00"
context:
id: 01GN702XQ0Q3TB3WTPDTB2ZWDA
parent_id: null
user_id: null
new_state:
entity_id: sensor.hue_tap_dial_1_action
state: ""
attributes:
icon: mdi:gesture-double-tap
friendly_name: hue_tap_dial_1_action
last_changed: "2022-12-26T10:36:36.964282+00:00"
last_updated: "2022-12-26T10:36:36.964282+00:00"
context:
id: 01GN702XQ4V999W8Y59DRBJMJP
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2022-12-26T10:36:36.964282+00:00"
context:
id: 01GN702XQ4V999W8Y59DRBJMJP
parent_id: null
user_id: null
And here is the HA event for turning the dial left one notch:
event_type: state_changed
data:
entity_id: sensor.hue_tap_dial_1_action
old_state:
entity_id: sensor.hue_tap_dial_1_action
state: dial_rotate_left_step
attributes:
icon: mdi:gesture-double-tap
friendly_name: hue_tap_dial_1_action
last_changed: "2022-12-26T15:09:25.015705+00:00"
last_updated: "2022-12-26T15:09:25.015705+00:00"
context:
id: 01GN7FPE4QPXCKAVCPMCMGDV71
parent_id: null
user_id: null
new_state:
entity_id: sensor.hue_tap_dial_1_action
state: ""
attributes:
icon: mdi:gesture-double-tap
friendly_name: hue_tap_dial_1_action
last_changed: "2022-12-26T15:09:25.016821+00:00"
last_updated: "2022-12-26T15:09:25.016821+00:00"
context:
id: 01GN7FPE4RP928XG1NJP6C35GZ
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2022-12-26T15:09:25.016821+00:00"
context:
id: 01GN7FPE4RP928XG1NJP6C35GZ
parent_id: null
user_id: null
In this case, it seems that there isnât the rich command
, args
, or params
fields that your blueprint refers to.
Are those all special fields that get generated by ZHA for the Hue tap dial?
You wouldnât have any idea on how to adapt your blueprint to suit these types of state_changed
events, would you?
(I did see somebody else has a blueprint for the Hue tap dial and zigbee2mqtt here - however, the functionality is quite basic, and doesnât have your cool âturn the dial to dim the last toggled lightâ, which I really wantâŚ).