Hi, I just installed my conbee stick via ZHA and added my hue motion sensor. The first thing I tried was this blueprint and I like it very much. Good job!
One suggestion for improvement: The official “Motion-activated Light” blueprint allows to pick an area as the target device. This is very convenient because it will trigger all lights in that area (room).
Would it be possible to add areas as possible target entities to this blueprint?
I was getting “Invalid domain name” and my automation didn’t work. It was not at all clear to me how from the example how to actually get values into the times. Example shows how to define the time entitles, but not how to set their values. If it’s possible to add the values in the automation’s YAML, show that in the example, and also mention that to use the optional features you MUST edit in YAML. I completely ignored that section because I want avoid YAML configs when possible, just an ideological thing with me.
What I did, based on the suggestion in one of the comments here, is to go to the Configuration->Helpers page and define the time and number entries, then click the slider icon thing in the upper right to set the value. I don’t know if this is the best way, but being new to HomeAssistant this is very unintuitive. I’d much rather just type the values in, but i can understand if the limitation of the language doesn’t support casting those string values.
Actually now I see that you do mention to create the helpers, in a single sentence, that I didn’t know what to do with since this is my first automation ever. Can that just be more clear that we need to go into Configuration->helpers? Now that I know what to do it’s clear, it’s just not clear to beginners.
I looked into it, but it does not seem compatible with how this blueprint is setup.
Blueprints can have entity selectors (like this one) or target selectors (which support area’s).
I cannot change this blueprint to have a target selector without breaking it for previous users.
A workaround is that instead of using area’s, you define a group for the lights you want to trigger.
I’ve now updated the first post with info on how to do that.
It’s possible to set an initial value for helper entities in YAML, but I dont recommend using it because the value gets set to this value every time homeassistant starts. I want the value to be dynamically set and stay that way until the user changes it.
Like you yourself have found out later, using YAML is not required to use the optional features, or at all for this blueprint.
The reason for not being able to type in users is just a design choice on my part.
I wanted to use dynamic limits, not hardcoded ones.
I’m still pretty new to HA, so this might be obvious to most: is there a way to set the run before/after times based on sunrise and sunset? Possibly with an offset (like stop an hour after dawn, or an hour before sunset)? I know I can get Sun state, but unsure about daily datetime.
That should be possible by defining an input_datetime that is set by an automation when the sun state changes.
Some examples here.
I also see that there are already datetime values in the sun.sun entity attrributes that can be used for this.
I don’t have the exact code for this right now, but maybe someone else has something like that ready to share?
Hi
Thanks for this blueprint
As for some others here I am quite new with HA and not very good at yaml.
I was wondering if there is a reason that the time fields are somewhat “inverted” instead of having them say run from 07.00 - 18.00 ? Maybe just me but it seems more logical.
Also would it be possible to have what weekdays the automation should run, for example we have a combined office and playroom and on weekdays when it is used for office the time between motion needs to be longer 60-120 min whilst on weekends when it is used it needs to be shorter 15-20 min.
But great work with having a lot more possibilities than most motion blueprints!
Thanks
I wrote a blueprint which uses Sun elevation. I tried the sun rise/sun set time, somehow they do not work well in condition (but works perfectly if they are in trigger)
Hi,
I’ve been running an automation based on this blueprint for a week. It generally works very well, but there is one thing that is bugging me: During dusk, there is a time period, where the outsight light is below the cutoff, so the lights are triggered. But the lights also illuminate the sensor to a luminance higher than the cutoff value. So after the timeout, the lights go out and are not triggered immediately again by movement. Only after the illuminance sensor gets a new reading of the dark room a while later, movement will trigger this automation again. So I have to sit in the dark (rather dusk) for a while… Quite annoying.
I had the same issue. My suggestion: use sun set time instead of illuminance sensor, or move your sensor to a place not under the light, or use my blueprint provided above.
I tried to use the “Only run after time” option without success. Input is for example: 10:00
The log registers the following: 2021-01-16 12:01:15 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: TemplateError: str: Invalid domain name '11:20
No trigger at all happens. What could be the cause?
Besides this, I checked the Blue print code. and a warning pops up (see attached file). I imported the latest version of this Blueprint.
I think I know what you mean but just to check, you think the input fields for ‘Only run before time’ and ‘Only run after time’ should be swapped? That makes sense to me;) I will change it in the blueprint.
That is hard to support with a good input field for this automation, because weekday inputs are not yet supported.
A workaround I can think of is creating 2 automations with this blueprint, and then turning the automations on and off based on the weekday.
Something a bit like:
- alias: Turn off blueprint automation 1
initial_state: true
trigger:
platform: time
at: '00:00:00'
condition:
condition: time
weekday:
- mon
- wed
- fri
action:
- service: automation.turn_off
entity_id: automation.generated_from_blueprint_1
Good evening, the script works perfectly, I would like to have the light switched on via a door contact and if no movement was detected for a period of 5 minutes, switch the light off again. Maybe someone can help me
Just use the door sensor as the motion sensor entity.
Otherwise just use the blueprint as described, it will work if the door sensor state = ‘on’ when the door is open
Hey, i use this automation to trigger two scripts that call rest commands. One as the turn on entity and one as the turn off entity.Any ideas how I can wrap these scripts in some entity so that the turn off wait time will work?