{"repo":"geerlingguy/shelly-plug-prometheus","free":true,"listed":false,"github":"https://github.com/geerlingguy/shelly-plug-prometheus","clone":"git clone https://github.com/geerlingguy/shelly-plug-prometheus.git","description":"Shelly Plug Prometheus exporter.","language":"PHP","stars":76,"topics":["shelly-plugs","prometheus","exporter"],"license":"MIT","category":"analytics","readme_excerpt":"Shelly Plug Prometheus Exporter I am a simple man. I have a Shelly Plug. I don't want to flash a different firmware on it just to get a Prometheus endpoint. Though I might do it someday if I'm not lazy. I want a Prometheus endpoint where I can scrape metrics for the Shelly Plug. So I built this. Could I use MQTT and use some sort of preconfigured broker / metrics generator? Yeah probably. But it's literally easier (if you don't already use MQTT and know how to set it up) to just write a little metrics scraper like this for a one-off. How to Use This thing is a PHP script that runs in a Docker container. That's it. You could even run the thing without using Docker, it doesn't care, it's just a PHP script. Set environment variables I recommend adding a basic HTTP auth username and password to your Shelly Plug to give at least minimal security. Run the PHP script inside Docker like so: Or you can set it up inside a docker-compose file like so: If you run the script outside of Docker, make sure you set the necessary environment variables. After it's running, test that it's working with curl : If you get an error, check your environment variables and make sure they're correct, and make sure the Docker container (and the host it's on) can access your Shelly Plug over HTTP! Optional environment variables If you have a second generation Shelly (i.e. a relay with a \"plus\" in the name) you will need to set SHELLY GENERATION=2 . For the first generation (non \"plus\") you can set that to ","default_branch":null,"files":null,"tree":[],"storefront":"/r/geerlingguy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/geerlingguy/shelly-plug-prometheus/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}