Michael Zazon

Reliability & operations · Build log

Every notification my house sends goes through one relay

I routed every alert my house sends through one apprise relay that routes by urgency and logs each one to Loki.

When I started, I wondered if I could see every house notification being sent from the sender to my phone, but nothing I had could answer that. I had more than a dozen different things sending me alerts (Grafana rules on my metrics database, Home Assistant, my router, disk and RAID checks, my UPS, Uptime Kuma, Backrest), and they were all calling Pushover in different ways, and none of them were logging what they were sending.

I could either set up a Pushover Open Client mirror (which would log everything that made it to my phone, but not change anything on the senders’ side) or route all alerts through an apprise relay, which I already had running on my home server for autoheal’s container alerts. I went with the relay because, in addition to logging, it can also route messages based on their urgency and fan them out to multiple destinations. The relay is called apprise-api and is a small web server that wraps the apprise library.

I decided that everything needs to go through the relay (no direct-to-Pushover fallback, not even for Home Assistant and the router) and spent about a day cutting over. A search through my repos turned up most things that talked to Pushover, but a sweep of my running services turned up 3 that I didn’t know about in git (including Uptime Kuma and Backrest). Turns out my repo wasn’t the complete picture of everything that talked to Pushover after all.

My favorite part is the routing: the sender chooses a relay key based on the urgency of the message. I have keys for everyday homelab, critical (Pushover’s siren sound), low-priority (Grafana query failures), emergency, and a separate life-safety key for Home Assistant. Each key maps to Pushover (at the right priority), a Slack channel, and a log. Since my router doesn’t have bash or jq, I wrote a little BusyBox shell helper.

I mapped the notify calls from Home Assistant to keys based on priority. I approved the switch with a “yes to both” and the emergency test page that followed made it to my phone, quotes and line breaks intact.

House alert senders flowing through one relay to Pushover, Slack and Loki Grafana Home Assistant Router scripts Disk and UPS Uptime Kuma Backrest And more Home server apprise relay keys by urgency Pushover Slack Loki log Triage agent Server down: nothing delivered

Each alert gets sent to Loki as a single line of JSON containing the title and message, tagged with the key that was used to send it. This answers my original question.. I can use Grafana Explore on the alerts log to see every notification the house has sent me, in order.

Alert lines in Grafana Explore, each with its relay key, title and message

The log also feeds my monitoring agent. Every 15 min, the host check looks at the log first, so it only wakes the agent if there’s a new alert that the agent didn’t send itself. A quiet house costs nothing. The agent decides whether the alert is just noise or worth a look, but it will never page anyone.

The tradeoff is that my home server is now the single point of failure for alerts. If it’s down, nothing gets delivered, including the router’s page that the server is down. Apprise drops a failed send without retrying, and network-problem alerts are the most likely to fail this way. I have one status check outside the relay that watches the relay.

Next up is a retry queue in front of Pushover. So if a send fails because of a network drop, it’ll just wait and then go out when the connection comes back up instead of being lost.