Nice one glad you got it working.
Enjoy
Blacky
Thanks Blacky, youâre the best! Iâll investigate further.
When I upgrade zigbee2mqtt from 1.42.0-2 to latest version 2.1.3-1, the blueprint stops working. In zigbee2mqtt I can see the motion sensors correctly detection motion but the blueprint doesnât seem to detect it, the blueprint is not triggered. I did check if the entity for the binary sensor was still correct in the blueprint, itâs still there. Ideaâs anyone?
There were issues with zigbee in their update. This post back earlier seem to help some people and you can search on the forum for more information on what happened when zigbee updated their version.
Blacky
Iâm trying to configure the following behavior:
Not sure if itâs relevant, but Iâm using an Ikea Rodret switch for manual operation, where the on/off presses are turned into a single switch helper by IKEA RODRET + SOMRIG + TRADFRI Remotes - ZHA/Z2M - Control anything.
Iâm struggiling to configure the sensor light blueprint for the bypass behavior:
@Blacky Iâm sure this must be possible with your awesome blueprint somehow, but I just donât get itâŚ
Youâre asking the Ikea Rodret switch to perform two different actions based on your preferences.
To achieve this, create two toggle helpers:
When you turn ON the Ikea Rodret switch, what should happen?
When the Ikea Rodret switch is turned ON:
Example of custom automation. You will need to delete one option and keep the other one. Also update the entity idâs
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- switch.ikea_rodret_switch
to: "on"
id: switch_on
- trigger: state
entity_id:
- switch.ikea_rodret_switch
to: "off"
id: switch_off
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- switch_on
- condition: time
after: "22:00:00"
before: "07:00:00"
sequence:
- target:
entity_id: input_boolean.helper_2
action: input_boolean.turn_on
data: {}
alias: Option 1 (Time-Based OFF)
- conditions:
- condition: trigger
id:
- switch_on
- condition: state
entity_id: light.your_light
state: "on"
alias: Your Light is ON
sequence:
- target:
entity_id: input_boolean.helper_2
action: input_boolean.turn_on
data: {}
alias: "Option 2 (State-Based OFF):"
- conditions:
- condition: trigger
id:
- switch_off
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.helper_2
- input_boolean.helper_1
default:
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.helper_1
Hope this helps you
Blacky
Thanks for the insanely fast and extensive response!
Iâm basically looking for manual control of the lamp, but when itâs off the motion trigger should take over. So when manually switched on the motion/night triggers shall be ignored. When off, a motion trigger will turn on the lamp and after a some time it will turn off again. If during this on time somebody manually tries to switch the lamp off it should turn off and manually switching on can be ignored.
If itâs not clear I may need to draw a timeline or something (on mobile nowâŚ)
Overall Iâm trying to mimic a regular light switch, that behaves âsmartâ when off. IMO this is the easiest to adopt for non techies
Maybe, now I think of it, itâs just a matter of switching the lamp on and automation off, when Rodret on it pressed, and switching the lamp of and automation on again, when Rodret off is pressed.
Iâll give this a try an report back.
Edit: This is indeed working! I created and automation, triggered by the Rodret switch on-action, that switches the lamp on and at the same time disables the Sensor Light automation. The off-action does the opposite.
Thanks again for your help @Blacky!
You are 100% correct! After updating zigbee2mqtt the illuminance sensor on the is disabled If your automation cannot read lux value, wouldnât it be better to always fire the lights when motion is detected?
Dâoh, youâre right! I thought it wouldnât work because HA form validation was red:
Oooh that easy?
Awesome! Cheers!
@Blacky thanks for your response.
I understand what you wrote, that it works off triggers. It would be nice though if it had an option to keep a scene alive if one of the lights went off.
Also, please take a look at this post, if you feel like chiming in: đĄ Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights - #3253 by gd510
Hi @Blacky ,
thanks for the great blueprint.
We have a manual switch in the living room which basically powers off the light and if you turn the switch on, the light will immediately go on as well. However, I noticed that the light never turns off again by the automation although there was motion in the meantime and I would expect that the automation takes care to turn it of after some time.
Iâm using version 8.0 of the automation with a script to turn the light on and off and also a toggle helper. Could the toggle helper be the reason that the light state becomes somehow inconsistent?
Scenes have no state they just get executed when the action is called. You can try removing the Scenes & Scripts - Toggle Helper this way when it is triggered again it will call the scene. It may help you.
So you would like dynamic lighting when motion is detected and then once motion is clear to then go to 50% for 10 min and then to 10% 24/7.
Hope this helps you.
Blacky
When you manually turn ON the light, and then the automation runs, it should trigger your script, turn ON the helper, and then turn OFF the light. The toggle helper prevents the script or scene from being called every time the automation triggers once the light (or toggle helper) is ON. It allows you to adjust the lights without repeatedly triggering them to turn ON, saving network traffic and preventing unnecessary interactions with the light. Regardless of the lightâs state or whether the helper is ON, the automation should turn both the light and helper OFF.
The only thing that will prevent this from working is a global condition or the bypass.
Please double check that the motion sensor is indeed triggering the automation (you can run a test to confirm):
If youâre still experiencing issues, feel free to share your YAML settings, and I can help you troubleshoot.
To do this:
</>
button in the toolbar.This ensures the formatting stays correct and makes it easier to analyze.
Blacky
I changed the automation the lux value is 16 but the light go on
alias: Sensor Light
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.everything_presence_one_0436d4_pir
light_switch:
entity_id: light.hue_ambiance_lamp_1_2
light_brightness: 55
include_light_control:
- use_brightness
include_time: time_enabled
before_time: "23:30:00"
after_time: "16:00:00"
include_dynamic_lighting: disable_dynamic_lighting
include_ambient: ambient_enabled
ambient_light_sensor: sensor.everything_presence_one_0436d4_illuminance
ambient_light_value: 10
ambient_light_high_value: 10
light_colour_temperature: 4000
ambient_light_options: ambient_light_option_enabled
In ambient you selected YES - My Ambient Light Sensor is affected by the Lights so once the light is ON it will ignore your lux sensor. If you would like it to turn OFF based on your lux sensor consider raising the Ambient Light - High Lux Value so when your light turns ON it will not go above this value (unless natural light raises it above) and then selecting NO - My Ambient Light Sensor is not affected by the Lights.
Blacky
Hi, I like your blueprint very much. But I have a few questions.
We are using the blueprint with the sun elevation-option.
Is it possible to execute the night-light function even the elevation-option doesnât fit? In our case the light of the nursery room is activated with a warm white at the normal time, but is red as a night light so the baby doesnât get flashed in the night. But this doesnât work if the sun is to high, but the shutters are still closed. If the night-light enity is activated it should work always.
How can I set up the blueprint if I want to activate the light depending on sun elevation or the lux? I recognized that the light in the hallway and other rooms should be turned on on a cloudy day when the sun is still high but it is very cloudy and so it is not bright enough in the hallway.
Sry for my english, if it is not understandable.