Hi,
I'm using an Aqara Cube to control my lights and every face of the cube controls a different light.
So I would like to use the rotating function of the Cube to be able to dim the light (which is controlled by the selected face).
So I have to flow variables set like this:
brightness_2 = 254
face = 2
And now I would like to use the face
variable to retrieve the value of the brightness_2
variable, like:
face = flow.get("face");
get_brightness = "brightness_"+face;
brightness = flow.get("get_brightness");
While trying to debug, I see that get_brightness
has the correct value on that brightness
is undefined
Any idea what I can do to make this work?
Complete function:
face = flow.get("face");
get_brightness = "brightness_"+face;
brightness = flow.get("get_brightness");
msg.payload = face;
msg.get_brightness = get_brightness;
msg.brightness = brightness;
return [msg];
Debug result:
event_type: "zha_event"
topic: "zha_event"
payload: 2
_msgid: "f6ec7dd0.ff4f5"
get_brightness: "brightness_2"
brightness: undefined
With kind regards,
Robin