UI Automations "If" Examples?

I’m trying to make my automations better… Currently I have two automations:

  1. Turns a lamp off once a zigbee button is pressed and resets automation trigger.

  2. Changes the lamp colour to the normal shade of warm white and resets automation trigger.

As you can see this works but was hoping to make this into one automation using the conditions option but can’t seem to get this to work. As far as I can tell the is the condition is false then the automation stops. I want if the condition is true do “X” if false do “Y”.

Should i be in Yaml for this?

Delete your condition and add choose as action.
Add your condition there and action.
Add another choose and add the other condition and action.
Press save.

You are. You just edit it “visually”.

Correct (or - the action sequence is not executed)

See Choose a Group of Actions.

Since you haven’t posted any actual code here we are really only guessing at what you are trying to do with what you are currently using.

1 Like

Hellis81, Thanks CHOOSE was what i was after!

alias: PostBox-02 Reset Post Box Button
description: ''
  - platform: event
    event_type: zha_event
      command: toggle
      device_id: cc9f3e1ad77b273c49af8afd4eeeda0
condition: []
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.automationcalllampson
            state: 'on'
          - service: light.turn_on
              transition: 5
              color_name: white
              brightness: 255
            entity_id: light.spare_lamp
      - service: light.turn_off
        data: {}
        entity_id: light.spare_lamp
  - service: input_boolean.turn_off
    data: {}
    entity_id: input_boolean.postboxevent
mode: single