Seem unable to trigger automation on Person state change

Currently running 0.112.4 supervised.

I have an automation that activates a scene. When i execute the scene manually it works as expected. When I execute the automation manually it works. When I used the developer tools to change the state for the Person the rule does not trigger. It is pretty simple, so I must be doing something very daft.

- id: '1595751913049'
  alias: Kates Room Lights off when she is not_home
  description: ''
  trigger:
  - entity_id: person.kate
    platform: state
    to: not_home
  condition: []
  action:
  - scene: scene.kates_room_lights_off

When you change the state of person.kate on the STATES page…

  1. Was it something other than not_home to begin with?
  2. Did you change it to exactly not_home?
  3. Was the automation on?

If the answers to all of those questions are yes, then it will trigger and activate the scene.

  1. yes it was “home”.
  2. yes via the Developer Tools
  3. yes

Remember that for a Person their state is set according to the associated “device_tracker”. Now i am NOT changing the underlying device_tracker, rather i am just changing the state of the Person entity. Could this be the issue? That is the Person.kate state change is not actually happening because it only happens with the associated device_tracker changes?

Thanks so much for the swift reply.

This is probably a red herring but I am excluding things from the history db to maintain space if that makes any difference

exclude:
    domains:
      - automation
      - updater
      - light
    entity_globs:
      - binary_sensor.c_bus*
      - sensor.bom*
    entities:
      - sun.sun # Don't record sun data
      - sensor.last_boot # Comes from 'systemmonitor' sensor platform
      - sensor.date

Correct, you’re not actually changing the person entity, you’re just changing the representation of its current state in the State Machine. But to test the automation, that’s fine, because automation triggers watch the State Machine, not the “internal” state of entities.

It doesn’t make any sense that the answers to those three questions are all true, but yet you say the automation doesn’t trigger.

Are you sure you reloaded automations, or restarted HA, after changing the automation?

No, the db has nothing to do with automations. They watch the State Machine, which is independent of the db.

Ok, it is working. I think it could have been a cascade of things:

  • scene being activated uses a light group
  • light group config had some groups that included “switches” not just “lights”
  • I fixed all this up by using a “light switch” and things worked.

Or it could have been the right number of restarts :smiley:

Thanks for the swift responses, sorry for the boring question.