Firstly, I have to say that I am fairly new to home assistant and especially new to Zigbee2MQTT, so I’m not even sure if I’m using the correct vocabulary here.
I have successfully connected a Paulmann 501.40 RGBW-CCT remote control and a MiBoxer FUT039Z RGBW-CCT LED controller via Zigbee2MQTT in my home assistant instance and I have managed to create automations for some basic functions like turning the LED strip on and off, changing brightness and the color temperature, which was easy enough by just reading the Z2M documentation of both devices; for example, the automation for increasing the color temperature is triggered by the color_temperature_step_up action of the remote and it publishes the color_temp_step payload:
alias: WZ RGBW Remote Temp Up
description: ""
triggers:
- domain: mqtt
device_id: 61a4e7a4f6476f8e8b40d03567bcbc1c
type: action
subtype: color_temperature_step_up_1
trigger: device
conditions: []
actions:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: "0"
retain: false
topic: zigbee2mqtt/WZ RGBW CCT/set
payload: "{\"color_temp_step\": \"87\"}"
mode: single
So far so good and now my next goal is to create an automation for the “rainbow ring” that would set the color of the LED strip, but I am completely lost here. According to the Z2M documentation of the remote, a click on the “rainbow ring” triggers the move_to_hue_and_saturation action and if I monitor the “State” of the remote in the Z2M integration in home assistant, I can see that after a press on the rainbow ring the action as well as the corresponding hue and saturation values are listed here:
{
"battery": 100,
"linkquality": 192,
"action": "move_to_hue_and_saturation_1",
"action_hue": 19,
"action_saturation": 254,
"action_transition_time": 0
}
Then, according to the Z2M documentation of the controller, I can change the color by sending a message with a payload of either color_xy or color. My problem is now: how can I read the action_hue and action_saturation values in my automation, so I that I can convert them to either XY or RGB color for the payload to be send to the controller? I couldn’t find any useful anything useful in the documentation of the MQTT trigger or the automation actions that would tell me how I can read out those parameters/attributes/variables/data or whatever the correct term is for the action_hue and action_saturation values.
I have created a simple automation that simply dumps the entire trigger entity into a notification in the hope that it would give me some additional insights about the data I have received from the action as follows
alias: WZ RGBW Remote Hue & Sat
description: ""
triggers:
- domain: mqtt
device_id: 61a4e7a4f6476f8e8b40d03567bcbc1c
type: action
subtype: move_to_hue_and_saturation_1
trigger: device
conditions: []
actions:
- action: persistent_notification.create
metadata: {}
data:
message: "\"{{trigger}}\""
mode: single
but all that I get from this is
"{'id': '0', 'idx': '0', 'alias': None, 'platform': 'mqtt', 'topic': 'zigbee2mqtt/WZ RGBW Remote/action', 'payload': 'move_to_hue_and_saturation_1', 'qos': 0, 'description': 'mqtt topic zigbee2mqtt/WZ RGBW Remote/action'}"
which does not contain the action_hue and action_saturation values that I am looking for.
I am at a total loss here and I hope that somebody can help me out here. Thanks in advance.