💡 Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

@DariusM73

Now I understand what you’re trying to do. We’re going to flip the logic a bit, so don’t worry too much about the terms Lights and Night Lights… just focus on the setup.

Step 1: Create a Template Binary Sensor

Before we begin, ensure your device tracker is already set up. Now, follow these steps to create a Template Binary Sensor to track when no one is home:

  1. Go to Settings > Devices & Services > Helpers (top tab).
  2. Click Create Helper.
  3. Select Template, then choose Template Binary Sensor.
  4. Provide a Name and select a Device Class (optional).
  5. (Optional) Link this sensor to an existing device for better organization.
  6. In the State template field, enter one of the following codes:

State Templates
You will have to choose the one that suits you the best.

  • All devices away
{{ states.device_tracker | selectattr('state', 'eq', 'home') | list | count == 0 }}
  • All persons away
{{ state_attr('zone.home', 'persons') | list | length == 0 }}
  • All specified persons away
{{ state_attr('zone.home', 'persons') | list | select('in', ['person.one_here', 'person.two_here']) | list | count == 0 }}

Step 2: Configure the Sensor Light Blueprint

Once your binary sensor is created, use these settings in your Sensor Light Blueprint:

  1. Trigger: Your motion sensor.
  2. Lights: Add your lights, set a delay, and under Light Control, set brightness to 5%, then choose a transition and colour (for sleep mode).
  3. Bypass: Enable option 2 and enter in your Template Binary Sensor for tracking if your home or not.
  4. Ambient Light: Enable and configure to your preference but make sure NO - My Ambient Light Sensor is not affected by the Lights is selected.
  5. Night Lights Settings: Enable it, use the State Condition and enter your sleep helper (Note: Sleep helper must be OFF when sleeping, ON when awake).
  6. Night Lights Add your lights and set a 2 minute delay.
  7. Night Light Control, set brightness to 100% and choose a colour. make sure you also Enable “If lights are ON, adjust when crossing over.”
  8. Glow Lights: Enable it and configure them, set brightness to 10% and choose a colour. (This is for when you arrive home)

In the morning and evening, the light colour will remain the same, but Dynamic Lighting (colour temperature adjustment) will handle that.

For now, set this up and test it… I haven’t run it myself… all in my head, but this is the general approach. Once it’s working, you can explore Dynamic Lighting further.

Let us know how you go.

Blacky :smiley: