I think I am following you but not 100% sure, but this is what should happen.
During the day your light will turn on and off as per your settings (lets call this normal lights). If you use a scene you need to create another identical scene with everything off and put it into the âScenes To Turn OFFâ. Scenes will allow you to set colour, temp and brightness, so if using a scene then I wouldnât use âLight Controlâ for setting the brightness. Do everything in the scene. All your lights will turn off if the trigger condition is met and after time delay.
Night lights work the same a normal lights but will only run in the night light time period. If your normal lights are on and you transition to night lights, all your normal lights will turn off (entities & scenes) and your night lights will turn on. You may notice a flicker in your lights when this happens. This is because everything goes off and on instantly.
Some smart lights will / could have a setting to remember its last setting when you turn them off so when you turn them on again it will return to its last setting when it was off. Sometimes you can set a default setting so that it will return to default setting every time it is switched on regardless of what it was set on when it was turned off.
I think your using entities during normal lights and a scene in night lights that sets your colour, temp & brightness. Then when you go back to normal lights all your colour, temp & brightness returns because this was the last setting when they were turned off. There are 2 things you could check or possibility do.
Check to see if there is a default setting in your smart lights. Or do they just return to there last setting from when they were turned off.
Once you know how your lights work in the above, then you may consider to set a scene for normal lights so your lights will be reset to what you would like when they are turned on.
Just checking you have created a identical scene with everything off and you have entered that scene in âScenes To Turn OFFâ.
This is on my list to do but currently all my lights are dumb lights controlled by Shelly dimmers. They are dimmable with a physical switch to manual control of colour temp on the top. When I get or can find a light that is smart and only local controlled not Tuya or cloud based (not a fan of Tuya or the cloud) I will develop this. For now scenes are the best option if you would also like to set colour and or temp.
Hope this is on track of what you have asked and helps you.
Thank you for your Blueprint I really like it. Before using this blueprint Idid it with two automations. One was switching off the light after the sensor was going off.
With this automation the light was also switched out if I turned it on with a switch.
Am I right that this blueprint only switched the light off if it switched it on?
Hey !
Thanks for the blueprint ! It works great !
P.S: i may have miss it, no âtransitionâ option ? I do prefer my lights to light in 2-3 sec itâs softer for the eyes
No the blueprint will switch your light on and off with a trigger. The trigger can be any binary sensor. Normally people will use a motion sensor as the binary sensor.
Note: If you turn the light on manually and the motion sensor detects motion the light will turn off automatically. It is recommended to use the âTrigger Sensor By-passâ option if you would like to keep the lights ON or OFF for extended time periods.
Thanks for providing your YAML. Your time option is 24/7 if you add your 6 to 22:30 & 22:30:01 to 5:59:59 less 2 seconds. The âUse The Time Options (Optional)â is global and will also include you night light time, so it stops when you would like to have you night lights work. Because you are not using any weekdays and you would like 24/7 just select âDisable the time optionsâ in "âUse The Time Options (Optional)â. and you will be good to go.
I have also noticed you are using devices and you have selected âYES - My Ambient Light Sensor is affected by the Lightsâ. This option will only work if you have at least one entity selected. In you devices do you have multiple entities? Click on the â<>â and expand your devices out. You must have at least one entity selected for this option to work in âLights - Switches - Scenesâ and in âNight Lightsâ.
This shows it expanded into entities. Now the âYES - My Ambient Light Sensor is affected by the Lightsâ option will work. If I click on the âXâ I can remove an entity if I like.
Ah no, I want to turn off the light even if I turned it on manually. Because everyone forgets to turn it off
Than everything works as I need it. Thanks
You can turn it in manually but for this blueprint in order for it to turn off after you have turned it on the trigger must be triggered (motion sensor) after it was turned on.
If you are looking for other options then you may want to consider some other blueprint I have created. It is realy up to you and what your trying to achieve. Below are 2 links to some other blueprints of mine.
No it is totally what I was looking for. But never was patient enough to check if it works like this.
Use case is:
Someone is going to the toilet but the light is to bright to trigger the automatic light even when the motion sensor is triggered when you enter the toilet.
Then you switch on the light manually. But then no one is turning the light off because why But when you then leave the toilet the motion sensor will go off and turn the light off. Even the automation did not turned it on.
So thats what I need. Totally fine. You saved me at least 50% of the motion automation I did before and with the time and the lux sensor it is even more configurable.
TIP: When pasting code into this forum use the â</>â button as it will then display correctly and be much easer to read.
When using the âUse The Time Options (Optional)â this is a global time, so it also has to include your night light time.
So currently you have your time set to â18:00:00â to â21:00:00â so the automation will only work between this time period. You will need to include your night light time and set it to â18:00:00â to â07:00:00â. Then your night light time can be â21:00:00â(or â20:59:00â) to â07:00:00â
I have in-wall smart switch module wired to regular switch for my kitchen. Lights are also normal spot lights. I use motion sensor as binary sensor. Can I use by-pass feature of this blueprint with that setup? It kind of works but not perfect. Switch toggles itself off than on immediately after time delay if I am still in the kitchen. If I am not, it turns off normally. I hope I explained clear enough. Is there anything I should consider? Such as my smart switch settings? Currently it is set to âstateâ mod of operation. Other 2 options are toggle and momentary. Thanks in advance.
Just to add, âswitch.kitchen_lights_l2â and âlight.kitchen_lightâ are basically the same thing. I used HA change device type and defined switch as light. That might be the reason why it wont work correct as I have to choose different entities. Hope there are some workaroundsâŚ
One problem I have is that it doesnât seem to work with the adaptive lighting component,
When the lights turn on, they flash to full brightness white, then turn to the correct intensity and colour temperature. I canât work out why this happens.
My old automations that I made used the turn on command and adaptive lighting turned the bulb immediately to the correct brightness and colour temperature.
In order for it to get to the end of the time delay there must be no motion detected or by-pass setting causing this.
This normally relates to what type of physical switch you are using. If you can see your switch turning ON and staying ON until you turn it OFF then that is a good start.
Below is a screen shot from a Shelly 1PM. This is how Shelly has set it up. I use toggle but you realy need to know what type of switch you have, how it works and follow the manufacture instructions of your smart switch.
Yep you cant do that. This is you problem âby-passâ. The by-pass entity cannot be used in âLights - Switches - Scenesâ and or âNight Lightsâ selections. So looks like you piggybacked the âlight.kitchen_lightâ and created another entity called âswitch.kitchen_lights_l2â. If you would like a physical switch it must be totally separated or you can crate a by-pass without having a physical switch. To do this see our FAQ on " Q: How to use the âTrigger Sensor By-passâ without having a physical switch?".
I would remove your âswitch.kitchen_lights_l2â and create a âTrigger Sensor By-passâ without having a physical switch and you should be good to go.
Hi @woowoo we should be able to sort this out. Could you provide us your YAML of the automation. To do this go into your automation, top right 3 dot, Edit in YAML, copy all the code, back to the forum and in your reply at the top tool bar click on â</>â and paste code.
Is it possible to add some logic so that when Home Assistant gets restarted or the automations get reloaded, lights that were on when the event happened will be turned off? Iâm asking because Iâve had the situation that a light in my shed happened to be on at the time i did a reload of my automations and as a result of the reload this light wasnât turned off automatically anymore. It was a few days later before I saw it was still on and turned it off manually.
I know that the both below triggers can be used for triggering the automation. Adding these triggers can however have the -for some possibly unwanted- side effect that a light may get switched off after a reload or restart even though that light wasnât switched on by the automation, so maybe if you add these triggers, we also need another setting to enable or disable this feature.
trigger:
- alias: When Home Assistant starts
platform: homeassistant
event: start
- alias: When automations are reloaded
platform: event
event_type: automation_reloaded