Fast JS loading: https://web.archive.org/web/20200108190917/https://humanwhocodes.com/blog/2009/07/28/the-best-way-to-load-external-javascript/ aiohttp websockets: https://web.archive.org/web/20200108235147/https://aiohttp.readthedocs.io/en/stable/web_quickstart.html#websockets aiohttp static files: https://aiohttp.readthedocs.io/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static aiohttp client response: https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientResponse WebSocket JS specification: https://web.archive.org/web/20200109005314/https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket Lazy loading HighCharts: https://web.archive.org/web/20200109045439/https://www.highcharts.com/stock/demo/lazy-loading Dynamicly adding data: https://web.archive.org/web/20200109045531/https://www.highcharts.com/docs/working-with-data/live-data#2-api-methods uses afterSetExtremes event on xAxis to load data, which then set's it via setData Stacked area chart: https://web.archive.org/web/20200109053708/https://www.highcharts.com/demo/area-stacked Graphs ------ Note: HighCharts uses milliseconds since unix epoch for time stamps. (make an option to set the "zero" line, i.e. absolute, or consumption (i.e. net gen/consumption vs solar) Proposed graphs: Daily solar production total daily consumption total Per panel stacked production current production and consumption (5 minute intervals?) Grid Import/Export navigation: net import by hour or six hours Solar Panel navigation: solar production by hour Navigation data needs to be generated as part of the index generation. Maybe heatmap for solar panels Use removePoint and addPoint: https://web.archive.org/web/20200109083308/https://api.highcharts.com/class-reference/Highcharts.Series.html to add/remove the end null point and add points as they dynamically arrive WebSocket Definition -------------------- Messages to the websocket: q Quit Messages from the websocket: id description c Consumption -- current power consumed Sent for each update. units kW. ng Net Grid -- What the current power draw is from the grid (negative when sending power). Sent for each update. units kW. p Solar production -- current power produced by the solar panels in aggregate. Sent for each update. units kW. ov overview of data, contains gird, production and consumption data. following is JSON object One the first connection, the following messages/data will be sent: c, ng, p, ov The following will be sent as they are updated: c, ng, p