Automation: Using a Group as a Trigger not working/bug

Hi All,

Have been pulling my hair out over this one. Basically I have 3 devices I want to track in a group called “phones”. Based on this group I have an automation to shut off all the lights if the group state becomes “not_home”. The group state changes just find but the automation does not trigger.

The automation used to work but only realized it stopped working when showing off HA to friends at a restaurant and the lights were still on.

The Automation

  - alias: 'Lights Off When Away'
    initial_state: True
    trigger:
      - platform: state
        entity_id: group.phones
        to: 'not_home'
    condition:
      - condition: state
        entity_id: input_boolan.guest_mode
        state: 'off'
    action:
      - service: light.turn_off
        entity_id: group.all_lights

The Group

  phones:
    name: Phones
    entities:
      - device_tracker.first_phone
      - device_tracker.second_phone
      - device_tracker.third_phone

The Group changing state
image

Any help is appreciated!

Look at the dev-states page and see if the automation state shows as “on”.

And if it is then make sure the state for the group actually goes to “not_home” instead of some other state.

And I just noticed that you have the wrong entity_id in your condition. You have “input_boolan”. It should be “input_boolean”. I’m not sure if that would prevent it from triggering because I don’t know how the automation system handles non-existent entities in a condition but it’s something that needs fixed regardless.

And I also just noticed that you are probably using the wrong service in the action. I’m pretty sure I think you need to use homeassistant.turn_off turn off a group. That might be OK since they are all lights in the group but I would change it just to be sure.

Just restarting HA now to see if that spelling error was the problem!

OH MY GOD! It was the spelling error! Thankyou for picking up on my misreading I was so annoyed that this seemingly simple automation did not work for weeks!