Home when the Street Lights Come On

Did your mom ever tell you to be home before the street lights come on? That’s the guidance I give to my boy as he roams the neightborhood with his friends but he’s 12 and easily distracted so, I’m often sending “Time to come home, bud” messages. I got bored with that tonight and decided to let Home Assistant do it for me.

So, this got more than a little nerdy; as if HA wasn’t over-the-top nerdy already…

It seems “night” officially starts when the sun falls below the horizon but that’s not when it gets dark since light bounces and bends over the horizon for a while after that. See https://www.weather.gov/fsd/twilight for the details if you’re so inclined. I found the street lights come on here when the sun is about 2 degrees beyond the horizon so I used that number. Here’s the automation.

alias: John out Late
description: ''
  - platform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: '-2'
  - condition: state
    entity_id: sun.sun
    state: false
    attribute: rising
  - condition: not
      - condition: zone
        entity_id: person.john
        zone: zone.home
  - service: notify.mobile_app_john_s_phone
      title: Sundown
      message: Time to head home if you don't have permission to be out late.
mode: single

No more “Time to come home, bud” text messages. He’s gonna hate this…

comments powered by Disqus