0.1.9 • Published 5 years ago

froniuswebcomponent v0.1.9

Weekly downloads
9
License
MIT
Repository
-
Last release
5 years ago

Built With Stencil

Fronweb

This is a web component that displays real-time and archive data from a Fronius inverter. It connects directly to the Fronius inverter API locally rather than via solar web. It is intended to run on a small screen such as a Raspberry Pi gadget. It assumes there is a smart meter installed. It's also not going to work right if your smart meter is on demand rather than supply. Shrug, I'm sure you can figure it out.

Froniusweb screenshot

Fronius REST API is seriously hot garbage. The best I can say is at least there is an API and it generally works. Requests take many seconds to complete with the exception of /solar_api/v1/GetPowerFlowRealtimeData.fcgi, which only takes tens of milliseconds. It seems this fast cgi was some afterthought second process?

Seriously, how hard would it be to realise that all we want is a small set of power data, both instaneous and day accumulated, but no, each API gives you mountains of shit you don't want, most of which you have to guess because they're not explained in the docs, and you're forced to make multiple slow API calls just to get five or six items of data. What's wrong with these guys?

This code makes sparing use of slower API commands, particularly so for the historical data for the graphs which is done on start up and every 15 minutes.

Note that REST requests need CORS enabled end-points to work from web clients. The Fronius inverter doesn't do this naturally, not even whitelisting the local LAN, so it will need to be used in conjunction with a CORS proxy as as https://github.com/Rob--W/cors-anywhere.

You must pass the API URL to the component via the apiurl property. With CORS anywhere proxy, this might look something like this where the first IP/port is the CORS proxy and the second is the address of the inverter on the local network.

<fronweb-component apiurl="http://192.168.1.250:8157/http://192.168.1.240"></fronweb-component>

Methods

pause() --- will pause the updates, and stop data fetching resume() --- resumes data updates

Using this component

Script tag

  • Put a script tag similar to this <script src='https://unpkg.com/froniuswebcomponent/dist/fronweb.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Node Modules

  • Run npm install froniuswebcomponent --save
  • Put a script tag similar to this <script src='node_modules/froniuswebcomponent/dist/fronweb.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc b
0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago