picotron-wx
I made this weather dashboard for picotron as an intermediate step as I migrate all of my home automation & weather sensors to smaller microcontrollers & centralize data on home assistant. This iteration uses pirateweather.net as the weather source, but eventually I want to pull data and sensor values from my home assistant and other in-house sources and make some ridiculous 8 bit home automation dashboard thing. Screens can be added with new graphics & layouts pretty easily. I have a vision of a 8 bit home automation dashboard that looks and acts like a 90s video game, and I want the characters / environment to change with the weather conditions.
JSON Parsing
Initially I didn’t want to use JSON parsing and wrote a ruby service that writes weather data as a lua table to a file Picotron can read. I don’t hate this approach but decided for this initial release to simplify it and remove the ruby service. Picotron uses a Picotron Object Document format and compresses with lz4, so it’s not a bad way to move data around - I wrote a helper method to do this in ruby pretty cleanly and am currently using the same method to pass commands and information for a picotron version of winamp.
Image processing
My sprite making skills are pretty weak, so I wrote a utility to convert png images to picotron sprites in Ruby. Basically, it resizes and crops a source png and substitutes each pixel for the nearest picotron color, then applies the Stenberg dithering algorithm to the image. I’m pretty happy with the results so far.
Features
- Display current weather & forecast
- Updates every 5 minutes
- Customize & add new screens and layouts
Should you use it
Probably not, but here’s the p64.png file if you’re curious. You’ll need to install PyroChiliarch’s JSON library, load the image, then edit wx.lua with your pirateweather API key and location.