Problem with automations after upgrading to 0.96.x

After upgrading to version 0.96.x two particular automations stopped working.
They are using presence detection in order to perform thinks.
Any help will very much appreciated.

- id: '1545599486301'
  alias: Leaving Home
  trigger:
  - entity_id: group.angela_presence
    from: home
    platform: state
    to: not_home
  - entity_id: group.nicolas_presence
    from: home
    platform: state
    to: not_home
  condition:
  - condition: state
    entity_id: group.presence
    state: not_home
  action:
  - data:
      entity_id: group.all_lights
    service: light.turn_off
  - data:
      entity_id: group.air_conditioning
    service: climate.turn_off

- id: '1545599290015'
  alias: Coming Home
  trigger:
  - entity_id: group.angela_presence
    from: not_home
    platform: state
    to: home
  - entity_id: group.nicolas_presence
    from: not_home
    platform: state
    to: home
  condition:
  - condition: or
    conditions:
    - after: sunset
      after_offset: -01:00:00
      condition: sun
    - before: sunrise
      before_offset: 01:00:00
      condition: sun
  - condition: state
    entity_id: light.aeotec_zwa001_led_bulb_6_multiwhite_level_2
    state: 'off'
  action:
  - data:
      entity_id: group.kitchen_lights
    service: light.turn_on

you are using services not suited for the entity_ids.

use homeassistant.turn_on for groups.

not sure about the airconditioning (i don’t have a climate entity), but you probably need another service there also. Still, you use the entity group.air_conditioning, and not a climate entity (https://www.home-assistant.io/components/climate/) so that should be turned on using the homeassistant.turn_on service also probably.

This used to work. Did anything change?
The problem is that these automation are not even triggered so I I do not think the actions are even related since it does not go to this task.

In addition, I have tested the actions from Developer Tools and they worked.
I even triggered the automation manually and they worked. So, in my opinion the problem is with the trigger.

well, not sure if anything changed in that department, only know one should use the correct services for entity_id’s. groups are turned_on/off using service homeassistant.turn_on/off.

about the trigger: should be fine, but maybe your automation isnt ‘on’? depending on the previous version, you might have run into the change for automations using initial_state, and the restore state setting.

please check the automation in the state page

did you go to the service page and select light.turn_on? No groups are displayed clicking the entity field, at least not in my 2 HA instances.

if the group would be a light group Group - Home Assistant the entity would still be light, and the service would still need to be light.turn_on. You have discovered a bug here :wink:

This is for the air condition groups

As for the light group is not there(it was removed from some point) but it works.
You can type it manually.

FYI… there is now a person component. Maybe give this a try instead of using groups for Presence Detection. Sounds to me like the issue is not in the action, but in the trigger.

please check if the automation is ‘on’.

{{is_state('automation.coming_home','on')}}

in dev_template, or check the dev_state page

It is enabled I checked it twice

try wrapping your ‘home’ & ‘not_home’ in the trigger in quotes.

And you need to verify the ‘from:’ & ‘to:’ states are the correct states for the group. If for some reason the group is in another initial state other than ‘not_home’ the automation won’t trigger if the state then goes to ‘on’ since the from state isn’t correct. you can remove the “from:” line completely unless you really need it to be that specific. as long as you leave the to: in there it will trigger when ever it goes from some state to ‘on’.

1 Like

The automation is using a State Trigger to monitor a group and a group has two states: on and off. However, this trigger is not looking for on and off, it’s expecting the group’s state to change from home to not_home. Those states are for device_trackers, not groups.


EDIT
I was wrong.

The state of group containing device-trackers can indeed be ‘home’ or ‘not_home’.

I use a group with two persons for my occ/unocc automations, their states are home/not_home. So maybe if the states are the same for the entities in the group, it uses them instead of off/on?

Running 96.4

Untitled

I think you’re right. None of my groups contain device_trackers (only lights and switches) so I was basing my conclusion on personal experience (in this case, a bit too limited).

I read through the documentation and, sure enough, it mentions home and not_home when the group contains device_trackers.

Similarly with a device tracker, when any member of the group is home then the group is home .

Guys, I have upgraded to version 0.96.4 and everything is back to normal.
I do not know what went wrong. These two automations have been working for a long long time.

Thanks for your help.