Uptime-kuma to home-assistant

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.

Congrats! I like keeping things out of HA as well in terms of automation and logic. Glad to hear you got it working.

Is it possible to install this a custom component while we wait for it to be merged into core?

2 Likes

I suppose it would be possible to add it to HACS until it gets merged in. This would require some additional work (I’m not sure how much). If someone wants to submit a pull request on my repository, I’d be glad to take a look at it and merge it in so we can use it via HACS. It’s becoming a bit discouraging seeing how long it takes to get things merged into core…

2 Likes

Hey @rjchu, do you mind sharing your Apprise MQTT URL? been trying to get this working but it keeps giving an error every time I tried to test it.

URL I’m trying to use =
apprise -vvv -b mqtt://mqtt_username:[email protected]:1883/uptime_kuma

I can check when I get back in front of a computer but from memory it wasn’t nearly as complete as you’re listing. Have you tried it with just MQTT://your details here ? I’m pretty sure that’s all I had to do but I’ll check.

Do you mean without “apprise -vvv -b”? doesn’t work

I was following the guide below.

[Syntax](https://github.com/caronc/apprise/wiki/Notify_mqtt#syntax)
Valid syntax is as follows:

mqtt://{user}:{password}@{host}:{port}/{topic}

I even tried as below

[Example](https://github.com/caronc/apprise/wiki/Notify_mqtt#example)
# Assuming we're just running an MQTT Server locally on your box
# Assuming we want to post our message to the topic: `my/topic`
apprise -vvv -b "whatever-payload-want" "mqtt://localhost/my/topic"

Here’s what mine looks like…

Tried that as well, still error’s out.

Just came across the following in the logs.

Error: 2022-02-10 04:15:35,993 - ERROR - mqtt:// is disabled on this system.
2022-02-10 04:15:35,994 - ERROR - You must specify at least one server URL or populated configuration file.
Usage:  [OPTIONS] SERVER_URL [SERVER_URL2 [SERVER_URL3]]