Uptime-kuma to home-assistant

Does anyone use this cool project? I believe someone needs to make an integration to home assistant. It will surely replace uptime-robot.

6 Likes

I am also interested! :smiley:

Iā€™ve seen there is actually such integration already using something called Apprise:

In Uptime Kuma, select notification type: Apprise (it will show if you are running the docker version), then see this: https://github.com/caronc/apprise/wiki/Notify_homeassistant

I just set this up and itā€™s technically working but the notifications only show in the UI and app in the notifications section and not as a push notification from home assistant as I would have expected (and wanted). I was searching to see if there was an option or flag I missed which is how I stumbled across this thread.

Anyone get notifications from Uptime Kuma to HA and are able to have HA send the push notification?

FYI - Iā€™m working on a native home-assistant integration for this :slight_smile:
Iā€™m not sure when it will be finished, but i do have a working prototype - i just need to clean it up and make it acceptable to the core devs who will need to approve my pull request.
Iā€™m guessing it will be included in 2021.12

3 Likes

any hints on how it will look like?

Iā€™m using the ā€œwebhook notificationā€ from Uptime Kuma. Works perfect and since an automation is triggered, this automation can do whatever Homassistant is able to doā€¦

1 Like

Iā€™m not very familiar with using webhooks in this way. Does it create an entity for each Uptime Kuma monitor? If so, could you provide some details on how to setup webhooks in homeassistant in order to expose an entity for each uptimekuma monitor?

1 Like

Each monitor in your Uptime Kuma instance will be exposed in Home Assistant as a Binary Sensor entity.
Using a lovelace ā€˜history graph cardā€™ you can easily get a similar view that you would have from the /stats page in Uptime Kuma:

1 Like

No, no entity will be created. Itā€™s just a trigger for an automation. If you want to know more about webhooks in Home Assistant, these videos from SlackerLabs provide very solid infos about it:
https://www.youtube.com/watch?v=xkUhuYaRVJgs
https://www.youtube.com/watch?v=ZXTI286DwYQ

1 Like

Gotcha, Thanks :+1:
Webhook triggers are pretty neat - I hope they continue to be adopted by more services.

I like itā€¦ hope to see it soon on HA

1 Like

:+1: Iā€™ll be submitting the merge request in the next day or so, so hopefully weā€™ll have it for 2021-12

1 Like
3 Likes

Nice work! I ended up using the built-in MQTT functionality in Uptime Kuma to get data/state into HA so that I can then send iOS push notifications to my phone when things go down/up. Seems to be working very well so far. I donā€™t really have a need for the GUI though Kumaā€™s is pretty clean. The notifications are nice though as I have monitors for HA that looks for text in the web front end, services via monitoring service ports for things like influxdb, MQTT, etc. very nice little package. Hereā€™s a little sample I snapped before I finished the logic to remove the trailing square brackets from what Kuma publishes over MQTT.

How were you able to use MQTT to send the states to HA?, I donā€™t see MQTT as an option for notifications.

Use the apprise notification method and enter a MQTT endpoint. See the GitHub docs for the format. Iā€™m not in front of a console at the moment.

any chance you could explain this a little more when you get a chance ? im struggling with this right now, was this auto discovered in HA or did you have to manually create sensors for these?

I donā€™t do anything with it in HA, itā€™s all external. Kuma to MQTT via Apprise and then MQTT to NodeRed which calls the HA notify service to send notifications to my phone. If you wanted the data in HA then yes, youā€™d setup MQTT binary sensors. Re Apprise, supposedly itā€™s built into Docker if youā€™re using the Docker install of Kuma but my Kuma and Apprise are installed on a VM, not Docker so that might differ from your install.

I set this up today. My notification flow is slightly different to @rjchu as I havenā€™t deployed apprise (yet). Instead I used the webhooks option in kuma.

You can automate off this using the standard home assistant automations or, in my case I used the nodered companion component - GitHub - zachowj/hass-node-red: Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core.

From there I output to the android notification service on my phone.