{"id":16975189,"url":"https://github.com/jonkpirateboy/snap","last_synced_at":"2026-05-21T05:31:33.518Z","repository":{"id":98099961,"uuid":"453388854","full_name":"jonkpirateboy/Snap","owner":"jonkpirateboy","description":"Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the cost of the day.","archived":false,"fork":false,"pushed_at":"2024-01-06T10:45:59.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T15:27:02.403Z","etag":null,"topics":["led","raspberry-pi","tibber"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonkpirateboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-29T12:18:18.000Z","updated_at":"2022-09-08T07:23:20.000Z","dependencies_parsed_at":"2025-01-26T15:37:09.174Z","dependency_job_id":null,"html_url":"https://github.com/jonkpirateboy/Snap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkpirateboy%2FSnap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkpirateboy%2FSnap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkpirateboy%2FSnap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkpirateboy%2FSnap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonkpirateboy","download_url":"https://codeload.github.com/jonkpirateboy/Snap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244868035,"owners_count":20523581,"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","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":["led","raspberry-pi","tibber"],"created_at":"2024-10-14T01:09:26.799Z","updated_at":"2026-05-21T05:31:33.513Z","avatar_url":"https://github.com/jonkpirateboy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snap\nCode and build instructions for [Snap](https://www.instagram.com/p/CVXhBlCs5un/), a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the cost of the day.\n\nUPDATE: Added a [Wiz bulb](https://www.wizconnected.com/en-ca/products/bulbs) to show the eneryg cost too. Simply change the variable `ip` to the ip address of your bulb. If you don't want to use the Wiz, simply set `wiz` to `False`.\n\nUPDATE: Moved all settings to the snap-settings.json file.\n\nUPDATE: Added a web UI for checking the price and make all settings.\n\nLike this.\n1. Only Green = Very cheap\n2. Green \u0026 Orange = Cheap\n3. Only Orange = Ok\n4. Orange \u0026 Red = Expensive\n5. Only Red = Very expensive\n\n## Setup\n\nInstall [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) on a Raspberry Pi\n\n### LED\n\nBuy some [LEDs, wires and a breadboard](https://www.instagram.com/p/CU1-_8KsBTz/). I only used the [breadboard](https://www.instagram.com/p/CU7GH0gMow4/) while building.\n\nConnect the LEDs to the GPIO pins of your liking, you can see which one I used in my script.\n\n### Wiz\n\nInstall pip:\n\n`sudo apt install python3-pip`\n\nInstall [pywizlight](https://github.com/sbidy/pywizlight)\n\n`pip install pywizlight`\n\n### The setup\n\nDownload the files and folders and put them in your home folder, for example /home/pi/.\n\nGo to [Tibber](https://developer.tibber.com/settings/accesstoken) and get your Access Token.\n\nEdit the downloaded settings file, and change YOUR-TOKEN-HERE to your Access Token.\n\nIf you have more than one home, change:\n```\n\"home_index\": 0\n```\nto reflect which home you are pulling data from. To see which home you want to use, go to [Tibbers Api Explorer](https://developer.tibber.com/explorer) and Load your personal token and simply run \"Homes\" in the drop down.\n\nChange these settings in the settings file if you don't want to use the leds or a wiz light:\n```\n\"led\": true,\n\"wiz\": true,\n```\n\nIf you are using a wiz-light, make sure to change the host name and ip for it.\n\nYou can also change the breakpoints in the settings file too if you wish.\n\nIf you want the script to start automatically when the pi is booted run this command:\n\n`crontab -e`\n\nAnswer `1`\n\nAdd this to the file:\n\n`@reboot /usr/bin/python3 /home/snap/snap_runner.py \u0026`\n\nRestart your Pi and press watch the lights.\n\n### Settings in a web UI\n\n![Screenshot of the web UI](assets/screenshot.jpg)\n\nIf you want to have a web UI for the price and settings run this command:\n\n`crontab -e`\n\nAnswer `1`\n\nAdd this to the file:\n\n`@reboot /bin/sleep 10; /usr/bin/python3 /home/snap/snap-settings-web-ui.py`\n\nAnd also: \n\n`sudo visudo`\n\nAnd then add this at the end of the file:\n\n`pi ALL=(ALL) NOPASSWD: /sbin/reboot`\n\nAfter that you can browse to http://YOUR-HOST:5000 and check how expensive the electricyty is at the moment and also the rest of the day, the you can also make the settings for the json file in a simple form.\n\n## Learn and experiment\n\nIf you want to change your script [Tibber has an excellent playground here](https://developer.tibber.com/explorer).\n\nAnd here you can read more about [GraphQL Concepts](https://developer.tibber.com/docs/guides/graphql-concepts).\n\nThe price chard is built with [Chart.js](https://www.chartjs.org/).\n\nThat's basically all I used for reference making this project. Good luck!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonkpirateboy%2Fsnap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonkpirateboy%2Fsnap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonkpirateboy%2Fsnap/lists"}