Android actionable notifications

All set up and working now with the HANotify APK. I tried first with your fork of the Home Assist app, but it did not generate a fcm-android-registrations.conf file.

After success with HANotify, I tried again with the Home Assist fork. This time, the APK installation ended with the error “App not installed”. This occurred both with and without HANotify also installed.

Is anyone using this to launch an Android app from the notification. If so, which method are you using to trigger the app launch after receiving the callback on the HA server.

@Crewski Thanks for your great work on this. It’s exactly what I need for a smart doorbell project.

Glad at least one is working!

If you want to try the HomeAssist app again, go ahead an uninstall whatever version of HomeAssist that may be there. Then install my version from the links given. Go to settings where it says Push Notifications. Try to toggle it a few times…ending with it being checked.

When you uncheck it, there will be a toast message that’ll either say “Registration not found” or “Push notification subscriber unregistered”. When you toggle it back on you should see a toast that says “Push notification subscriber registered”.

I can’t actually (re)install the HANotify version of Home Assist from the Drive link anymore. Attempting to install it results in an “App Not Installed” error at the end of the Package Installer wizard. Installation did work the first time around (when notifications didn’t work) but hasn’t worked since I uninstalled it. No other version of Home Assist is installed.

Pixel 2 XL
Android 9.0.0

Thanks.

I get the same thing, Not Installed. Although you did get it to install once, It never would install for me. I have every external sources options on my phone enabled.

I tried again this morning to install the forked version of HomeAssist, and for not obvious reason, it worked this time. I did power cycle my phone prior to attempting the install, but I’d also tried that a couple of times yesterday when the install failed. Notifications are now working with HomeAssist.

@Crewski Do you plan to continue to develop HANotify on its own or only the HomeAssist fork? Thanks again. Fantastic work.

Ha…first rule of IT, turn it off and turn it back on!

I’d like to make a more complete app with notifications, widgets, and location tracking, but can’t decide if I should just use the web UI of home assistant or try to develop a websocket version similar to HomeAssist.

I am very curious what the project below will yield. Chances are this guy is way better at this stuff than I am.

I’m totally fine with an app that just takes care of the actionable notifications, and does nothing else.
If I want to have more functionality I can install another app.

3 Likes

I agree with that. I like it when an app is aimed at doing one thing and doing that thing really well. Building some fancy stuff around it might just bring some bugs along.

It Will be good to have an app for home assistant that have themes, widgets , notifications, tracker, Will be awasome

If the firebase key can be configured without recompiling the apk, i would say you should put it in the Play store & see if you can get this as a standard component.

I have been looking since the begining to have actionable notifications withouting opening HA to the outside world (using VPN).

I am struggling to get the right config working, can you check what I am doing wrongly?

  - service: notify.android
    data_template:
      message: '{{ trigger.to_state.name }} - {{now().strftime("%H:%M:%S")}}'
      title: De-Activated
      data:
        icon https://xxxxx
        color #08B80D
        tag yyyy

I like this project very much but don’t like the fact using Google … is there a way using this without cloud services and Google ?

@elRadix what kind of errors are you getting in your log? The first thing I notice is that icon, color, and tag do not have a colon after them (not sure if its just a typo or not). Should be

  - service: notify.android
    data_template:
      message: '{{ trigger.to_state.name }} - {{now().strftime("%H:%M:%S")}}'
      title: De-Activated
      data:
        icon: https://xxxxx
        color: #08B80D
        tag: yyyy

If that doesn’t work, maybe try wrapping things in double quotes " instead of single quotes '. I don’t know what the difference is in yaml though.

@thundergreen The notification is sent via Firebase, which is google. I’m sure you can accomplish the same thing via other push notification platforms, but I never looked into that as I’m comfortable with using google. The “actionable” part doesn’t involve Google at all because it is sent back as a POST request.

Thanks for your work on this.
I have installed the HANotify.apk on my phone without issues, is properly registered and is running.
I installed fcm-android.py on my Hass.io ver 75.1 without issues. No errors when restarting Hass.
But when I try to send a simple notification eg:

  • service: notify.android
    data:
    message: Garage Door notification

I get the following error:

2018-09-20 10:06:22 ERROR (SyncWorker_19) [custom_components.notify.fcm-android] Error sending message. Response 400: Bad Request:
NoneType: None

Any ideas?
thanks so much for this work.

Update: After about 5 minutes it started to work without errors. Weird, but thanks again for you work.

@fantangelo That’s odd. My first thought was that the fcm_android_registrations.conf file wasn’t created or there wasn’t anything in it…but that doesn’t explain why all the sudden it would start working.

i have 2 devices (unnamed device and unnamed device_2), how i can send notifications to specific device? (i.e., to unnamed device_2 only)?

Thanks for this app, It’s just what I needed… Two questions

  1. Is it possible to add time into notification? ie Anna arrived home (02:42)
  2. Is it possible to send different notifications to different phones?

Thanks again
Cheers

Hey guys, sorry I didn’t add the “target” attribute to the table in the OP…it’s in there now. All you have to do is add

target: unnamed device_2

to your notification. This goes at the root, along with title and message.

@Shayne_Bergan I handled the timestamps on the Home Assistant side so that I know when the notification was actually called, not when it’s received…though these two time are typically very close. I use

message: "Anna is home at {{ now().strftime('%I:%M %p') }}."

1 Like

@Crewski That worked perfectly, Thanks heaps.

Is it correct to have configuration.yaml set like:

notify:
  - name: android
    platform: fcm-android

and not

notify:
  - platform: fcm-android
    name: android
  1. I copied fcm-android.py to \config\custom_components\notify\fcm-android.py
  2. Installed https://drive.google.com/open?id=17q0VR3T96k0SyQYujfpbNipAI33jdEYZ
  3. Hass is installed on Docker on Synology and I’m using Synologys nginx to make it available to the internet

When trying to send notification like proposed here https://www.home-assistant.io/components/notify.html5/#testing I don’t get anything.

notify.android does not show under services.

What am I missing?

Thanks for your help.
Best regards, Marko