How to create a good bathroom automation?

Hy, here is what i want:
a kind of two Automation in one script, called evening/morning and night.

When the sun goes down, the bathroom light turn on till 21:59 with 100% and white and turn off after 5 minutes w/o motion detection. After 22 oClock the night script start to turn the light down to 10% and green and turn of after 2minutes w/o motion detection.
When Time is after 5am (04:59 oClock) it already start the 100%, white, 5 minutes script and when Sun rise, the automation should stop.
But i really confuse how to do this -_-

I tried this with two different automations, but the “Evening” override the “midnight” one and its is really bright in the night at 2 am -_-
If possible you can teach me in the Visual Editor for better understanding :blush:

My Setup:
Two Acara motion Sensors, they working really well and a RGB+CCT Smart Light as Bathroom Light.

Here is how i started but totally failed

Would be awesome if someone can help me out and explain every step :slight_smile:

When you select the Blueprint section in the topic, you are dropping this question into a place where people talk about blueprints. I would change that to automation get a more focused audience to your question about automations.

Also automations are a thing. Scripts are a thing. Not the same thing. And while you can call scripts from automations, you don’t really ever put automations into scripts. You can make more complicated automations, which I’m guessing is what you are asking for. I suggest getting the 2 simpler automations working with each other first before you get into templates, choose statements, and trigger_id’s in more complicated ones.

Now you didn’t completely share what you have done, so we are going to have a hard time helping you fix what you have started. We would need to see the automation yaml. Preferably the 2 automations you wrote that interfered with each other. That is likely to be closer to what you want.

If you are looking to have someone write this for you while you test it and tell them why you don’t like it, I don’t think that is going to happen. You can ask, but that is not likely to happen.

1 Like

Good Morning, thank you for your overview.
Now i little bit more confused like before, but i really think about it and try to understand the different of it.
And you are right, maybe it is easier for me to understand how this wworks with a small tutorial. I allready search for this, but haven´t find for now.

Yesterday in the evening i also tested YAMA V10 Blueprint (maybe the reason why i thought we talk about a blueprint), but already fail.


What i have done so far, i added three automations:

First one

Triggers:
Two Acara Motion Sensors

Condition:
#1 Test if any of 2 conditions matches

  • After Sunset
  • And Before Sunrise

#2 Test if any of 2 conditions matches

  • Confirm the time is before 09:59 PM
  • Confirm the time is after 04:59 PM

Action:

  • Turn of Bathroom Light, 90% Brightness
  • Activate Scene Bathroom - change light to white

Second one-
Triggers:
Two Acara Motion Sensors

Condition:
#1 Test if any of 2 conditions matches

  • After Sunset
  • And Before Sunrise

#2 Test if any of 2 conditions matches

  • Confirm the time is after 10:00PM
  • Confirm the time is before 4:59 PM

Action:

  • Turn of Bathroom Light, 10% Brightness
  • Activate Scene Bathroom Night- change light to green

Third one-

Triggers:
Two Acara Motion Sensors
Duration 00:02:00

Action:
Turn light in Bathroom off

When i writing this down now. i see the first conflicts, because i want that both conditions hit and not just one…and why i don´t add the duration to the first two automations…


edit: here is how i change both automations

alias: BadezimmerAbends
description: ""
trigger:
  - type: motion
    platform: device
    device_id: f3f23f5525b562b60fc6f823a09dc14e
    entity_id: 91a40c312486c6fec8d554295019e219
    domain: binary_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - type: motion
    platform: device
    device_id: 89605958705643f64de149a9b8dd4e93
    entity_id: a4843c7ece9b37ffc79874caffe5d552
    domain: binary_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: sun
            after: sunset
          - condition: time
            before: "21:59:00"
      - condition: and
        conditions:
          - condition: sun
            before: sunrise
          - condition: time
            after: "05:59:00"
action:
  - type: turn_on
    device_id: db82274192ca2eb11b9c1d9c294acc8f
    entity_id: df22e9d601ea943471fbf58d7bae46cf
    domain: light
    brightness_pct: 100
  - service: scene.turn_on
    target:
      entity_id: scene.badzeimmerabends
    metadata: {}
mode: single


alias: BZNachtlicht
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 89605958705643f64de149a9b8dd4e93
    entity_id: a4843c7ece9b37ffc79874caffe5d552
    domain: binary_sensor
    for:
      hours: 0
      minutes: 2
      seconds: 0
  - type: motion
    platform: device
    device_id: f3f23f5525b562b60fc6f823a09dc14e
    entity_id: 91a40c312486c6fec8d554295019e219
    domain: binary_sensor
    for:
      hours: 0
      minutes: 2
      seconds: 0
condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: sun
            after: sunset
          - condition: time
            after: "10:00:00"
      - condition: and
        conditions:
          - condition: sun
            before: sunrise
          - condition: time
            before: "05:59:00"
action:
  - type: turn_on
    device_id: db82274192ca2eb11b9c1d9c294acc8f
    entity_id: df22e9d601ea943471fbf58d7bae46cf
    domain: light
    brightness_pct: 10
  - service: scene.turn_on
    target:
      entity_id: scene.bznachtlicht
    metadata: {}
mode: single