I’ve been looking for a self hosted push notification platform for what seems like forever. Now I think I’ve finally found it: Gotify. The good news is it can be integrated easily with HASS via the REST notification platform.
I’ve written up all the details on my blog (it’s a bit long!):
I came across this on your website while reading about the sound system.
This platform is fantastic. Installed it as per your guide and notifications are really instantaneous.
Do share if you work out how to make actionable notifications.
Yeah, the notifications are really quick, I also get simultaneous notifications on desktop and mobile. I’ve not had chance to get back to looking into actionable notifications yet, but I’ll be sure to write it up when I do.
I just tried your code and I receive the notifications, but they don’t look any different from the normal ones. To be honest I’m not exactly sure what the priority is supposed to do!
I’m not getting notifications on the android app. Messages are delivered, but according to the docs (https://github.com/gotify/android) one must specify priority above 0 for system phone notifications (eg “Icon in notification bar”).
@robconnolly are you getting actual phone notifications without specifying priority?
Yes, I get system notifications. Have you checked the notification settings for the gotify app? It’s possible your notifications are being silenced by the system.
I don’t actually see anything related to notifications in the app itself… I ended up hardcoding the priority and create a few different services for various priority levels.
The notification settings for each app are in the device settings, under Apps->Gotify->Notifications for me. Looks like there are some settings in there for different priority levels, but all mine are just set to “Sound”.
Yep, exactly. Let me know if these correspond to the priority levels from Gotify. I haven’t had a chance to play around with it yet, but I can imagine it would be useful.
I got stuck exactly at the same point.
Thanks for your hard coded workaround solution ! (a lot better than nothing)
I believe there is a way to define the priority as an added notification parameter using the data: syntax
in the documentation it is mentioned:
data
(string)(Optional)
Dictionary of extra parameters to send to the resource.
…but I failed to “guess” the correct way to do it.
did you ever solved it?
I’m curious as well if there has been support added to specify priority in each request. I’ve added message_param_name and title_param_name; those work. I assumed priority_param_name would work as well but it does not.
notify:
name: Gotify
platform: rest
method: POST
resource: “https://server”
message_param_name: message
title_param_name: title
- name: gotify
platform: rest
resource: http://tasks.gotify_app/message
method: POST
headers:
X-Gotify-Key: !secret gotify_hass
message_param_name: message
title_param_name: title
target_param_name: priority
Usage:
title: title
message: message
target: 8
Target is your priority. Enjoy
Note: that your method must be POST and not POST_JSON. As POST_JSON will tell Gotify that your priority value is a string and you will get an error. Setting it to POST lets Gotify decode a Form Post submission and interpret as a number.
Thanks for this solution! However I discovered that using the POST method doesn’t let me automatically download images anymore. For my camera images when someone approaches my house this is a must have.
Would you know any solution to this, or is it just the limitation of POST?