I am experiencing an issue with notifications in Home Assistant. My motion sensor is correctly configured and detects motion, but I do not receive any notifications on my phone when it is triggered.
When I manually run “Run action” in the automation, the notification is sent to my phone without any problems, but it does not work automatically when motion is detected.
What could be causing this, and how can I resolve it?
That screenshot trigger is for when the device detects motion, but the configuration you show is for when the device stops detecting motion… are you sure those you haven’t accidentally posted two different automations?
In the automation editor, click the link at the top right that says “Traces”, that will give you details about if/when the automation was triggered as well information about errors, etc.
The reason I shared the link to the Community Guide is because of the mesh map you shared. Your motion sensor does not appear to have a stable connection to your coordinator. This is most often caused by a weak mesh, which correlates with what the map shows. A strong and reliable Zigbee network normally needs to include at least one router in each room, but your mesh doesn’t seem to have any.
An unstable connection will make it unlikely that the motion sensor’s state change from “clear” to “detected” is reliably and accurately recorded.
Also, the trigger in your automation do seem odd (to me anyways) - I don’t use ZHA so don’t know if it is typical, but you have both device_id and entity_id… which does not seem right (again to me anyways)…
I personally do not like those ids, only because no one here (and maybe you, even) would know what exactly those ids are.
In Developer tools, under the states, do either of those turn from off to on when triggered? How long would the occupancy binary sensor stay on, after the motion goes off?
If they changes, I would recommend you edit your automation, delete the existing “when” trigger, and add a new trigger using the “Entity” type as your when… and pick one of those binary sensor entities as your trigger.
A bonus using entity trigger is that it is now a lot more easier to debug / trace.