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

Hi again @Blacky
I’ve been keeping an eye on this thread and keeping track of all the latest versions and features. I’m wondering if this latest release, if my understanding is correct, now allows for the scenario I asked about in April?

It sounds like it might, and allow the motion sensor, door sensor and smart switch override/bypass to combine to allow for occupancy automation with temporary bypass via smart switch?

If so, I’ll disable my current automation and give this blueprint a try :slight_smile: Keep up the great work!

Done. I would encourage everyone here too click that link. Blacky does great work on this and other blueprints. This should really become part of stock homeassistant

3 Likes

Hi,
First just want to say thanks for this awesome blueprint, now, would it be possible when using a scene to run on activate, instead of choosing another scene scene to return to ie ‘scene off’, could you add the ability to use “call service - create scene” and chose the entities to that we could watch and return too, this would be so much better than a scene that could have changed since we created it (ie the colour / brightness could be controlled via another automation)

like in the screenshot you would create a scene named something ie. before, then for the return part (like you do now) you would just activate this scene scene.before

Thanks
Andy.

I would get errors like this a lot especially after a reboot. Version 3.6 has seemed to fix all the errors I was getting. Although errors were showing up in the log none of my automations ever failed to run properly, that I’m aware of.

Yeah I’m using this exact use case, but do take note, the blueprint does not modify your bypass. So if you need the bypass to turn off, you have to turn it off manually or via another automation.

For Aqara Wireless Switch, if it doesn’t hold the state, you might need an input helper. (Setup instructions can be found in FAQs - third Q&A)

1 Like

@Scoff

Hi Scott, thanks for keeping an eye on this thread. I haven’t forgotten your suggestion as I have a 2 page word document of all my thoughts and notes on the code and the how to but there are some hurdles to get over.

@Scoff & @samuelthng

Stay tuned. For now I have a :hourglass_flowing_sand: Entity - Run ON Timer blueprint that will turn your by-pass off in a set time period.

1 Like

Thanks for your support, it realy helps me a lot and is much appreciated.

Thank you :smiling_face_with_three_hearts:

Blacky :smiley:

@andyblac

Hi Andy, thanks for your suggestion. I sort of recall that when developing this option back in Version 1.6, I had a few hurdles and If I renumber correctly. I think they were;

  1. scene.create, believe it can’t survive a restart.
  2. scene.create, something to do with automation mode restart, and will it keep creating scenes of the new lights on every trigger once they have been turned ON thus never turning OFF.
  3. The complex nature of targets

There were a few more and I wish I did notes on the day but I didn’t :pensive:

However I do like it and maybe I should revisit it again.

Blacky :smiley:

yeah i can imagine the complexity of it all.

@Blacky please add my changes from the fork at gist.github.com. This is the implementation of presence in the zone detection by the specified persons (optional).

@gamba69

Next time if you have something like this, it is best to PM me.

Not sure why you have chosen to use “persons” rather than “device tracker”. I have been looking at this and it is on my list but not with persons rather device tracker. I will have a look at it.

Hi - This Blueprint would be the perfect one for me to use (thank you so much) but I cannot get it to work. My lights can be controlled by home asssitant only through REST API calls to an external system. Specifically, I have a service in home assistant that does this (for example: “rest_command.light23on”).

Is there any way I can make this “service” show up as an action / light / entity, which can be controlled by this blueprint / automation?`

I was hoping that this might be possible thourgh a “helper” but was so far unable to figure it out.

Thank you for any hints.

Hey @Sali you could try using a Template Light, and set the turn on and turn off to make rest calls.

To use Rest services in the template light you could use the Rest Command integration. Seems you already have this part.

After all these gymnastics goes well, you probably can use the template you created as a light and with this blueprint!

I would also spend some time to check online if anyone has made a custom component on HACs for your light, to reduce the number of loops.

Thank you – I will try this too. Wanted to share that I was in the meantime able to solve like this (below the answer that Chat GPT gave me including the code (!), which actually works:

Yes, it is possible to make your REST API service show up as an entity in Home Assistant so that it can be controlled by blueprints and automations. To achieve this, you can use the rest_command integration and create a template switch or light that is linked to your REST API service.

Here’s an example configuration that demonstrates how to set up a template switch that controls your REST API service:


switch:
  - platform: template
    switches:
      light23:
        value_template: "{{ is_state('switch.light23', 'on') }}"
        turn_on:
          service: rest_command.light23on
        turn_off:
          service: rest_command.light23off

In this configuration, we define a template switch named “light23” that uses the is_state function to determine its current state based on the state of the switch.light23 entity. The turn_on and turn_off actions are set to call your REST API service using the rest_command.light23on and rest_command.light23off services, respectively.

Once you have set up the template switch, it will appear as a controllable entity in Home Assistant, and you can use it in blueprints and automations like any other switch or light entity.

Remember to replace switch.light23, rest_command.light23on, and rest_command.light23off with the actual names of your entities and services.

1 Like

@Blacky Any person can have several trackers, such as an application, router data or a BLE device. Changing the tracking settings will not result in the need to reconfigure the automation.

@gamba69 I was thinking to use device tracking as it can be more customised if you would like to use one device tracker on the person that could have 2 or more. Maybe I should allow it to have both so the user can decide.

Edit: I have already done all the code so I am good there.

Thanks

Blacky :smiley:

New update 3.8

:warning: Some work is required in this upgrade. Please see below on the steps required when upgrading. It is easy and not a breaking change.

New Feature :new:

Device Tracker - "People"

We have updated “Zone - Device Tracker” to include a new selection “People”. This will now allow you to select a zone and the people you would like to track in that zone. You still have the option to just select a zone if you prefer. Thanks to @gamba69 for the help with the code. See below the changes

What can this now do? :thinking:

If you use device tracker, you could track your cars, pets, people etc. In some cases you could all go out for the night in one car and leave the other car behind. You could go for a walk and leave your car behind. This will show one device in the zone (your car), and your lights would still turn ON when your pets run around the house. With the new option having the ability to also include people, you can now exclude the items you don’t want to track (the car) and include the people you would like to track. So now your lights can remain OFF until one person arrives home.

The title description has also changed to “Device Tracker”. Hopefully this will make it clearer in your selection.

:warning: :stethoscope: STEPS REQUIRED WHEN UPGRADING :white_check_mark:

If you have never selected to use device tracker then most likely you won’t need to do anything but you may want to check just encase you have selected device tracker in the past.

1 - Upgrade your blueprint.
2 - Then go into your automation (the ones using this blueprint) and click the 3 dots top right and “Edit in YAML”

3 - We are looking for the words or input called “include_zone: ???” If you don’t see this then you have never selected it and your all good to go, your done. If you see it then continue on.

4 - Delete this line,(“include_zone: ???”) then click save, click 3 dots and select “Edit in visual editor”

5 - Update your selection if you would like to use the device tracker.

6 - Click save, you’re done. Now just do the same in your other automations using this blueprint.

TIP
If you would like to easily find all the automation that are using this blueprint so you can check your YAML. Go into blueprints and click on the 3 dots next to the sensor light blueprint and select “show automations using this blueprint” You then can easily edit them all. See below.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

3 Likes

hey love the blueprints you make. very easy and precise. Only I’m having an issue that they are just not working.No matter what i do the automation is just not triggering or in the best case scenario the lights will flash on n off n done.am at my wits end any help is appreciated. Am a newbie to ha so my apologies in advanced if the solution is obvious

@Peoples204

Hi, firstly welcome to the community :wave:

What I think may be happening is you are using Areas and or devices. Please expand them buy using the “<>” down to entities. It should all be green as shown below. You then will find that your automation triggers and your lights will turn on.

Areas :x:

Devices :x:

Entities :white_check_mark: :+1:

Let us know how you go.

Blacky :smiley:

Thanks for the quick reply. as for what im using its all as instructed by ur instructions. so i am using entities and still no luck. just to try out i created a basic automation with the same sensor and lights and it worked without an issue. Usually i would just keep it to the basics but the idea of the light changing temp depending on the time of day is so appealing i cant let it go. Plez help