πŸ’‘ Blueprint for motion lights with day/night mode, illuminance and dimmabel timer

I just expanded my original blueprint for motion lights to be a little bit more smart :nerd_face::bulb::walking_man::sunny:

Now you can have different timers when the lights should turn of depending on if it is day mode or night mode, set by two input helpers. 🫑

The user can also set a dimmable timer, that will dim the lights when they soon will turn off. This mimics the way Hue does it out of the box, but with more flexibility as you can set this yourself!

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

I use it in my hallway and bathrooms, to only turn on the hallway lights when it is dark enough. So the lights will only turn on when they are needed. The day and night mode is nice, because you generally want the lights to turn of pretty quickly during the night and not stay on for so long.

The dimming is also a nice addition as it signals that the light is soon to turn of, so if you want it to stay on, wave to the sensor! :wave:

Here is the gist with the code. Happy automating!

12 Likes

Hey mate, I tried all evening to get the Night time helper to work.
It does not matter what I try, I always get this error:

Error: ValueError: could not convert str to datetime: '2023-08-10 08:10:19'

I tried changing my time format of home assistant but it seems to only change how time is displayed.
Have you had that before or got any clue why this could happen?

Running HomeAssistant 2023.7.2 on docker on a synology nas.

small edit
I was wondering if it was possible to instead use sensor.sun_next_rising / sensor_sun_next_setting values for the night time start and stop datetime.

1 Like

there are an error in the yaml:

  • delay: ’ {% if today_at(states(local_night_end)) < now() or now() < today_at(states(local_night_start)) %}

not β€œnow() or now()” but β€œnow() and now()”