So I have just added a sensor to my garage door, that bit works a treat, I am trying to send a notification to my mobile phone when the sensor is opened, I have tried writing the code myself which didn’t work, so I have tried some examples I found on the notify section of the documentation, and advise in other old threads, but all failed.
I have the Android app on my phone fully updated and I can see the sensor registered the change on the system.
So I tried the automation editor to get an example of code which produces the below, all failed, no errors in the logs, anyone have any pointers for me?
- id: "notification-when-garage-door-opened"
alias: notification when garage door opened
description: Send notification to android phone when garage front door is opened
mode: single
trigger:
- type: opened
platform: device
device_id: xxxxxx
entity_id: binary_sensor.openclose_10
domain: binary_sensor
action:
- device_id: xxxxxx
domain: mobile_app
type: notify
title: Home Assistant - Alert!
message: Garage front door opened
So that is one of the config’s I tried, I have just changed it to this:
- id: "notification-when-garage-door-opened"
alias: notification when garage door opened
description: Send notification to android phone when garage front door is opened
mode: single
trigger:
- type: opened
platform: device
device_id: ba323c3fd56323507557c8db7620638a
entity_id: binary_sensor.openclose_10
domain: binary_sensor
action:
- service: notify.notify
data:
message: "Garage front foor opened"
title: "Home Assistant - Alert"
But I still get no alert through to my phone even when I have the HA app running on my phone, wondering if it will be easier to just send a webhook through to IFTTT and that that show an alert, does the notification on the phone require the cloud services or anything to function? (I am connected to same network as HA at the time of doing the tests)
Just tried using the call service option to make sure it’s not something in my automation that’s not working and this doesn’t work either for some reason, wondering if it’s an issue with my phone but I am unsure how else I can test.
You sir are a legend, I checked there in the app and I saw all the notifications but they wasn’t appearing on the phone itself, did a bit of digging on the Android side and found the option to allow them, all working now, thanks for the help.