meichthys / uptime_kuma

Uptime Kuma HACS integration
110 stars 23 forks source link

Possibility to pause, start monitors #30

Closed dannymertens closed 1 year ago

dannymertens commented 1 year ago

Is it possible to add options to pause, start monitors or start maintenance windows with an automation, because now when I restart HA all monitors are down and this is off course not the case when you need to reboot for instance for an update, new sensor...

I know there is the maintenance option now in UK, so we can create a maintenance window there, but that is 2 steps and to be honest always forget to do this when rebooting my HA server when playing with it ;-)

I already have an automation to do this without the UK part and that works great, I'm only missing the UK part

`action:

I found this on the web, so it seems to be possible, but I'm not a developer and can't get it to work :-(

https://github.com/MedAziz11/Uptime-Kuma-Web-API

Home Assistant 2022.12.9 Supervisor 2022.12.1 Operating System 9.4 Frontend 20221213.1 - latest

Uptime Kuma Version: 1.19.2 Frontend Version: 1.19.2

Thanks in advance for looking into this!

Kind regards, D

meichthys commented 1 year ago

This integration does not offer services, It has read-only access to UptimeKuma. I'm not opposed to a pull request that adds this feature, but it's not something I plan to implement since there are other good alternatives.

You can also use the python API to interact with monitors: https://uptime-kuma-api.readthedocs.io/en/latest/api.html#uptime_kuma_api.UptimeKumaApi.pause_monitor

dannymertens commented 1 year ago

This integration does not offer services, It has read-only access to UptimeKuma. I'm not opposed to a pull request that adds this feature, but it's not something I plan to implement since there are other good alternatives.

You can also use the python API to interact with monitors: https://uptime-kuma-api.readthedocs.io/en/latest/api.html#uptime_kuma_api.UptimeKumaApi.pause_monitor

I off course respect your decision in this, but have to say that I'm also a bit disappointed because for us not dev gods this is all a little Chinese to be honest :-(

I had a look at the link you send and have no idea how to start with this, to be honest, :-( maybe you can send me and the other non devs in the right way how to use this?

Thanks for your quick reply and for the greet tool!

Kind regards, D

meichthys commented 1 year ago

I also understand where you're coming from as I'm a self-taught dev myself. We all have to put up with some slight annoyances when we depend on others to do the development work. For now, you can try to program a python script with the API i provided, or investigate Uptimekuma maintenance mode (https://github.com/louislam/uptime-kuma/wiki/Maintenance). I'm not sure what it does, but it may help. Sticky notes may help to remind you to enable maintenance mode (sometimes the non-tech solutions are the easiest ;)