State changes not triggering automations

I am using an automation to detect the state change of the device tracker to activate something when i come / leave home. However the automation is not triggering, and i just can’t seem to find the problem.
Here is the code

trigger: 
  platform: state 
  entity_id: group.all_devices
action: 
  service: ifttt.trigger 
  data: 
    event: test 

I have already tested different versions of this, with or without any conditions, or using “from”, “to” or “state” in the trigger. Is there something i need to do first? Or am i missing out on something else ?

You have not defined the state change. You need to add the below after your entity_id.

from: ‘not_home’
to: ‘home’

I have already tried this but it still doesn’t work.

Try the following:

trigger: 
  platform: state 
  entity_id: group.all_devices
action: 
  service: ifttt.trigger 
  data: {"event":"test"}

Also, it is not required to define a state (or a from state or a to state) in a trigger. If you don’t, the trigger will fire on every state change.

Sadly it still doesn’t seem to be working. I don’t think that there is any problem with the action, since this is exactly the same service that i use in another script. I have also tried using other services but they don’t seem to be working.

Are you sure all of your tracked devices are offline or outside of the house? The entity group.all_devices contains all of your tracked devices, and the state of that group will remain home as long as there is at least 1 device which has the home state. The state of the group will only change to not_home when all tracked devices have that state.

Yes I am sure, when i go into the UI and look in the states tab for this group, i can see it’s state change.

I have finally found the problem: I forgot a blank space in the group tab, which led Home Assistant to not properly load some of the components, including the automation component.