Need help with "INTRUDER" Automation

Hi all. I’m trying to set up an “INTRUDER ALERT” type automation. I currently have a door sensor and some smart lights installed for right now.

I’ve created a “bedtime” scene, where all the lights will shut off. But I wanted to setup an alert if after that scene went into effect, and the door was opened, then it would turn on the “all lights” scene I created, and also send an emergency type message to the two cell phones I have HA installed on.

Granted, I’m totally new at this so please bare with me. Any insight or suggestions are greatly appreciated!

alias: INTRUDER ALERT
  description: ''
  trigger:
  - type: opened
    platform: device
    device_id: 4ff2714e114dfa3f18a7e42
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
    domain: binary_sensor
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: scene.bedtime
      state: 'True'
      for:
        hours: 0
        minutes: 20
        seconds: 0
        milliseconds: 0
    - condition: device
      device_id: 177d73843705bd7d74b26
      domain: device_tracker
      entity_id: device_tracker.brad_s_iphone
      type: is_home
    - condition: device
      device_id: b7ff347376df434314c3
      domain: device_tracker
      entity_id: device_tracker.meaghans_iphone
      type: is_home
  action:
  - service: notify.mobile_app_brad_s_iphone
    data:
      message: Someone Just Entered through Garage
      title: INTRUDER ALERT
  - scene: scene.all_lights_on
  mode: single

Is something not working? What’s the question?

Scenes actually don’t have a “true” or “false” state. They only have one state which is “scening”. I would recommend going to the Helpers section under Configuration and creating a Toggle. The toggle is just a binary sensor. Whenever your bedtime routine is triggered, have it turn on this sensor. I would recommend having the sensor turn off either at sunrise or during a morning automation you may have. Replace every instance of “scene.bedtime” with this sensor in your automation (Its states are on or off). This would ensure that your automation actually triggers. Right now, this automation will not do anything since the condition will always return a false value, due to scenes never having a “true” value. Hope this helps, let me know if you need a clearer explanation of anything.

What you are trying to do can pretty much be done using Alarmo.

Awesome! I’ve never heard of that, but just installed it. Looks like it does have a bunch of the things I was looking for. Doesn’t have everything, including making sure our locations are in the house, but still great