This project was created because there is no monitoring or alerting when inverters fail. I happened to be checking the sunpower app one day to show a friend and noticed I had an alert. Turns out an inverter had be down for who knows how long. As a bonus I can now track a bunch of metrics per inverter, which is not possible using their app.
Create an .env file or add the following to your env
DATADOG_API_KEY=api_key
DATADOG_APP_KEY=app_key
WEATHER_API_KEY=weather_api_key
WEATHER_LOCATION=zip_code,country_code
To run the deno project
$ deno task run
To run the deno project with a watcher
$ deno task dev
If you dont want to use a task for some reason
deno run --allow-net=192.168.0.68,api.datadoghq.com --allow-read=. --allow-env --watch main.ts
See the deno.jsonc
doc for all the commands.
$ sudo docker run -e "DATADOG_API_KEY=api_key" -e "DATADOG_APP_KEY=app_key" -e "WEATHER_API_KEY=weather_api_key" -d -e TZ=America/Chicago --name solar-monitor boxenofdonuts/solar-monitor:latest
version: "3.4"
services:
solar-monitor:
image: boxenofdonuts/solar-monitor:latest
container_name: solar-monitor
environment:
- PUID=1028 # optional
- PGID=65536 # optional
- TZ=America/Chicago # optional
- DATADOG_API_KEY=api_key
- DATADOG_APP_KEY=app_key
- WEATHER_API_KEY=weather_api_key
- WEATHER_LOCATION=98109,us
restart: unless-stopped
You can add the DENO_ENV=dev environment to get debug logs
Most of the original python was written because of the notes here.
The project automatically builds and pushes to docker hub, however it only uses the 'latest' tag. To tag run the following:
sudo docker build -t boxenofdonuts/solar-monitoring:1.0.3 .
// This will tag it as version 1.0.3