šŸ’” Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

@TurboNikko

When grouping sensors they must be in the same domain. You mmWave would be a binary_sensor and you phone may be a sensor. You will need to change your phone sensor to a binary_sensor. You can do this using a temple helper and select binary sensor. Then in the state template add the code that will mimic your phone… or… however you made the sensor for your phone make it a binary_sensor.

Blacky :grinning:

Hi, I use this blueprint since I switched to Home Assistant but stayed at version 4.9 (and it works very well !).
Can I update this blueprint to the latest without breaking my automations relying on it ? Will it update these automations or I’ll had to make new ones in order to have the upgraded blueprint ?

@Ben90

If you are on version 4.9 then we added RGB to light control. If your not using Colour Temperaturein light control then it wont effect you and you can update. If your using Colour Temperature then all you need to do is unselect Colour Temperature option, update the blueprint then reselect Colour Temperature option again. This post gives you all the information you will need click here.

There has been many features added since then and you will want to update!

When you update the blueprint all your automations will still be there and you won’t need to make new ones. All you have to do is just click on the import blueprint button again to update it.

Enjoy all the new features, and if you get stuck just reach out again.

Blacky :grinning:

Fresh HA, this blueprint 8.2, have 1 automation with door sensors as a trigger + 4 lights, works nicely.

Now, I want to add a bypass switch, bought Ikea Rodret, added via Z2M, all good - I can create automations with this very switch’es on/off triggers.

But the Sensor light ā€œbypass switchā€ drop down list does not have the switch, there are entities for ā€œmqtt updateā€, ā€œidentifyā€ and others but not a switch so I cannot add it for a bypass. Why is that and how to fix or workaround it?

@aik

Just filters use that is meant to make it easy. As long as your bypass has an ON / OFF state it can be used. Just copy past the entity ID in and you be good to go.

Blacky :grinning:

I can se Blacky already answered, but if you’re still struggling, another method is to make a helper entity, as a switch and use a template like:

{% if int(states("sensor.airthings_wave_some_id_illuminance")) > 30 -%}
True
{%- else -%}
False
{%- endif %}

Of course, with as Is_state or similar logic, instead.

Good to know. Maybe you’d want to consider making this a bit more clear in the blueprint.

Also, a value-limit would be great here.

I am not quite sure what to copy. When it is an automation for this switch, the trigger looks like:

domain: mqtt
device_id: 03ef1a93926337ada42d1feecfc3ac01
type: action
subtype: "on"
trigger: device

So I’m now trying an mmWave and PIR sensor as a group like your instructions say but when I make that group the trigger, the automation doesn’t work. My logbook shows both individual sensors being tripped but nothing for the automation. Did I miss a step?

I have a motion detector without a light sensor. I have now controlled the light depending on the position of the sun, which works well in winter. In summer, however, the shutters are sometimes already down when it’s still light. Can I also query the shutters? So that the light also comes on when the shutters are down?

for the starting value i found a easier solution that does not require a second automation
i just added theses lines to your blueprint at line 8879 (when the light is switched on) to use the starting brightness value in light control if activated (or 100% if not defined)
this might be useful for other people

alias: Turn on the switches
        action: switch.turn_on
        target:
          entity_id: '{{ switch_entities_off }}'
        
#new lines here
        action: light.turn_on
        target:
          entity_id: '{{ light_entities_off }}'
        data:
          brightness_pct: "{{ light_brightness if 'use_brightness' in include_light_control else 100 }}"

1 Like

That is a device, are there entities in that device?

Blacky :grinning:

@TurboNikko

Can you provide me a screen shot of your group?

If you add the group to the dashboard can you see it turning ON and OFF?

Blacky :grinning:

@cd84

Maybe rather than using the sun it may be best to use a lux sensor? The when the room as dark it will allow the light to come on and that will work for when you have the blinds closed and in winter when the sun falls below the horizon. This option is Ambient

Blacky :grinning:

Hi @Blacky ,
I’m using an automation setup for our laundry room with a Philips Hue Motion Sensor. The automation relies on the sensor’s built-in lux (light level) reading to trigger the lights when it gets dark after sunset.

However, there’s a known limitation with the Philips Hue Motion Sensor: it only updates the lux value every 5 minutes or when motion is detected. This works well the first time someone enters the room—the motion is detected, the lux value is updated, and the lights turn on if it’s dark enough.

The problem arises when the room becomes vacant and the lights turn off. After that, the lux value doesn’t get refreshed until either motion is detected again or the 5-minute interval passes. So if someone re-enters the room within those 5 minutes, motion is detected, but the lux condition isn’t met because it hasn’t updated yet. As a result, the lights don’t turn on—even though it’s still dark.

As a workaround, I’ve reverted to using a basic automation script with a small delay (even just 100ms) after motion is detected. This short delay seems to give the sensor just enough time to refresh the lux value and correctly evaluate the condition.

alias: Laundry Light On
description: Laundry Light On
triggers:
  - entity_id: binary_sensor.philips_hue_motion_sensor_occupancy
    for:
      milliseconds: 100
    from: "off"
    to: "on"
    trigger: state
conditions:
  - condition: and
    conditions:
      - condition: sun
        after: sunset
        before: sunrise
      - condition: template
        value_template: >-
          {{ states('sensor.philips_hue_motion_sensor_illuminance') | int < 50
          }}
actions:
  - action: switch.turn_on
    data: {}
    target:
      entity_id: switch.shellyplus2pm_switch_0

1 Like

@jitesh_88

I have a Shelly motion sensor in my laundry, and I use it in a similar way. At night, when it’s completely dark, I turned the light ON and took note of the lux value from the sensor. I then set my Ambient Light - Low Lux Value just above that reading. So far, that’s been working well. I’ll do some testing to try and recreate your situation.

In your attempt to resolve it, another approach along the same lines would be to create a template binary sensor based on your motion sensor, but with a 100-millisecond delay. You can then use that binary sensor in the blueprint instead.

If you’re not sure how to do this, here’s an example of the code:

template:
  - binary_sensor:
      - name: "Delayed Motion Sensor"
        state: >
          {{ is_state('binary_sensor.your_motion_sensor', 'on') }}
        delay_on:
          milliseconds: 100
        device_class: motion

Blacky :grinning:

Thanks @Blacky i’ll give that a go.

1 Like

Hello @Blacky,

When I set scenes instead of lights, when night light switch turns on in an occupied room, my lights first turn off, wait 1-2 seconds and turn on at night mode again. I think I am doing something wrong or there is a bug somewhere. Can you check my automation?

alias: "Kitchen lights"
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    night_boolean_scenes_scripts: input_boolean.kitchen_night_light_toggle_helper
    motion_trigger:
      - binary_sensor.kitchen_sensor_group
    light_switch:
      entity_id: scene.kitchen_bright
    include_light_control: []
    include_light_colour_control: disable_colour_control
    light_colour_temperature: 3900
    include_bypass:
      - bypass_enabled_turn_on
      - bypass_enabled_turn_off
    motion_bypass_lights_on:
      - input_boolean.override_kitchen
    include_bypass_auto_off:
      - bypass_auto_off_enabled_on
    bypass_auto_off_delay: 240
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.kitchen_minimum_illuminance
    ambient_light_options: ambient_light_option_disabled
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - entity_state_enabled
    night_lights_entity_state:
      - binary_sensor.night_lights
    night_lights:
      entity_id: scene.kitchen_dimmed
    night_time_delay: 1
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
    night_light_brightness: 70
    include_night_light_colour_control: disable_colour_control
    night_light_colour_temperature: 3300
    time_delay: 2
    boolean_scenes_scripts: input_boolean.kitchen_scene_toggle_helper
    end_scenes:
      - scene.kitchen_off
    motion_bypass_lights_off:
      - binary_sensor.plex_playing
    ambient_light_value: 40
    ambient_light_high_value: 110

Thank you very much!

yes (identify, update, battery, voltage, lqi) but none of them is a switch. And, annoyingly, all possible actions are not available until I do them first on the actual switch. Say, long click is not available for selecting for automation until I do click for long period on the actual button.

BYPASS confuses me. what the heck is it?

It is more ā€œoverrideā€. If you want automation to stop - you can add an additional switch to do so. Like what I am trying to do, except the blueprint hates mqtt switches.

1 Like