Hey @Blacky I still owe you an answer hereā¦
I was going to your guide and tried several things but this was not what i was searching for. So i found out that there is functionality to create scenese on the fly. (Scenes - Home Assistant)
With this it was very easy to create a automation for my needs.
Thank you anyway!
Just discovered your blueprint, it works like a charm, thanks for all the efforts! It is capable of a lot more features than I actually needed, as I only was looking for entity based motion activated light with override (which this one does too). Installed it and worked immediately, the solar elevation angle is a nice additon, playing around with that. Shoutout to you for the great work.
Thank you for you kind words . Keep an eye out as a new update will be out in a day or twoā¦ we are just doing the final testing / QA.
Blacky
Thanks for making this blueprint. It made setting up multiple light-related automations pretty straightforward.
@Blacky Hereās one thing I noticed while setting up an automation. This warning appears in the logs if you donāt define any night light entities:
Error evaluating condition in 'Hallway lights control': In 'condition' (item 1 of 6): In 'or' (item 9 of 9): In 'and' (item 1 of 2): In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'
Looks like there isnāt a a key check in the referenced condition block:
- condition: and # trigger by HA Restart & check if any lights are on
conditions:
- "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}"
- condition: trigger
id: 't9'
Interestingly enough, I only just noticed it after upgrading my HA instance to 2023.6.0 (yeah, I like living on the edge ).
Maybe it started popping up because Home Assistant Operating System now uses Python 3.11 (just a guess).
Hi Petar
Thanks for the info . I also noticed it when testing and this has been fixed in the next release that will be out sometime today.
I have done all my testing on 2023.5.4. You should be good now
A lot of work has gone into this update so the conditions, sun, ambient & time can act as a trigger, as long as the main trigger (Trigger Sensor - Binary Sensors) is ON unlocking even more hidden options for this blueprint. This is useful when using a schedule as the trigger. Hope you all like it.
New Features
- Added the ability to use a schedule helper as the trigger. The schedule helper will allow you to select different time triggers values for each day.
- Sun option will now turn lights OFF when the sun rises above the set value and the trigger is ON.
- Ambient option will now turn lights OFF when LUX value rises above the set value and the trigger is ON. Note: It will only work when selecting your āAmbient Light Sensor - Site Conditionsā to āNO - My Ambient Light Sensor is not affected by the Lightsā
- Time option will now turn lights OFF when time passes over the āend timeā and the trigger is ON.
For pro tips on using the ātimes of the day sensor helperā and or a āschedule helperā as the trigger please see or FAQ.
Bugs Fixes
- Fixed error log in safe guard HA restart condition.
- Fixed error log in ambient condition.
- Fixed bug in sun.
- Fix bug in ambient.
- Fixed bug in time.
- Fixed bug in trigger.
Enjoy
Blacky
Thanks for all the efforts with this blueprint Blacky!! All these new features are awesome. My most useful blueprint by far. I finally found the Donation link, I never really look at the links in the top of the blueprint. Not sure when you added the link but it sure would be embarrassing not to donate when I kept calling on you to add a donation link. Again thanks for the awesome blueprint.
Thanks for your support . The Donation link was only just added so your on the ball. I am glad you like the new features and there are more to come
Blacky
Thanks for this automation!
Any chances to use the sun option to drive the night lights?
Hi Pablo, yes this is 100% on the road map. I am just trying to work out the best way to do this (not the code just the best user-friendly way) and have a few questions for myself that I am trying to work out. Maybe I should ask the community.
Lately, I am always getting the following error once I trigger a sensor:
Error rendering variables: UndefinedError: 'dict object' has no attribute 'entity_id'
Source: components/automation/__init__.py:508
I tried different sensors, it is always the same error.
Hi @Danielki
Firstly welcome to the community
What version are you on? If you are not on Version 3.6 please update.
Q: How do you update the blueprint and not delete / recreate existing automations?
A Please follow these steps Click Here.
Please also make sure you havenāt enabled an option and not added a entity in the Bypass, Ambient , Zone & Night Lights. If you dont what to use the option please disable it.
Let us know how you go.
Hey @Blacky
Thanks for the quick reply. I am on the latest HA 2023.6.1 and I have also successfully updated your blueprint.
I have not added additional entities. Unfortunately, I still get the error on every trigger.
Hi @Danielki
Could you please provide us your YAML of the automation? To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on ā</>ā and paste code in there.
Just quickly, did you reload the automation as well. It is in the how to link above when updating. You need to check the version number is displayed at the top. Just checking for sure as this was one of the bug fixes in Version 3.6.
Thanks
Blacky
Hi @Blacky!
As per status quo:
- By-pass: On
- Check By-pass Option: Leave Lights On
Currently, if lights are on, they will stay on as the automation will stop.
However, if lights are originally off, they will not turn on.
To make the bypass behave more like a normal light switch, is it possible for the blueprint to turn the lights on?
I have not given it deeper thought if this case would lead to any logical issues.
HI @samuelthng
Yes correct
You can turn the lights ON manually, but the automation will not turn them ON.
I can see what you are trying to do, and yes I like it. Thanks for the suggestion . Not promising anything but I reckon this will be in the next release. Now I have to do the code for it
Blacky
Hello @Blacky
thanks for the great work. But I am doing something wrong or I have overlooked something.
HA. 2023.6.2
Blueprint 3.6
Occupancy triggers but in the flow of the automation I donāt see that the trigger was triggered in the automation.
I have checked Occupancy via developer mode which goes cleanly from off to on and from on to off.
Did I miss something?
if I make a simple automation with the sensor and Occupancy everything is ok and works
Hi @Blackymas
Thanks for all the information
Could you please expand ("< >") your devices down to entities as āAreasā and āDevicesā are not supported. Once you have done that, you should see your triggers.
Let us know how you go.
Blacky
Hi Blacky,
Iām on a mission to remove bugs from the HA instance. Here is one from this blueprint
Error evaluating condition in 'Laundry - Lights on motion': In 'condition' (item 1 of 6): In 'or' (item 9 of 9): In 'and' (item 1 of 2): In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'
7:21:53 AM ā (WARNING) Automation
Here is the YAML for the only automation I use (testing it presently for wider implementation)
alias: Laundry - Lights on motion
description: Laundry - Lights on motion
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.md_laundry_group
light_switch:
entity_id: light.laundry_white
time_delay: 3
include_light_control:
- use_brightness
light_transition_on: 0
that was the mistake - sorry and thank you