Shelly Alert Killswitch is a simple service that allows you to turn off Shelly Plug S devices when an alert is triggered in Prometheus Alertmanager. This is useful for example when you have a fridge full of turtles, and you don't want them to freeze by accident.
CGO_ENABLED=0 go build -o shelly-alert-killswitch github.com/topi314/shelly-alert-killswitch
You can either run the binary directly or use the provided Docker image.
services:
shelly-alert-killswitch:
image: ghcr.io/topi314/shelly-alert-killswitch:master
container_name: shelly-alert-killswitch
restart: unless-stopped
volumes:
- ./config.toml:/var/lib/shelly-alert-killswitch/config.toml
ports:
- "8080:8080"
The exporters are configured via a TOML file. The default path is /var/lib/shelly-alert-killswitch/config.toml
but you can change it with the --config
flag.
[log]
level = "info"
format = "text"
add_source = false
[server]
listen_addr = ":80"
# Add your alertmanager webhook configurations here
#[[configs]]
#name = "example"
#endpoint = "/webhook"
#address = "hostname:port"
#insecure = true
#username = "user"
#password = "password"
#relay = 0
#labels = { name = "bla" }
Shelly Exporter is licensed under the Apache License 2.0.
Contributions are always welcome! Just open a pull request or discussion and I will take a look at it.