Lately, I’ve setup Grafana and I love it.
I’d like to use the Alarm functionality for a few things in my HomeAssistant system, but I’d like Grafana to use HomeAssistant’s notification service to send out important notifications.
I struggled with passing the autharization bearer key in the post.
Because I have a ngnix server and I used that one to extend the header with the key.
This is great! I’m able to see the notifications on my phone - but they don’t seem to persist in Home Assistant. But I don’t seem to see any historical notifications in HA so it’s probably a different issue than yours. I do seem to get an exit status of 1 when a client timeout happens, though…
2021/10/26 14:01:30 {"title":"[Alerting] Test notification","ruleId":7876552415975495364,"ruleName":"Test notification","state":"alerting","evalMatches":[{"value":100,"metric":"High value","tags":null},{"value":200,"metric":"Higher Value","tags":null}],"orgId":0,"dashboardId":1,"panelId":1,"tags":{},"ruleUrl":"http://grafana.tylephony.com/","imageUrl":"https://grafana.com/assets/img/blog/mixed_styles.png","message":"Someone is testing the alert notification within Grafana."}
2021/10/26 14:01:35 Post "https://hass.tylephony.com:8123/api/services/notify/notify": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
exit status 1
Should I review over on your Github? Thanks again!
Looks like grafana added support for MQTT notifications. After configuring that, I created a quick automation to set up persistent notifications and send the alarms to my phone. This script also includes clearing those notifications: