Hi.
After the latest update, the entity group is no more available or usable as a condition.
I have an automation that I want triggered at a certain time, but only if I am not_home
I have tried
- condition: template
value_template: 'value_template: "{{ not is_state(''device_tracker.google_maps_******'',
''home'') }}"'
- condition: template
value_template: 'value_template: "{{ not is_state(''device_tracker.google_maps_****',
''home'') }}"'
and
condition:
- condition: state
entity_id: device_tracker.google_maps_******
state: not_home
- condition: state
entity_id: device_tracker.google_maps_*****
state: not_home
The devices are in all the states, showed the right zone, but even when we are both not_home none of the above condition is EVER true and the automation never triggered.
Where am I wrong? the deprecated device group was working.
thank you for your answer.
nope, I expurged group.all_devices once it was deprecated.
Before the breaking release it was a legal part of a condition, after the update the condition was everytime false.
the second part: sorry for the copy/paste error. the same, once purged it wasn’t working.
ie, stop using double single quotes, dont write double value_template, and to make things easier (not perse required but easier) use multi-line notation with the > to prevent mistakes with inner and outer quotes
if you take @VDRainer 's advice, which is very sane, you can use the same template for the group.all_devices (but do understand what you want, and maybe use the all: true option to explicitly state all group members need to be ‘home’ for the group to be ‘home’)
I tried to check the state in the states page but because both parents were at home, it didn’t show me the opposite state. I tried to look in the history as I mentioned above, but for the period during which both parents were not at home is blank, as I mentioned. Odd.
Thank you for the tip, I’ll try to adjust the quotation marks and the capitalisation as you suggest.
I have an impression that group’s state has meaning only when the group contains entities of some binary logic i.e input_booleans, switches etc. The easiest way to see a group’s state is to find it in States as it’s an entity.
tl;dr - It might be that a group of entities that have home/not_home status never has state == True.
well yes, mixed groups wont have state home/not_home.
In this case OP uses device_trackers, which will make the group have the state home/not_home also.
I was saying that he can test the state of the group, but setting the state of the individual device_trackers in the developer/state page.
Note that the option all: can be useful in this case. This would set the group to home, only if all group members are home. Without that, the group would be only not_home if all members are not_home …
My point was different. For example, I have a group of temperature sensors - its state is unknown, but it’s not a mixed group.
If device_trackers are in a way binary then it might work, but I wouldn’t count on it without checking. I believe it’s easy just to make sure it will ever work