I’ve been using my weatherflow and a few other of my smart home devices to learn something about python. So, please be kind if you find my code inefficient. Still, I thought some might find some interest in how I grab the weatherflow data and parse out the REST api results. I opted to use REST instead of websockets because I don’t think an always-connected flow of data.
This program pulls data from my charge controller hooked up to a solar array. Every minute, it polls for data from the charge controller. Then, it grabs the weatherflow data (solar radiation, uv index and brightness). I log all these values to a MariaDB database.
The polling program runs on a Raspberry Pi 4. The MariaDB is located on a Zorin Linux laptop.
My code will show a simple way to parse out the json without getting overly complex.
Any suggestions for improving what I have here are welcome!