PowerLight: Difference between revisions

From RevSpace
Jump to navigation Jump to search
Line 43: Line 43:


To be implemented, this will probably run on my web page stofradar.nl.
To be implemented, this will probably run on my web page stofradar.nl.
Some REST-like resource like http://stofradar.nl:9001/power/latest
A REST-like resource like http://stofradar.nl:9001/energy/latest


Returns a JSON-structure like:
Returns a JSON-structure like:
<pre>
<pre>
{
{
   "time": 1656490664,
   "time": 1657057500,
   "total": 1600,
   "total": 9122,
   "energymix": [
   "mix": [
     { "id": "solar", "percent": 40, "color": "#FFFF00"},
     { "id": "solar", "percent": 0, "color": "#FFFF00"},
     { "id": "wind", "percent": 25, "color": "#0000FF"},
     { "id": "wind", "percent": 4, "color": "#0000FF"},
     { "id": "fossil", "percent": 25, "color": "#FF0000"},
     { "id": "fossil", "percent": 86, "color": "#FF0000"},
     { "id": "biomass", "percent": 5, "color": "#00FF00"},
     { "id": "nuclear", "percent": 5, "color": "#FF00FF"},
     { "id": "nuclear", "percent": 5, "color": "#FF00FF"}
     { "id": "other", "percent": 4, "color": "#444444"},
    { "id": "waste", "percent": 1, "color": "#444444"}
   ]
   ]
}
}

Revision as of 22:40, 5 July 2022

Project PowerLight
PowerLight.jpg
Show energy mix of dutch power generation as a pie chart on a LED ring
Status In progress
Contact bertrik
Last Update 2022-07-05

The concept

Draw the current power generation-mix as a kind of pie chart on a LED ring light, with colors representing a fraction of a specific power generation source.

For example:

  • blue: wind power
  • yellow: solar power see below
  • green: power from biomass see below
  • purple: power from nuclear
  • red: fossil
  • grey: other

Power generation data

This is a bit of a problem. There is no open data available with reasonably complete power generation fractions!

The solar power problem

In particular the solar power fraction is incomplete, but also the biomass figures are missing. See:

There is a model to estimate this fraction at https://api.netanders.io/, however you cannot use this API without a key (and you can't just get a key).

Hardware

Parts:

Software

The software consists of two parts:

  • backend part that collects the power generation data
  • light part that visualizes the power generation as fractions on a LED ring

Backend

Source code: https://github.com/bertrik/energymix-server

To be implemented, this will probably run on my web page stofradar.nl. A REST-like resource like http://stofradar.nl:9001/energy/latest

Returns a JSON-structure like:

{
  "time": 1657057500,
  "total": 9122,
  "mix": [
    { "id": "solar", "percent": 0, "color": "#FFFF00"},
    { "id": "wind", "percent": 4, "color": "#0000FF"},
    { "id": "fossil", "percent": 86, "color": "#FF0000"},
    { "id": "nuclear", "percent": 5, "color": "#FF00FF"},
    { "id": "other", "percent": 4, "color": "#444444"},
    { "id": "waste", "percent": 1, "color": "#444444"}
  ]
}
  • time is a unix time stamp in seconds, representing the end of the period that the power figures refer to
  • total is the total current electrical power usage, suitable for display (inside the ring for example), units is MW (megawatt)
  • energymix is an array of percentages along with their colors, to be displayed clockwise on the led ring, mandatory fields
    • percent
    • color

Light

Source code: https://github.com/bertrik/PowerLight