TIL a scene is an entity
Thank you so much for explaining it!
TIL a scene is an entity
Thank you so much for explaining it!
O okay, interesting. This would be very unique and would probably be custom or used in a script.
The only way I can see this working is to have different automations using the same trigger but have different settings for your lights.
Blacky
Hi Blacky,
I love your blueprint!
Would you willing to add a support for presence sensor, beside the trigger? I have modified the blueprint manually, but I feel like this could be useful for many.
My need is, I have zones where I want triggers to turn on the lights but I want them to stay on as long as presence sensors detect someone. This allows me to turn on kitchen lights when movement detected and keep the light on if presence is detected on any of the kitchen zones (not just one). Same case I have a for hallway, to trigger in one zone but leave them on until I walk to other room.
My modification is simple, it is adding presence_sensor input:
presence_sensor:
name: Presence Sensor - Binary Sensors - Schedule *
description: The Sensor/s that keeps the lights ON and OFF.
selector:
entity:
filter:
- domain:
- binary_sensor
multiple: true
and using it “Check if the trigger is on and wait for it to go off” instead of trigger.
What would you say on bringing it to yours blueprint?
Hi All,
I am still on version 2.5 and tried some time ago to upgrade but did not worked out so well, after overwriting with new version nothing worked anymore. i also tried to remove the 2.5 version first and then installing the new one but then the sensors i used did not work anymore with the blueprint, is there a special way to go from 2.5 to current version 6.8?
thanks
Welcome to the community.
It is already there and ready to go . No need to modify the blueprint. You just use the trigger but the trick is you have to make a group. In the group you add your motion sensor and any presence sensor. If any one sensor in the group is ON then the group is ON. All sensors need to be OFF for the group to be OFF. If you add them in separate then you will find that the automation doesn’t work correctly. I have a FAQ on how to do this.
Let us know how you go.
Blacky
That is a big jump and throughout this time there was things that needed to be done in some new versions.
The easiest way I would recommend is to update the blueprint and recreate the automations. This way all your YAML will be correct. One thing to take note is that entities can now only be used in “Lights - Switches - Scenes - Scripts” . Areas, devices and labels are not supported.
Your sensors should still work, it will be that you are using areas or devices. This explains it Click Here.
Blacky
Thank you Blacky!
However this is exactly what I’m trying to avoid. I want my zone light turn on when I enter this zone, and keep them on until I leave the kitchen. With the group, any zone will trigger them which is not intended.
To be exact when I approach the kitchen island I want them to turn on, and if I go around to the other zone I want to keep them on as long as I will not leave the kitchen. This helps to cook, and moving around without blinking lights. However when I will enter the kitchen from the other side, just to get a cup of water I don’t want all light to turn on. That’s why the detached presence sensor from trigger is so useful for me, as I can explicity decide what to observe and what is the trigger.
Hope that brings more context
I going to apologize now because I could be totally wrong with this as I have not tested it and trying to get my head around it. I am working of a template sensor I created called Bee In The Hive Sensor but I am going to change it on the fly (Bee sorry ) that may work for you. Below is the code… you will have to change it with your entities. I hope you know how to create a template sensor but a lot of information is in the original code for Bee In The Hive Sensor click here and how it works.
I called it Chef In The Kitchen …
template:
- trigger:
- platform: state
entity_id: binary_sensor.your_presence_sensor_here
to: "off"
- platform: state
entity_id: binary_sensor.your_presence_sensor_here
to: "on"
for:
seconds: 10
- platform: state
entity_id: binary_sensor.your_motion_sensor_here
to: "on"
binary_sensor:
- name: "Chef In The Kitchen"
device_class: occupancy
icon: mdi:account-box-outline
state: >
{{ is_state('binary_sensor.your_presence_sensor_here', 'on') and is_state('binary_sensor.your_motion_sensor_here', 'on') }}
Once you create the template sensor then add this template sensor in with your motion sensor in a group, then add the group as the trigger
Again sorry if I send you down the wrong path
Thanks Blacky for the info, i will try again and then use only entities that is the culprit i think in combination with scene’s what i use now.
Thanks again.
Dear Blacky, Thanks for this blueprint, just found it and excited to get it working. I tried setting it up with the binary_sensor motion sensor entity from my Aqara Camera Hub G3, but the automation isn’t triggering :'{
I have made sure that the target lights for the trigger is are entities. Also added a toggle helper in case this was the issue but this made no difference. Any advice is much appreciated!
Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.
Blacky
Thank you so much for your response, actually in looking at the YAML I think I figured out the problem. But will post the code here if it might be of help to others:
alias: Living Room Sensor Light
description: >-
Turn on Living Room Lights if motion detected by camera. Turn off lights after
X minutes of no motion detected.
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.living_room_camera_motion_sensor
light_switch:
entity_id:
- light.living_room_light_left
- light.living_room_ceiling_light
- light.living_room_right_light
time_delay: 1
light_transition_on: 1
light_brightness: 30
include_dynamic_lighting: disable_dynamic_lighting
include_sun: sun_enabled
include_night_lights: night_lights_disabled
end_scenes: []
boolean_scenes_scripts: input_boolean.living_room_lights
I changed sun_enabled
to sun_disabled
Yep it could be that the sun condition was not allowing it to run. Nice one glad you are up and running.
Blacky
Haha Appreciate the touch! I wasn’t aware of template triggers. I will give it a try. Thanks a lot!
As a non pro tech person… this has brought magic into my home. Thanks!
Hi,
Is it possible to use something like this sensor for ambience SONOFF SNZB-06P ? It provides illumination but not as a lux value but as an enum.
Illumination (enum)
Only updated when occupancy is detected. Value can be found in the published state on theillumination
property. It’s not possible to read (/get
) or write (/set
) this value. The possible values are:dim
,bright
.
You will have to create a template sensor an add the code to your State template*. You will need to replace the “binary_sensor.your_illumination_sensor_here” with your sensor entity ID.
Go to settings > devices & services > helpers tab > create helper > template > Template sensor and then add name, code, xyz as shown below.
{% if states('binary_sensor.your_illumination_sensor_here') == 'dim' %}
1
{% elif states('binary_sensor.your_illumination_sensor_here') == 'bright' %}
3
{% else %}
0
{% endif %}
Then add your settings into the blueprint using 2 as your high and low.
Blacky
Hi Blacky and All,
Apologies if this has already been asked solved.
My binary sensor is the motion sensor entity in an Aqara Camerahub G3.
However, when the lights turn off, the motion sensor is triggered and so the lights turn back on.
I can’t figure out what I’m missing in the configuration; or if I need to do something differently.
Many thanks in advance!
I have seen this before in cameras. Your camera is picking up the light change (ON to OFF) thinking it is motion. I don’t have the Aqara Camerahub G3 so I am unsure what settings you have. Try reducing the sensitivity or on that line of thinking. It is not the BP it is your Aqara Camerahub G3.
If all else fails then I have a template example on how to do a delay but then you will have a delay for when it comes ON so it is best to try an resolve it in your settings. The link to the template example is here… see REF - TS-2. The delay is 2 seconds but try reducing it down as much as possible. You then use this template as the trigger.
Blacky