💡 Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

:construction_worker_man::construction: Getting Ready For A New Release :construction: :construction_worker_woman:

The biggest feature request is coming! :partying_face: Live testing is underway.

Blacky :smiley:

10 Likes

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 :slight_smile:

@tipananz

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 :smiley:

1 Like

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?

@harryfine

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 :smiley:

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 :smiley:

Makes perfect sense. I’d always wondered why it wasn’t like that but I can see the issues it would create.

1 Like

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?

@harryfine

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.

130

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.’

129

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 :smiley:

@fir3drag0n

There are 2 reasons.

  1. 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.

  2. 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 :smiley:

1 Like

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. :+1:

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…’ :wink:

Enjoy

Blacky :smiley:

1 Like

@reylinux

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 :smiley:

2 Likes

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 :slight_smile:

@lewisb79

Hi Lewis, welcome to the community :wave:

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 :smiley:

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:

  1. 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.

  2. 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;

  1. Light switch off. Motion detected. Lights turn on for n minutes.

  2. Light switch on, lights on. Motion ignored. Lights stay on. The binary toggle should be on.

  3. Light switch off. Motion detected. Lights turn on. If light switch turned on, binary toggle switched on, lights stay on and motion/ timer ignored.

  4. 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?