Push Notifications now available!

hi,

I’m not sure If I have done sometign wrong, or if this is normal but my notifications are taking between 30 - 60 seconds to come through to my android app.

I have an automation (as I’m sure loads of others do) where when my doorbell is pressed it sends a notification to my phone. but it’s normally coming though after between 30 and 60 secs until today, it was 30 mins later…

any ideas?

this is the action part of my Automation

  action:
  - service: notify.all_mobiles
    data:
      title: "Doorbell"
      message: "There is somebody at the door"

I was struggeling this also, and found a solution.
(https://github.com/home-assistant/android/issues/594)
Add this to the action:

data:
          ttl: 0
          priority: high

ttl and priority are required to wake a sleeping device, without it the notification is meant to show up when the phone is unlocked.

3 Likes

Thanks for your reply,

Thats done it. It took a bit of looking up as the first times I tried it i got errors… but the following is the working Yaml for anyone else having the same issues

- service: notify.all_mobiles
  data:
    title: "Doorbell"
    message: "There is somebody at the door"
    data:
      ttl: 0
      priority: high

thank you :smiley:

We also have this documented on the companion site :slight_smile:

The clickAction doesn’t seem to work for Lovelace views and Lovelace dashboards in the app.

When i run the following script the companion app opens at the default dashboard and view. Even if i try it on the defualt dashboard with a another view it doesnt work.

I CAN navigate with clickAction to lovelace-cctv/cctv in a chrome browser on my phone if I use the bottom https link instead.

This must be a bug?

    - service: notify.mobile_app_stephen_s20
      data:
        title: Object Detected
        message: Front Door
        data:
          image: "https://xxxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa/local/doods/front_door_latestobject.jpg" 
          tag: Object Detected
          color: red
          # sticky: true
          clickAction: 'lovelace-cctv/cctv'
          channel: Object Detected
          ttl: 0
          priority: high

clickAction: 'https://xxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa/lovelace-cctv/cctv'

lovelace dashboards are not supported yet but views are you just need to use /lovelace/<path> where <path> is what you defined the tab name to be.

Yeah it works sometimes.

Does anyone experience this behaviour? Very annoying

its a bug in fullscreen mode

https://github.com/home-assistant/android/issues/597

1 Like

Is it going to be possible to send an image as an attachment rather than as a URL?

It looks like the /local URL path isn’t authenticated, so it would be possible for someone to grab the image if they know your DNS name and can guess the filename, which is a concern when dealing with camera snapshots.

I’m currently using a combination of OwnTracks for location and Pushover for notifications, and it would be great to consolidate everything into the official app. With Pushover I’m taking a snapshot to a directory that isn’t internet facing, and then sending it as an attachment.

1 Like

hello! I have notifications configured, but I would like to add time when it happened, is it possible? I want this time to be added as part of notification message. For example: “8:34. Bedroom window closed.”

as long as you can extract or note the time that it happened from either position sensor timestamp or sensor.time or some other thing then you can template the message (using sensor.time in the example below):

data_template:
  message: "{{ states('sensor.time') }} Bedroom window closed."

hi! thank you for your reply :slight_smile:

my code in notification config looks like this

data:
priority: high
sticky: ‘true’
ttl: 0
data_template:
message: ‘{{ states(’‘sensor.time’‘) }} Bedroom window closed.’

notification on my phone looks like this: “Unknown Bedroom window closed.”

I’m begginer in automations, so I guess that something is wrong in my code :frowning:

do you actually have the “sensor.time” in you config?

It’s not there by default. you have to set it up.

I forgot to write, but I add this to my configuration.yaml earlier, so it should work :frowning:

time_date:
sensor:
- platform: time_date
display_options:
- ‘time’
- ‘date’
- ‘date_time’
- ‘date_time_utc’
- ‘date_time_iso’
- ‘time_date’
- ‘time_utc’
- ‘beat’

Check your quotes to make sure they are the “normal” ones not the “fancy” type.

wrong type:

{{ states(’‘sensor.time’’) }} Bedroom window closed.

right type:

{{ states('sensor.time') }} Bedroom window closed.
1 Like

Also, you can check in Developer Tools -> Template that the template actually works.

Just installed the latest nightly version of the Android app. I have to say the push notifications have gotten a lot of love in this release, and the new features are great… HTML, grouping, persistence, timeouts, subjects, icons. Great work by the devs.

Details already in the documentation page: https://companion.home-assistant.io/docs/notifications/notifications-basic/#persistent-notification

2 Likes

New user to HA and got this set up even though it’s not obvious. Google and this community were the only solution. I hope it’ll become a first-class UI selection at some point.

One easy point of failure: The “data” is json so it means you have to have a comma between the elements. Commas aren’t necessary in yaml so it’s an easy thing to miss, especially if you cut/paste from the main section to “data”. There’s no error message; it just doesn’t work.

One addition would be nice is to set the “channel” of the alert. For those of us that set DND during sleeping hours, we can configure some channels to get through and wake us up while others are limited to more civilized hours.

– Brian

I’m liking the LED Color and notification timeouts, super handy.

2 Likes

You can already set channels for notifications: https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-channels

The one thing to take note of is that for some of the channel settings (led colour etc.) they are static and can’t be changed after you first send a notification to the channel. To change the settings, you will need to first send a remove channel notification, then resend with the new settings. This caught me out when trying to work out why the LED colours were always the same after changing in the data element.