Getting Ready For A New Release
The biggest feature request is coming! Live testing is underway.
Blacky
Getting Ready For A New Release
The biggest feature request is coming! Live testing is underway.
Blacky
This sounds good!!
Wonder if this will include an option to restart the autiomation by chance? I see in the docs that this is the anticipated behaviour, but this is not what i have experienced - the automation completes when triggers are reactivated.
When motion detected, light turns on. When motion detected again, timer is not restarted.
Probably minor but worth asking
Hi Stephan, the upcoming release is performing very smoothly in live testing. Itâs our most requested feature, and Iâm excited to share it with you soon. I hope it meets your expectations and enhances your experience!
No it is not that as the automation already has restart.
This issue should not occur, but it depends on your setup. When only using a single trigger, each activation restarts the process. When using multiple triggers, grouping them usually prevents the problem youâre experiencing. For detailed instructions, please refer to this FAQ.
Absolutely! If you ask, I can help guide you to get your blueprint working as intended.
Blacky
Blacky, speaking of features I have a question.
If I understand bypass correctly, you select an entity to bypass the automation and either keep lights on, off or in current state, if the entity state is on. What about allowing the state to be either on or off, or being able to select the value from among the available states?
Hi Harry,
The bypass⌠when you turn the bypass ON it can do 3 things, turn your lights ON, OFF or keep the state they are currently in being ON or OFF.
Are you sugesting that to make the bypass be activated (ON) when an entity is ether OFF or any other state it may have. If this is the case then what your would do is create a template binary sensor and use the state you would like to use. Then add that binary sensor into the bypass. Like this
{{ is_state('Your_entity_id_here', 'off') }}
or
{{ is_state('Your_entity_id_here', 'closed') }}
or
{{ is_state('Your_entity_id_here', 'xyz') }}
Blacky
Thatâs what I was asking, yes. I just figured it might be nice to have it be part of the automation where I could select the entity state for which the bypass is enabled. But yes, I will do it that other way.
The blueprint requires a specific state to trigger, with ON being the most common. To set this up, I would need to add two inputs: one for the entity and one for its required state. Iâve tried to minimize inputs to avoid confusion, but adding this feature would require 10 more inputs and a new bypass logic. Therefore, itâs best to create a template binary sensor if you need a bypass state other than ON. Note that binary sensors might display different states, like âDetected,â for a motion sensor but Home Assistant still interprets them as ON.
Blacky
Makes perfect sense. Iâd always wondered why it wasnât like that but I can see the issues it would create.
Blacky, I have never created a template sensor so I hope you can point me in the right direction. I know itâs now done through the helper tab. You may remember I am trying to use the state of an input_select helper as a bypass entity.
So Iâve included two pictures showing my newly created template binary sensor.
Iâve given the template binary sensor an Entity ID name:
office_bedroom_state_set_bedroom
In the template options, I entered the desired template state. In other words, Iâm looking for the input select to be set to bedroom.
{{ is_state(âinput_select.office_bedroom_modeâ, âbedroomâ) }}
Currently, the input select is set to office, meaning I am using that room as an office and the light automation runs. This is reflected in the Developer Tools states:
So Iâve confirmed that the actual state of the input_select is Office. When guests come over, I change the input_select to Bedroom so that certain automations donât run. So the goal is to put this new template in the bypass to keep the automation off when itâs in Bedroom.
But I donât think Iâve set up the template correctly. The reason I say that is in the preview, it shows Office_bedroom_state_set_bedroom to Off. Not sure where the Off comes from. Should it not be either Office or Bedroom, the 2 choices in the input_select?
So much appreciate your help here. Iâve read up on templates, but first time is tough.
Thank you for this awesome blueprint.
I am experimenting with bypass and auto off.
I set auto off to 20 minutes. It works and boolean turns to off as intended. But not the light. I need an extra automation to solve it. Is that intended? What could be the reason that it does not turn off the lights?
Sorry, Harry, I thought you knew how to do this, but I must say youâve done an awesome jobâŚ
Here are a few things I do.
The name input: I used a more user-friendly name. For example, instead of " Office_bedroom_state_set_bedroom," you can simply put âOffice Bedroom State Set Bedroom.â Home Assistant will automatically add underscores to the entity ID when you first create it. If you want to change the entity ID later, youâll need to do it manually, but you can still change the name input to anything you like. I think it looks nicer on a dashboard this way.
If you look at the preview, youâll see the icon and name you chosen. This is how it will appear on your dashboard. Youâll also see âOffâ or âOn,â with the current state being âOff.â
To test this, open another tab in your browser and log into Home Assistant. Navigate to where you can select your input. Keep one tab open with your template showing the preview and âOff,â and in the other tab, change your input select. For example, if it currently says âOffice,â change it to âBedroom.â The preview in your template should change to âOn.â
This method allows you to easily test your template to ensure it works as desired. If it doesnât work, you can edit the code in the âState templateâ accordingly.
Once you confirm that it turns âOnâ when selecting âBedroom,â you can enter this new template binary sensor into the bypass of your choice (probably option 2). This way, when guests come over, selecting âBedroomâ will turn the light off, but they will still be able to manually control the light, turning it on or off as needed.
Hope this helps you.
Blacky
There are 2 reasons.
Bypass - Time Delay: When your bypass turns OFF, it will wait for the bypass time delay before turning OFF the lights. This works like a normal time delay, ensuring you are not left in the dark when the bypass and trigger are both OFF. If you set the bypass time delay to 0, the lights will turn OFF instantly. There is also a secondary reason.
When you turn the bypass OFF, it will evaluate your site conditions. If your trigger is ON, the lights will stay ON and your automation will run as normal. If your trigger is OFF, the lights will either turn OFF instantly or wait for the bypass time delay, depending on your settings.
Hope this helps you understand the bypass settings.
Blacky
Thanks so much Blackie. Worked like a charm. First template, Iâve been afraid of them for a year. BTW, it didnât work at first because itâs case sensitive, and I had âbedroomâ instead of âbedroomâ. You are the best.
No problem, Harry. Youâre welcome! Iâm glad I was able to walk you through your first template. Now you can unlock the true value of the bypass and harness the power of templates. As the saying goes, âTeach a man to fishâŚâ
If youâd like more template examples for future reference, you can see my examples by clicking here. You can use them in the same helper way and just use the code for the state. For trigger-based templates, youâll will still need to add them to your YAML file (old way), as Home Assistant hasnât developed trigger-based templates in helpers yet.
Now, when your guests come over, you can show them and say, âYeah, I just had to write some YAML code to create a guest modeâŚâ
Enjoy
Blacky
I appreciate you asking for my help, but there are many others on this forum who can assist you. This post is specifically for this blueprint, so I kindly ask that you stay on topic. Please delete your post and ask your question in a separate topic.
Thanks for your understanding.
Blacky
Hi Blacky, your Blueprint and dedication to this thread is awesome - thank you.
I notice you have described not using a switch that controls the load of the lights as part of a bypass. However, Iâm wondering if thereâs a workaround with the module that I have.
I have a Fibaro Double Switch - with both S1 and S2 being used to control 2 separate light loads with traditional toggle light switches. Thereâs no other way I can add a physical bypass switch and this needs to be âwife friendlyâ, so no other buttons. The Fibaro module is set to match the switch toggle position. This means if the load is already on (e.g. motion triggered) and the switch is in the off position (which it should be), then pressing it would not turn the load off. It can send a scene at this point. Which I could then use to bypass the automation so the lights remain on.
If the lights are on by being physically switched on then any motion detection wouldnât have any effect to the load - so they wouldnât be switched off automatically.
If the lights are on by motion and I want to turn them off, but the light switch is off, then it would have to be double pressed to turn the load off manually (although this is unlikely, the motion will just time out after a minute). I donât see the purpose of forcing the lights off and disabling motion detection by the physical switch in my case (Iâd disable it in HA if I had to) - I always want them to react to motion at night if they are not already on, unless disabled in HA.
Could it work using a scene as a bypass in this case - for when Iâm overriding the lights to stay on? I am coming from SmartThings very recently, so Iâd describe this as a Virtual Switch (clumsy way of doing it), but I assume this would be a binary sensor in HA? Would I use an automation to toggle a binary switch based on the scene and current state? Forgive me if Iâm showing my fairly âfreshâ understanding of HA terminology, but Iâm getting there!
Thanks so much
Hi Lewis, welcome to the community
Your welcome and thanks for your kind words.
Spoil alert! I have created a new add on blueprint to handle this but is still under development. I am not 100% happy with it yet but is working well. It works with your existing physical switch and gives you manual control.
Question
Is your physical switch a toggle (ON / OFF state) or a press button?
For now while waiting for the BP you could create a toggle helper and then add that toggle helper to bypass option 1. The only downside is you have to use the UI to turn the toggle ON and OFF. This will give you manual control⌠In the FAQ I show you how to create a toggle helper, click here.
Blacky
Hi Blacky,
Oooh, that sounds interesting.
The light switches are all physical switches that toggle on/off. Not push or momentary.
So far, I have created a binary toggle that I have used outside of any blueprint, with two automations:
If scene sent (will be sent by a physical switch only) and switch is changed from odd to on, lights already off, turn lights on (canât stop the Fibaro module from controlling the load on S1) and turn the binary switch on. If lights on by motion/virtual switch, they stay on.
If scene sent, and the switch is toggled to off (from on), then the load gets turned off, and the binary switch is set to off.
This means I I have a single binary toggle switch that will store a physical switch action (to over ride basically) essentially based on what the physical switch is set to).
The scene doesnât have a value for different switch positions, which is why I have to check the existing output. The scene is sent only when the physical button is pressed in either direction, not any virtual one in HA.
The binary toggle is working well with the light switch and combined with synchronised positions and toggling the virtual switch in HA as part of testing. However, in some testing I noticed maybe 1 in 20 wouldnât fire the binary toggle (even though Iâm sending scenes for single and multiple presses), so I had to introduce an additional automation to turn it off after a few minutes if the lights are off and the binary switch is on. I think this is the moduleâs fault - the scene info is only in verbose logs, not info, so it can be a chore to see whatâs happening.
So in theory I should be able to use the binary switch as the override, but itâs acting weird and not working properly - not toggling the binary switch and/or controlling the load immediately, or just not working at all. I ran out of time to test further yesterday and wonât get much time for a few days to try again sadly. This is where itâs falling down at the moment.
But this should mean;
Light switch off. Motion detected. Lights turn on for n minutes.
Light switch on, lights on. Motion ignored. Lights stay on. The binary toggle should be on.
Light switch off. Motion detected. Lights turn on. If light switch turned on, binary toggle switched on, lights stay on and motion/ timer ignored.
Lights on by any means. Light switch toggled off, lights go off and binary toggle off.
What it does mean is that I canât force the lights to stay off from the physical switch, so if motion occurs and itâs dark, the lights will come on. Thatâs fine. As I mentioned before, if I want to force them off for a specific reason, I will disable the automation in HA.
Hi Blacky,
I have a feature request for this that in a way pertains to your night lights. Iâve forked myself in an attempt to integrate it but have failed so far.
At home, all lights are on motion sensors, I have ambient lights that come on when the sun is below a certain elevation, and I have motion lights working outside of this blueprint. However, they only work when they see the ambient lights are on. When we go to sleep at night, the ambient lights turn off and the motion lights no longer respond. This is great because it stops lights coming on at X time of the night or if you just get up for a glass of water in the dark. Is this check a feature that could be implemented in your blueprint? It could be useful for other people as well as me that love the blueprint, but want to slightly restrict when the lights can work!
Do you get what I mean?
Thanks!
Mark
Create an binary sensor that inverts the state of the ambient lights and use it as a bypass for the sensor light automation?