#Frustration with Choose

1 messages · Page 1 of 1 (latest)

frosty meteor
#

Hey All,

I'm trying to use a Zigbee switch which has "single" "double" and "hold actions" to control multiple lights

I can chose these in 'when' as

triggers:

  • domain: mqtt
    device_id: 0469fcd65c3b954222ed45abe9dd5c1c
    type: action
    subtype: single
    trigger: device

However, I want to use 'choose' to have multiple actions (single does light A, double does light B, ect), however under 'choose' I cant select these as valid selected options, as per the attached picture.

For now I have multiple automations, but I love simplicity and legibility, so having the same button control al the lights in a single room in a single automation makes the most sense to me.

Any help?

sacred gyro
#

You can make 3 triggers (one for single, one for double, one for hold). Give each a unique trigger ID.

Then in the choose block, you can use "triggered by..." as the condition to select the action based on the trigger id.

frosty meteor
#

When you say a trigger/trigger ID, is this in the automations YAML, or something closer to a helper?

sacred gyro
#

It's in the automation editor UI

#

look in the dotsvertical part of the trigger

frosty meteor
#

ahh, i see it

#

Didn't know that was a feature.

sacred gyro
#

That allows you to differentiate which trigger initiated the automation later on.

frosty meteor
#

very cool!

#

Now i just need to figure out how to have 'hold' first turn both lights on, and then toggle, but that should be a basic choose/if setup.

#

thanks for the help Karwosts

#

was just weird that i could see these events under triggers, but not under choose. /shrug

frosty meteor
#

got it to work

On Hold:

If both lights are on, AND the trigger is hold, then toggle,
default Turn both lights on