Turn light on and off based on detected motion with sun condition

hi, if it possible to add multiple motion sensor, or even a door sensor to the blue print?

1 Like

I’d find this very useful too.

2 Likes

have you figured it out??

This is great stuff! I wonder if there’s a way to allow the light to return to previous state? i.e at sunset, turn on outside lights to 20%. When motion detected, set same lights to 100% for XX minutes. When motion is clear, set same lights back to 20%. At sunrise, turn off. Where sunrise offset, sunset offset, dimmed light state, motion activated light state, and time after cleared state (to reset to dimmed light state) are configurable.

2 Likes

This exactly what I need except, I want to be using in the laundry room in the basement and it’s always dark. So the sun condition doesn’t work for me. Is it possible to just remove the condition from the automation?

I believe this is the best solution for your case: https://community.home-assistant.io/t/turn-light-on-and-off-based-on-detected-motion/255994

Thank you so much!

Would there be a way of having the light coming on at a lower brightness say between 01.00 - 08.00 My wife complains if she gets up in the night to get a glass of water light is to bright.

this automation just turns on and off, to reduce brightness you can do a simple time-based automation to set the desired brightness. (I think it works)

I get the following error

2021-11-06 17:35:10 ERROR (MainThread) [homeassistant.components.automation] Blueprint Motion-activated Switch and or Light with Elevation generated invalid automation with inputs OrderedDict([(‘motion_entity’, ‘binary_sensor.rexense_rh3040_489e1912_ias_zone’), (‘below_elevation’, 5), (‘no_motion_wait’, 340), (‘light_target’, OrderedDict([(‘area_id’, ‘bureau’)]))]): expected a dictionary for dictionary value @ data[‘action’][0][‘target’]. Got None

Whit is configuration:

alias: New Automation
description: ''
use_blueprint:
  path: >-
    rbthompsonv/motion-activate-light-or-switch-based-on-daylight-sun-elevation.yaml
  input:
    motion_entity: binary_sensor.rexense_rh3040_489e1912_ias_zone
    below_elevation: 5
    no_motion_wait: 340
    light_target:
      area_id: bureau

I have the same issue with

I use HA 2021.11.1

been trying to get this to work with an innr exterior light strip on exterior staircase and a hue outdoor sensor , so complicated with software ! want 10 % after sunsut - 80% on motion - 10 % on no motion ,
would then love to change the colours on temp but that could be a separate auto

I run a homematic detector which shall switch on 2 KNX lights.the blueprint is very welcome, as before I could not consider the daylight situation. nevertheless lights are not switching off anymore since I switched to this blueprint here. the trace is tellng me lights haver been switched off 120 seconds after motion has been detected but in reality I see lights be still switched on next morning

Hola, puedes poner los sensores pir en una zona baja que no “vean” encima de la cama. Yo tengo dos uno en el techo y otro enfrente en la cama en el suelo. Uso los de Xiaomi y la baterĂ­a le dura mĂĄs de dos años.

Direcciona los sensores de manera que no "vean " a ras de suelo. O encima de un mueble.

Thanks for this, works a treat but I need to add ‘switch’ as well as bulb. Can you help please

Easiest way would be to use Switches as X from 2022.04

did you get this working this is what I have setup on Hubitat evo but as I’m moving over to HA this is a lot harder to do

Is this why I can never get the offset to work right? It’s been driving me nuts.
How do we fix the blueprint itself then because I use this for multiple automations and would rather correct the blueprint than have to tweak the values.

Hi. I am using this blueprint along with adaptive lights blueprint as well.

I want to set a condition, if sleep mode is on, to turn on specific lights. E.g. I have 1 main lamp in the kitchen and 2 LED lamps for ambient light. When is sleep mode and I woke up for a glass of water, I want minimum light, only the LED lamps.

I was just wondering if anyone else has already done that. I have the skills to achieve it myself (and share it with the community), but if it is already in someone’s system, why reinvent the wheel :sweat_smile:

1 Like

About the offset, is that an offset before sunset and before sunrise? In my case I’d like the automation active beginning 30 minutes before sunset and to stop being active 30 minutes after sunrise so it seems that one number should be positive and the other negative or am I overthinking this?

1 Like