Thanks for reply.
By-pass is definitely a cool feature but it does function completely opposite of what Iām trying to achieve here:)
I want my switch function just the same as if the sensor detected movement, thatās all.
Thanks for reply.
By-pass is definitely a cool feature but it does function completely opposite of what Iām trying to achieve here:)
I want my switch function just the same as if the sensor detected movement, thatās all.
You could try this if you are keenā¦ note I have not tested and just did the code here quickly. This is my thinking.
Create a button helperā¦ when you push it, it will turn on the new sensor if the total room sensor is ON. Then when your total room sensor goes OFF your sensor light automations time delay starts. I put a delay of 30 seconds just to give it a buffer if it comes back on but you can remove it or make it longer, like this for 10 minutes change the seconds to minutes in the template.
minutes: 10
Create a your template binary sensor by adding this to your āconfiguration.yamlā file. Then restart HA or reload as shown below. You will have to change āinput_button.your_button_helper_hereā to your button helper entity ID and ābinary_sensor.your_total_room_sensor_hereā this is your entity id for the total room sensor. The āButton Motion Sensorā is the name of your new sensorā¦ change it to your liking.
template:
- trigger:
- platform: state
entity_id: input_button.your_button_helper_here
- platform: state
entity_id: binary_sensor.your_total_room_sensor_here
to: "off"
for:
seconds: 30
binary_sensor:
- name: "Button Motion Sensor"
device_class: motion
icon: mdi:motion-sensor
state: >
{{ is_state('binary_sensor.your_total_room_sensor_here', 'on') }}
Once done then group this new binary sensor with the zone motion sensor in each automation. So you will have say zone 1 + this sensor in a group, then zone 2 + this sensor in a group. Then add the correct group to the automation trigger for the zone (only this group in the trigger). Now when you push the button it should turn ON this new sensor in every group turning ON all your lights or keeping them ON and only when the total room motion detection goes OFF then this sensor will go OFF and your lights will turn OFF Nice hay No need for by-pass and your two automationsā¦ you only need this temple sensor.
To reload the template sensor if you make a change go into developer tools and click"template entities"
Hope it worksā¦ it should
Let us know if this works for you
Blacky
A switch is not a motion sensor. You have to turn it ON manually and something has to turn it OFF.
So you could use the by-pass turn light ON with the delay to turn it OFF if you forget. When you turn the switch ON light will come ON or Stay ON and then the delay will turn it OFF if you forget to turn it OFF and your light will go OFF.
Blacky
Thank you so much for this. I will give this a try for sure and let you know !!
Ok so I have just done it and here is the outcome
Any idea what the issue could be ?
Thank you !!!
EDIT: So I have disabled the ambient options and now it all lights come on normally ā¦ I donāt know why it worked previously without issue and not now.
Looks like the template sensor works
Try this to work out the bugs.
Okay so now in your ambient light options try this.
EDIT: You will also need to play around with the āAmbient Light - Low Lux Valueā to get that right so the other automation will trigger ON.
EDIT: Or you can select āYESā but your āAmbient Light - Low Lux Valueā must be higher when all your lights are ON.
Let us know how you go.
Blacky
Thank you very much !!! At least I know where the issue comes from, so I will play with the ambient light setup.
I hope some day you will create a blueprint for the Aqara FP2, it is a great presence sensor when it works, but needs a lot of knowledge to set it up. Without your help, I would have sent it back for sure !
No problem, your welcome.
If you have brightness control then forget about ambient and try and use the dynamic lighting in the automations.
Yea, maybe if Aqara is reading this they will send me out one.
Enjoy
Blacky
Hey there.
Amazing job with so complicated blueprint. Iām trying to get it to work with the Aqara P1 motion sensor and I canāt. So I have configured the minimum required fields and I didnāt even get automation triggered.
alias: New Kitchen Lights
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.motion_kitchen_occupancy
light_switch:
device_id: cd4368f348b055e070ae573f246a9db2
Firstly welcome to the community
You are using a device and you can only use entities so you will need to expand down to entities. Then it will work.
A good starting point is to read āThe Settings & Best Practice Guidelinesā Click Here.
Blacky
thanks it works BUT i can only have one bypass option so either one button to turn it on or offā¦ it doesnt sadly have a feature to toggle the bypass on and off with one button
Thanks! (for the welcome and advice)
Changed to the entity
and automation works.
alias: New Kitchen Lights
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.motion_kitchen_occupancy
light_switch:
entity_id: light.kitchen_lights
time_delay: 3
it should toggle the by-pass ON and OFF. What state is your button, what does it do when you push it?
I am on 4.7 so donāt have the dynamic lighting option. I am looking into information on how to update the blueprint ā¦ Is there an easy step by step guide ? i never done it before ā¦
Yep it is easy and in the FAQ
Q: How do you update the blueprint and not delete / recreate existing automations?
A: Please follow these steps Click Here.
thank you very much very clear, done in 2 minutes, easy peasy
About Dynamic lighting you suggested, I am now using scenes for lights, with the Hue natural light scene. Should I just let it like that ?
Edit: Sorry I just read it was not working with scenes.
Edit 2 : The way Dynamic lighting works is the contrary of what I have now, the darker it gets the more light/brightness you get, while with hue natural lighting for example the later in the evening, the less light you get.
Blockquote
Now when you push the button it should turn ON this new sensor in every group turning ON all your lights or keeping them ON and only when the total room motion detection goes OFF then this sensor will go OFF and your lights will turn OFF Nice hay No need for by-pass and your two automationsā¦ you only need this temple sensor.
==== > The issue I have now with the above is that if I push the button, finish what I need to do with all the lights on, and turn off the lights, without leaving the room, the following happens
In basic scenario, the sensor turns my switch ON, and then the switch turns off after a delay, right,? Basically what I need, is so that manual switching ON also has same delay as if sensor detected motion, and so that if motion is still detected the light will not turn OFF.
I think I can use By-pass, but then I will not have a regular by-pass (like when I need it to stay on for longer time), and it will turn OFF after the set period of time anyways, even if the motion is detected, right?
Blacky, Iām a bit confused about ambient light.
I have the following situation. I want to turn a light on with motion any time of day for 30 seconds from last motion, but only if the ambient light is below a certain level, letās say 30. No night light option, no sun elevation. Also there is a bypass off when I set a boolean helper to nighttime.
But what does the ambient high value of 80 do? Does the light not turn OFF when motion is no longer detected? Why is there a needs for a high value?
alias: Front Hall Light on with Motion & Lumens
description: Front Hall Light on with Motion & Lumens
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.front_hall_motion_and_occupancy_sensor_for_light
light_switch:
entity_id: light.front_door_dimmer_switch_z_wave
time_delay: 0.5
include_light_control:
- use_brightness
- use_transition
light_brightness: 75
light_transition_on: 1
light_transition_off: 1
include_night_lights: night_lights_disabled
include_night_light_control:
- use_brightness
- use_transition
night_light_transition_on: 1.5
night_light_transition_off: 1.5
night_lights_conditions: []
night_time_delay: 3
include_sun: sun_disabled
night_lights_sun_elevation: -3
include_ambient: ambient_enabled
ambient_light_sensor: sensor.front_hall_motion_and_presence_sensor_illuminance
ambient_light_options: ambient_light_option_disabled
ambient_light_value: 30
include_bypass:
- bypass_enabled
- bypass_enabled_stop
include_time: time_disabled
night_light_brightness: 20
sun_elevation: -1.5
motion_bypass:
- input_boolean.day_night_mode
motion_bypass_lights_stop:
- input_boolean.day_night_mode
after_time: "17:00:00"
before_time: "07:00:00"
sun_elevation_rising: -4
ambient_light_high_value: 80