Will this nighttime automation work?

Hi All, I’m attempting to build an automation that will turn on a bedroom strip when myself or my wife gets out of bed in the middle of the night.

The question I have is, will this work? The reason I ask is cause I have two triggers and two “wait for triggers” where one of those may or may not change.

For example, if I get up to go to the bathroom and my wifes still in bed, will this automation work or will it fail cause the sensor state won’t change? I purposely left out the “From” change and only input a “to” change.

Hope this makes sense!

alias: Out of bed Nightlight
description: “”
trigger:

  • platform: state
    entity_id:
    • binary_sensor.sleepnumber_bedroom_amanda_is_in_bed
      from: “on”
      to: “off”
  • platform: state
    entity_id:
    • binary_sensor.sleepnumber_bedroom_anthony_is_in_bed
      from: “on”
      to: “off”
      condition:
  • condition: device
    type: is_on
    device_id: 9ab18fb3491bcc383b9995c14a79064c
    entity_id: 7adaa64621c887529a1bc9b66ecebb96
    domain: switch
    action:
  • type: turn_on
    device_id: d1d9a5f3624e6e422ea1727503a6d5f5
    entity_id: e67373d5ac00d49dd63672138dc457b6
    domain: light
    brightness_pct: 10
  • wait_for_trigger:
    • platform: state
      entity_id:
      • binary_sensor.sleepnumber_bedroom_amanda_is_in_bed
        to: “on”
        for:
        hours: 0
        minutes: 0
        seconds: 10
    • platform: state
      entity_id:
      • binary_sensor.sleepnumber_bedroom_anthony_is_in_bed
        to: “on”
        for:
        hours: 0
        minutes: 0
        seconds: 10
  • type: turn_off
    device_id: d1d9a5f3624e6e422ea1727503a6d5f5
    entity_id: e67373d5ac00d49dd63672138dc457b6
    domain: light
    mode: restart

Unfortunately not. You have to pass the code using </> to start with.

See the sticky about code formatting.