Global Condition not working when using trigger id and choose statement

I tried to use the trigger id, and select choose in action.
As a global condition, i say if it is Day or Night, but this is not working.
It is only working if i set the same Day or Night condition under the action section.
Has anyone else seen this, is it a bug?

alias: Motion - Bad - Light - Night
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.hue_motion_sensor_bad_motion
    from: 'off'
    to: 'on'
    id: bad-on-night
  - platform: state
    entity_id: binary_sensor.hue_motion_sensor_bad_motion
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: 2
      seconds: 0
    id: bad-off-night
condition:
  - condition: state
    entity_id: input_select.stedmodus
    state: Night
action:
  - choose:
      - conditions:
          - condition: trigger
            id: bad-on-night
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.bad_nattlys
            metadata: {}
      - conditions:
          - condition: trigger
            id: bad-off-night
        sequence:
          - type: turn_off
            device_id: 95d99d01ae71425d7867b78a2700bc7f
            entity_id: switch.bad_speillys
            domain: switch
          - type: turn_off
            device_id: 0610f8688c6a61d12c0a5219e3b551b1
            entity_id: light.hue_white_lamp_3
            domain: light
          - type: turn_off
            device_id: 5a34ca45a32af89030fb4fb66e6acba0
            entity_id: light.hue_white_lamp_4
            domain: light
    default: []
mode: single

metadata is not a valid configuration variable for scene.turn_on

Good point. Im just wondering where those meta data comes from, since i use the ui editor, and i cannot see it.
The scene is a default scene from hue hub.

That is strange. Another thing to try… I think that there may have been issues in the past with hyphens/dashes in names and other config data, so you might try removing them from your trigger ids.

1 Like

Good thought. Actually i went trough many of my automations, and checked for spaces and removed the trigger ids and created them again, and just saved them again, and now it seems to work.
I have also seen similar things with helpers, that after some updates they havent worked, and i just have clicked on save and all is ok.
Thanks for helping out :wink:

1 Like