You did not need to create a group, if you wanted you could have justed added a second trigger. All the triggers you define are or’d.
You’re right but it relies on restart
in an unusual way of achieving the desired effect.
@wgstarks
Is the Automation Editor including this “do nothing” part by default or are you doing something to include it?
for:
hours: 0
minutes: 0
seconds: 0
Because it’s unnecessary.
The automation editor is including it by default. I thought about just deleting it in the yaml editor but didn’t know what problems that might cause.
I see. You can safely delete it if you wish (it only serves to clutter the YAML code) or leave it be. Your choice.
You may have noticed that none of the examples that have been offered to you employ Device Triggers and use State Triggers. In case you were wondering why, it’s because Device Triggers were invented as an easy way to create a trigger for a device via the UI. The resulting YAML code it produces is long-winded and not particularly ‘human-friendly’. I can’t imagine anyone wanting to type this manually:
device_id: 294247b81aa20bae5e0a25eaef4c5c85
It’s also more verbose, using 5 options:
- type: motion
platform: device
device_id: 24157696796a0d0045508adff42ff641
entity_id: binary_sensor.motion_sensor_ii_54_57_5b_motion
domain: binary_sensor
to do what can be done with just 3 options:
- platform: state
entity_id: binary_sensor.motion_sensor_ii_54_57_5b_motion
to: 'on'
Can they be defined as “and”? I have an associated “lights off” automation that would require all triggers to turn lights off 15 minutes after last motion detection. I think I would need “and” for that?
Thanks. Done.
Do you want that both motion sensors must be off, for a minimum of 15 minutes?
Create a group containing the two motion sensors and set the all
option to true
. As a result of setting that option, the group will indicate on
only when both motion sensors are on
and will indicate off
only when both motion sensors are off
.
This automation will trigger only when the group’s state is off
for 15 minutes. in other words, both motion sensors have been off for at least 15 minutes.
alias: motion_activation_lights_off
trigger:
- platform: state
entity_id: group.my_group
to: 'off'
for: '00:15:00'
action:
- service: homeassistant.turn_off
entity_id: switch.togglelinc_on_off_12_13_48, light.driveway_light
mode: single
That’s why I added the “or at least” part to the post because I’m not 100% sure that it’s still used there. I was going from (admittedly suspect) recent memory. I’ve fixed it for clarity.
But the point still stands.
I can show you many places it’s still used directly in the installation itself. Here are at least 12 references to “hassio” and that’s without looking any further than my own system:
It may not be in the “user docs” (or maybe it is…) but if it’s in the name of the install packages/images then I find it strange that you could be somewhat mildly condescending to someone for still using it.
And don’t forget I agree with the name change. However, it makes it hard to encourage others to start using the new naming scheme (which I do) when the devs themselves (who started all of the hullabaloo in the first place to change the name) can’t be bothered to fix it in the official repositories.
But this has nothing to do with the OP so I’m out. so I’m almost out.
I don’t see an entity listed in the gui editor. How can I get the entity_id?
A screenshot of Portainer to find an example of the use of hassio
? Plus you first have to modify Portainer’s options to display hidden containers? I very much doubt the average new user will see any of this even after they’ve installed Home Assistant OS.
There’s no question that if you look deep enough you’ll find traces of the old name (and even that is going away with hassio
in container names being replaced by supervisor
). However, new users aren’t likely to go to such lengths to unearth it. If they refer to the official documentation, they won’t encounter the word hassio
. Where they will see it is in old posts and tutorials and we can’t control that but we can influence it here in new posts.
I didn’t. They were displayed by default.
But then again I use HA Supervised, not HAOS. So I’m sure there’s a difference there.
I believe in the adage “lead by example”. If the devs don’t want people to use hassio then make sure that they wipe it out themselves from things they have direct immediate control over.
Especially if they were so adamant about wanting the name changed that they would (reportedly) actually ban people from discord for using it (or was that “hassio in docker”? Eh, either way…)
Good, I didn’t know that.
Yes, I agree with that.
But, maybe more…gently…
I’m unable to setup a group. Keep getting this error-
Invalid config for [group]: [driveway_motion] is an invalid option for [group]. Check: group->group->group->driveway_motion. (See /config/configuration.yaml, line 8). Please check the docs at https://www.home-assistant.io/integrations/group
groups.yaml-
group:
driveway_motion:
name: driveway motion detection group
entities:
- binary_sensor.driveway_motion
- binary_sensor.motion_sensor_ii_54_57_5b_motion
Not sure what a valid entry is for line 2. Documentation doesn’t give any info on this.
If you are using groups.yaml
the first line should not contain group:
. Remove it.
This holds true for other files as well. For example, if you have a sensors.yaml
file then its first line should not contain sensor:
.
After a lot of trial and error I think I finally got the “lights off” automation to work. I originally did like you posted and set the group to “all” and used your code. The lights never turned off. I finally got this code to work with “all” set to false for the group-
alias: motion_activation_lights_off
description: ''
trigger:
- platform: state
entity_id: group.driveway
for: '00:15:00'
from: 'on'
action:
- service: homeassistant.turn_off
entity_id: 'switch.togglelinc_on_off_12_13_48, light.driveway_light'
mode: single
It’s my understanding that if any member of the group is “on” then the group is “on” so any time a motion is detected by a group member it should reset the timer. Right???
When I look at the motion detector signals I see this-
Makes me wonder if I should be using “detected” and "cleared’ instead of “on” and “off” for the state changes in my automation?
No.
Good luck.