YAMA - Yet Another Motion Automation (Scenes, Ambient Light and some Conditions )

I´ve made the automation blocker user choosable. This means you can now decide if the blocker must be on or off for this automation to run.

Also i encountered a weird bug which i can not reproduce. During testing i noticed that following line was added in an automation for this blueprint:

- id: '1609100884991'
  alias: Yet Another Motion Automation
  description: ''
  use_blueprint:
    path: networkingcat/yet_another_motion_automation.yaml
    input:

      elevation_check: 0

I mean the elevation_check. I do not know how this got in there (I definitly did not change this).
Problem is this makes the elevation check no more optional and if you do not use it you may wondering why this automation does not run anymore. Deleting the line solves this.

Problem is i can not reproduce this, so if you encounter this too please let me know and try to reproduce.

@lubeda
Unfortunately my templating is not good enough too add this at the moment.

Thanks and regards

very very cool. I will pursue it further!

great with the group trigger !!!

Might not be the best place to ask this but how are we supposed to update blueprints?
I added this automation twice (once more after it got updated). Due to a naming conflict I renamed the blueprint while adding it. Now that I deleted the “older” version it also deleted the contents of all my existing blueprints. Even though those were added with the newer version. Also I get this error now:

Invalid config for [automation]: Failed to load blueprint: Unable to find networkingcat/yet_another_motion_automation vx.yaml (See /config/configuration.yaml, line 9).

I created the <vx.yaml> as a second version as mentioned above. I deleted and readded everything (works as well I might add) but the “Invallid config” notification remains. Line 9 in my configuration.yaml is just the following: group: <!include groups.yaml>. I don’t have any other automations using this… no clue what’s triggering this.

Edit: ok, i had some leftover automations. Still, how to ideally update blueprints? Just recreate them from scratch? I feel like adjusting the automation mostly ends in recreating it from scratch…

Hi,

I always delete the old blueprint and add it again.

Automations from the old blueprint should work again after the updated blueprint is in place. So no need to rebuild the Automations.
The name and path are the identifiers for a blueprint in an automation so when this is the same after an update everything just works fine and new features should be usable.

Of course there could be breaking changes in a blueprint but i try to not have them.

I understand that you created a second version with a different name? Then you could also update als mentioned above and change the name/path to the new correct one in your automations.yaml

Tanks for your feedback! I deleted the second version and all the automations I created with it. Rather keep it simple.
I still have a question regarding the timeframes:

If I want to have a night scene which starts at 22:00 and ends at 06:00 the next day I’d have to configure two Scenes for 22:00:00-23:59:59 and one starting at 00:00:00-06:00:00? At least that’s how I understand it.

Is it possible to have two different Ambient/Background Scenes? Idea would be to have the “default scene for no motion” for the night background and define the ambient scene as the daylight background. Don’t know if it one overrides the other and am hesitant to test it as I’d need to recreate from scratch yet again. :slight_smile:

I need your input to make it better :wink:

It should work with one scene. If you only want to use the night scene you should be able to do it this way:

“Time for the night scene”: “22:00:00”
“Time for the morning scene”: “06:00:00”

That is how it supposed to work.

You define the default no motion scene with a scene you want except for the given time frame of the ambient scene. Then you have the desired behavior.

Clearly i need to update the documentation do better reflect all possibilities.
(I know that i am not so good with “that stuff”, but i will try)

If you want too try you can always copy your automation (via the three dots top right corner) and deactivate the old one. That way you can switch back fast.
There a more ways, but this is one fast way with only GUI.

Hi,

i have added an optional “no motion blocker” with user choosable desired state.
(That was easy to add because i already had the code for the automation blocker and i need that for the next room.)

I´ve noticed that after updating the blueprint importing and using it always sets the elevation variable on my system. I do not know why, i did not change anything there…

If you use this new Version please can you check if you have the same bug?
You can check this very fast, if you are in the configuration for a automation using this blueprint click the 3 dots top right corner, switch to yaml and look for this:

elevation_check: '0'

If it is in there and you did not configure this than you have the same bug.
Still i do not why and how… :frowning:

I should probably just make my own blueprint, but what I really would like to have is a motion automation that

  • detects motion
  • sets lights/scene bases on time of day
  • motion ends
  • restore lights to their prior state

I know you can do this with an action to create a new scene on the fly. Instead of just turning the lights off, it would be much nicer if you identify the lights that are being modified, then created a scene before changing the settings, and finally at the end of the motion just restore the scene that you previously created.

3 Likes

Ran into some issues with the following error code:

Blueprint Yet Another Motion Automation generated invalid automation with inputs OrderedDict([(‘no_motion_wait’, ‘30’), (‘motion_entity’, ‘binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone’), (‘light_target’, OrderedDict([(‘device_id’, ‘89c1257d5a9585f961592e849e99ca2’)])), (‘automation_blocker_boolean’, True), (‘automation_blocker’, ‘light.schlafzimmerdecke’), (‘scene_night’, ‘scene.schlafzimmer_nacht’), (‘time_scene_night’, ‘33:00:00’), (‘time_scene_morning’, ‘9:00:00’)]): Invalid time specified: 33:00:00 for dictionary value @ data[‘action’][0][‘choose’][2][‘conditions’][1][‘before’]. Got None <

What to make of it? I never set the “invalid time specified”. This should be 21:00:00 instead of 33:00:00

I can not imagine where this comes from, there is nothing in this blueprint which could cause this. (at least not that i know of)

Also i noticed this:
(‘automation_blocker’, ‘light.schlafzimmerdecke’)

is light.schlafzimmerdecke an input_boolean?
Can you please paste the automation as yaml?
(Configuration of this automation, three dots top right, select yaml)

Also which version are you using, that is in the description of the blueprint

This is absolutly possible, but to be honest i do not know in the moment if i build that in. :thinking:

Ok it seems the error is down to some leftover automations, which weren’t properly deleted over the UI. Had to manually edit the automations.yaml to get rid of these leftovers. This might also be the reason I had conflicts earlier.

light.schlafzimmerdecke is a Hue Device (not entity)… I think it should work. Have to test it first.

-> the blocker didn’t work. Can you use a target entity such as freakshock88?

Glad you sortet this out.

I can remove the input_boolean domain.

Hoping that in the future we are able to select multiple domains to make is easier for beginners to use that correctly.

Expect a new version tomorrow evening. No time today and my test stuff is in use for a little rework of the blueprint logic.

New Version online with restructered action logic to hopefully get new features in this soon.

I think i tested everything :smiley:

Still have the elevation bug, but nobody else is complaining so i guess this is something only i have :grimacing:

With the new blueprint it no longer works for me.I just added motion detectors and lights. With the old version, the light also went on during the day, now it doesn’t come on during the day. But I don’t want it to work during the day as it is quite dark in the basement …

Hi,
Can you please check if you encounter this bug?

yes I have it in the .yaml. the old version ran fine.

Can you please try to delete the line and check if it reappears again?
I do not know why the blueprint is doing this, this started at some point. But there was no change for this stuff so I am hunting a ghost.

Did you add all the times for the scenes and ambient or are the wrong as well?
If yes then this is a new one also. (I do not have this if I do not configure them)

As a quick fix you can set the value for elevation to 90,then it should work the whole day.

Best to reverse this after the bug is fixed

I have now deleted the line and will not come back. the automation works again now. I also tried to set your tip to 90, unsuccessfully. I didn’t set up scenes and anything else, just motion detectors and lights. I have some shellys in operation that act as a “switch”, but I cannot select them because only “light” can be selected. is it possible to add “Switch”?

If you want to control switches you can at the moment use a scene or or expose the switch as a light :