2025-09-19 11:55:00.382 INFO (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Running automation actions
2025-09-19 11:55:00.383 INFO (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 1: Check if turn ON time is enabled: Running automation actions
2025-09-19 11:55:00.383 INFO (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 1: Check if turn ON time is enabled: Executing step delay 0:01:00
2025-09-19 11:56:00.385 INFO (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 2: Turn ON actions: Running automation actions
2025-09-19 11:56:00.389 INFO (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 2: Turn ON actions: Choose at step 1: Check if same time is selected: Running automation actions
2025-09-19 11:56:00.390 INFO (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 2: Turn ON actions: Choose at step 1: Check if same time is selected: Executing step call service
2025-09-19 11:56:00.390 ERROR (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 2: Turn ON actions: Choose at step 1: Check if same time is selected: Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['entity_id']
2025-09-19 11:56:00.390 ERROR (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Choose at step 2: Turn ON actions: Error executing script. Invalid data for choose at pos 1: value should be a string for dictionary value @ data['entity_id']
2025-09-19 11:56:00.391 ERROR (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Unoccupied - TESTING 1: Error executing script. Invalid data for choose at pos 2: value should be a string for dictionary value @ data['entity_id']
2025-09-19 11:56:00.392 ERROR (MainThread) [homeassistant.components.automation.unoccupied_testing_1] Error while executing automation automation.unoccupied_testing_1: value should be a string for dictionary value @ data['entity_id']
Lights ON/OFF Order - At the Same Time - Previously, selecting this option could cause an error and stop the automation. This has been fixed so all entities now turn on correctly.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Nice work! I have only started to control 12 different light controls around the house. From what I can see, this automation seems to be evening/night centric. Perhaps the LUX and sun location could include morning automation periods asa well. Or perhaps it does and I missed that? For the time being I’ll use a secondary automation for morning vacancy automations.
EDIT: Ok, figured out sun location works for both dawn and dusk conditions. Ignore. However, however will the LUX value work both in the morning (lux increasing to target value) as well as evening (lux decreasing to target value)?
Oops sry, didn’t see your message asking for a yaml…
Anyway, fixed on latest version, just verified it.
You are making me to migrate from node-red to (your) automations.
Thanks a lot!
Let me a question if possible:
Is it possible that when we have the automation control based on an entity state, whenever gets off, will turn off the lights automatically?
Also, let’s say I configured to run automation at 22h, but at 23h I decide to enable it. There is no way to run it until finish time or while sun position is low?
The automation must be running and then you use the Lights ON Duration Method.
Normally your on holidays or away and the automation is enabled already. Automation triggers happen at the time of the trigger not pre-trigger. Enabling the automation wont trigger the automation.
Hello is there a way to turn off the lights based on sun elevation?
I am confused on how to turn off the light as it only asks for below option however if I dont want to use it where do I specify to turn it off either based on a fixed time or 1 hour before sunrise.
Lights ON Duration:
Duration Method: You can choose how long the lights stay ON before turning OFF.
Minimum / Maximum ON Time: Lights stay ON for a random duration between the set minimum and maximum ON time.
Earliest and Latest Time Range: Lights turn OFF at a random time within the defined earliest and latest OFF time range.
Entity State - ON: Lights stay ON for a random duration after an entity is turned ON before they turn OFF.
Entity State - OFF: Lights stay ON for a random duration after an entity is turned OFF before they turn OFF.
Currently, no. I do have another blueprint that can turn your light ON with multiple triggers and OFF at sunrise. That’s why I didn’t include this option (as well as the ambient option) in this particular blueprint.
Please let us know if that works for your setup. If not, could you share a bit more detail about what you’re trying to achieve and why you’d like the sun elevation to control when your lights turn OFF? That would really help me understand your use case better.
This one will work thank you so much. I was also trying to create an automation just for specific Holidays as I put the same decorations out and use the same smart switches so I was looking for a way to turn them off 2 hours before sunrise.
In the Trigger Settings section the Turn ON Time is hard coded in this automation. Would it be possible to extend the Trigger Settings with an Turn ON Time that uses a time helper that can be selected by the user?
A workaround would be to create an automation that sets an entity to an OFF state so that the Entity State OFF trigger can be used. But having a time helper as an option would be much easier.
Are Tigger Settings conditions or actual triggers. Trying to reconcile the difference between Automation Control and Trigger Settings. If they are conditions, perhaps change the title and some of the wording within to reflect that. In The Automation Process above, they are referred to as Trigger Conditions. It’a all quite confusing given that the Automation Control is optional. Or is Automation Control the condition block?
Great blueprint. Looking forward to future enhancements. Thank you!
I have 2 rooms with windows facing the street. One room is the living room the other is the bedroom.
I configured the automation to use sun elevation as trigger and for duration I set earliest / latest off time to 22:00 / 23:30.
Added one light in the living room. So far so good.
For the bedroom I don’t want a light to be on the whole time.
Is it possible to have a light turned on and off randomly during the evening?
So it looks like someone enters the second room and then leaves again. Several (random) times per evening.