{"id":20033267,"url":"https://github.com/counterpillow/sunnesiite","last_synced_at":"2026-04-09T20:33:17.986Z","repository":{"id":142781957,"uuid":"570558519","full_name":"CounterPillow/sunnesiite","owner":"CounterPillow","description":"Inkplate 6COLOR solardata thing","archived":false,"fork":false,"pushed_at":"2022-12-25T15:53:57.000Z","size":31,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T20:02:17.677Z","etag":null,"topics":["arduino","esp32","esp32-arduino","flask","inkplate","victoriametrics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CounterPillow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-25T13:34:40.000Z","updated_at":"2022-12-05T14:18:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"c05e9270-ce5c-47f2-8ab6-e66b34736863","html_url":"https://github.com/CounterPillow/sunnesiite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CounterPillow/sunnesiite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CounterPillow%2Fsunnesiite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CounterPillow%2Fsunnesiite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CounterPillow%2Fsunnesiite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CounterPillow%2Fsunnesiite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CounterPillow","download_url":"https://codeload.github.com/CounterPillow/sunnesiite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CounterPillow%2Fsunnesiite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272900157,"owners_count":25012033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp32","esp32-arduino","flask","inkplate","victoriametrics"],"created_at":"2024-11-13T09:45:28.449Z","updated_at":"2026-04-09T20:33:17.935Z","avatar_url":"https://github.com/CounterPillow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sunnesiite\n\nA Python flask and Arduino project for receiving SolarAPI current data in the\nflask app, saving it into VictoriaMetrics, and then generating a PNG graph\nfrom a VictoriaMetrics query showing the daily solar production, and a\nInkplate 6COLOR Arduino sketch to fetch and display this PNG periodically\n\n\n## Usage\n\n### ESP32\n\nDrop a `config.h` with contents like this next to the `.ino`, replace the\nvalues with whatever is the case for you:\n\n```C\n#define WIFI_SSID \"YourSSID\"\n#define WIFI_PASSWORD \"hunter2\"\n#define EINK_URL \"http://example.example/eink.png\"\n#define API_URL \"http://example.example/untildaytime\"\n#define TIMEZONE \"Europe/Zurich\"\n```\n\nThe default refresh interval is every 4 minutes between 6:00 and 22:00.\n\nYou'll need to install `ArduinoJson` (not `Arduino_Json`!) from the libraries\nmanager.\n\n\n### Flask\n\nYou'll need Python 3.9 or later.\n\nCreate a virtualenv and activate it:\n\n```\n$ cd flask\n$ virtualenv venv\n$ source venv/bin/activate\n```\n\nThen install the package in editable mode:\n\n```\n$ pip install -e .\n```\n\nNext, you'll want to create an `instance/config.toml` in your flask directory,\nwith contents like:\n\n```toml\n# Keep this secret, keep this safe. Auto-generate it from a cryptographically\n# secure random source, e.g. pwgen -s 64 1\nSECRET_KEY = \"hunter2\"\n# Prefix for all the endpoint URLs\nSUNNESIITE_PREFIX = \"\"\n# This one needs to be the API key your solarapi push service on the inverter\n# uses, make it long, random and secret as well. Anyone who has it can fill\n# your time series database with data!\nSUNNESIITE_API_KEY = \"hunter2\"\n# URI for your VictoriaMetrics server, as-is if running locally with default\n# port\nSUNNESIITE_VM_URI = \"http://127.0.0.1:8428\"\n# Change for deployments to something better, see Flask-Caching documentation\nCACHE_TYPE = \"SimpleCache\"\nCACHE_DEFAULT_TIMEOUT = 120\n```\n\nYou can now run the app in development mode:\n\n```\n$ flask --app sunnesiite run --port yourport -h yourip\n```\n\nIf you don't specify `yourip` here, the development server will only listen to\nlocal connections, which means your Inkplate 6COLOR won't be able to fetch from\nit.\n\n\n#### Deploying To Production\n\nIf you want to deploy this in production, you'll need something like uwsgi.\n\nYou'll want to `pip install --no-binary pyuwsgi pyuwsgi` (see\n[Flask's documentation](https://flask.palletsprojects.com/en/latest/deploying/uwsgi/)\nfor oher ways) and then use the `wsgi` stub script to launch the app, like\nthis:\n\n```\n$ uwsgi --http-socket 127.0.0.1:8000 --master -p $(nproc) -w wsgi:app\n```\n\nIt's a good idea to make your services actual systemd services, so use an unit\nfile like this (adjust as appropriate):\n\n```\n[Unit]\nDescription=Sunnesiite Flask Component\nAfter=network.target\n\n[Service]\nDynamicUser=true\nLogsDirectory=sunnesiite-flask\nStateDirectory=sunnesiite-flask\n\nAmbientCapabilities=\nCapabilityBoundingSet=\nLockPersonality=true\nProtectControlGroups=true\nProtectKernelModules=true\nProtectKernelTunables=true\n\nUser=sunnesiite-flask\nGroup=sunnesiite-flask\nExecStart=/path/to/your/venv/bin/uwsgi --http-socket 127.0.0.1:8000 --master -p 8 -w wsgi:app -H /path/to/your/venv/\nWorkingDirectory=/path/to/sunnesiite/flask/\nEnvironment=\"PATH=/path/to/your/venv/bin\"\n\n[Install]\nWantedBy=multi-user.target\n```\n\nThen throw this behind e.g. an nginx reverse proxy.\n\nFor VictoriaMetrics, I'd make doubly sure it only listens to connections from\nlocalhost, unless you are explicitly trying to use a remote VictoriaMetrics\nserver and have auth stuff figured out (I don't).\n\nPlease note that Fronius inverters seemingly only support pushing through plain\ntext HTTP, not HTTPS. This will mean that your reverse proxy should accept\nconnections on plain text HTTP and serve the web app there, not try to redirect\nto HTTPS.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcounterpillow%2Fsunnesiite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcounterpillow%2Fsunnesiite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcounterpillow%2Fsunnesiite/lists"}