Automation for Bathroom lights and music and blinds not working. Never triggers and goes down default choose path. Help Please

alias: Bathroom Enter (Alex Home Alone)
description: ‘’
trigger:

  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Sunday
  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Monday
  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Tuesday
  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Wednesday
  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Thursday
  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Friday
  • platform: state
    entity_id: binary_sensor.presence_5
    to: ‘on’
    id: Saturday
  • platform: state
    entity_id: binary_sensor.presence_5
    id: Evening Trigger
    to: ‘on’
  • platform: state
    entity_id: binary_sensor.presence_5
    id: Late Trigger
    to: ‘on’
    condition:
  • condition: and
    conditions:
    • condition: not
      conditions:
      • condition: state
        entity_id: media_player.bathroom_echo
        state: playing
      • condition: state
        entity_id: person.cori
        state: home
      • condition: state
        entity_id: input_boolean.guest_mode
        state: ‘on’
    • condition: state
      entity_id: person.alex
      state: home
      action:
  • choose:
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Sunday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • sun
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_type: amazon_music
        media_content_id: dababy
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Monday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • mon
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_id: asap rocky
        media_content_type: amazon_music
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Tuesday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • tue
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        data:
        media_content_id: lil wayne
        media_content_type: amazon_music
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Wednesday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • wed
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_type: amazon_music
        media_content_id: soja
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Thursday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • thu
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_type: amazon_music
        media_content_id: led zeppelin
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Friday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • fri
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_id: boogie wit da hoodie
        media_content_type: amazon_music
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Saturday
        • condition: time
          after: ‘06:00:00’
          before: ‘18:00:00’
          weekday:
          • sat
            sequence:
      • service: light.turn_on
        target:
        entity_id:
        - light.bathroom_lights
        - light.bathroom_dome_light
        data:
        brightness_pct: 100
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.35
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_type: amazon_music
        media_content_id: kings of leon
      • service: input_boolean.turn_off
        target:
        entity_id: input_boolean.sunsa_blinds
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Evening Trigger
        • condition: time
          after: ‘18:01:00’
          before: ‘22:00:00’
          sequence:
      • service: light.turn_on
        target:
        entity_id: light.bathroom_lights
        data:
        brightness_pct: 40
      • service: media_player.volume_set
        target:
        entity_id: media_player.bathroom_echo
        data:
        volume_level: 0.25
      • service: media_player.play_media
        target:
        entity_id: media_player.bathroom_echo
        data:
        media_content_id: Christmas music
        media_content_type: amazon_music
    • conditions:
      • condition: and
        conditions:
        • condition: trigger
          id: Late Trigger
        • condition: time
          after: ‘22:01:00’
          before: ‘05:59:00’
          sequence:
      • service: light.turn_on
        target:
        entity_id: light.bathroom_lights
        data:
        brightness_pct: 2
        default: []
        mode: single

Your automation contains 9 identical State Triggers. :thinking:

How do you think those nine State Triggers work?

I was thinking they work as like connections to triggers so you can do multiple automations in one. But obviously I have no idea. I use the choose to add booleans for other devices that dont have integrations and thought that I knew what i was doing. But I am not sure.

This is quite the automation you’ve built… Can you edit your post with correct formatting? Just throw three back-ticks (`) in a row both before and after your YAML.

"It will should up like this in the preview when you've done it correctly"

It will just make it easier for people to read through and process!

Take a look here for other helpful tips:

Based on a quick look, it seems like whenever binary_sensor.presence_5 turns on you want something different to happen depending on day of the week. Your automation only needs one State Trigger and you can remove all of the Trigger Conditions.

Ok cool, thanks Tara’s. So if I leave the one trigger for the motion and then the trigger id from all the (and) actions and leave just the day condition it should work? I will check it out. So what are the trigger Ids actually used for since I obviously have no idea and use them horribly wrong?

Usually to differentiate similar triggers (not identical triggers). For example, let’s say I want to trigger an automation at two different times, where one time is for turning on a switch and the other for turning it off. I could use the trigger id to indicate which one triggered.

alias: example
trigger:
- platform: time
  at: '18:35:00'
  id: 'on'
- platform: time
  at: '18:55:00'
  id: 'off'
action:
- service: 'switch.turn_{{ trigger.id }}'
  target:
    entity_id: switch.whatever

Thank you for your help, I appreciate it.

1 Like