Issue with Notifications in Home Assistant

Hello,

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?

Thank you in advance for your help!

You seem to be saying when the motion sensor is triggered. Could you show us what the trigger is in the automation?

Please post code as preformatted text (cogwheel menu in the toolbar).

It looks like this:

alias: Motion sensor
description: ""
triggers:
  - type: no_motion
    device_id: 1df80b774787f1bee8e2fbe7dd74dfe1
    entity_id: 9c1c2c908e90d983fa22fac0c010541b
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: notify.mobile_app_sm_s901b
    metadata: {}
    data:
      message: Motion sensor
mode: single

1 Like

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.

You were right, here is the correct configuration

alias: Motion sensor
description: ""
triggers:
  - type: motion
    device_id: 1df80b774787f1bee8e2fbe7dd74dfe1
    entity_id: 9c1c2c908e90d983fa22fac0c010541b
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: notify.mobile_app_sm_s901b
    metadata: {}
    data:
      message: Motion sensor
mode: single

When I click on “Traces” I get “No traces found”

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.

My motion sensor is located just one meter away from the Zigbee dongle.
It cannot be the network causing the issue!

Well, it still could. If there is inference nearby, the chance of the sensor and the dongle not seeing each other is not zero. See this 30sec demo Demo: Zigbee interference caused by USB 3.0 and maybe ZigBee and WiFi Interference and Coexistence also for another type of common interference.

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?
image

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.

Hope this helps.