Solar Monitor has been created because i wanted to build by OWN UI for the "Fronius Wechselrichter"
This repo holds two main components that are neccessary
- the web folder in which a simple script builds up the website
- a basic flask Api which bypasses the CORS Policy and functions like a proxy
- Visualize how much power is used and generated in Realtime
- Responsive Webview optimized for Safari on Mobile
- Starting Animation
- Faster reloading the difference of the powers
- simple and clean look
- The animation is created by justanotherguy using the lottiejs library
- Font is "Poppins" by Google https://fonts.google.com/specimen/Poppins
- Rest of the Code is written in plain js
With fetch("http://yourflaskserverip:5000/solar")
the solar information is requested via the flask server proxy
The flask proxy simply requests the fronius power inverter data by using the built in api:
def get_solar():
website = requests.get(url='http://yourfroniusip/solar_api/v1/GetPowerFlowRealtimeData.fcgi')
return website.json()
In most cases power inverters are connected to the Network.
So you can follow these steps to get the realtime data:
- request the root of the power inverter in your browser (e.g. "https://192.168.178.5/")
- open dev-tools -> Network
- scan the files which are loaded in regular intervals
- open the request and copy the link after
Request URL
For more information about CORS in combination with flask, feel free to visit: https://flask-cors.readthedocs.io/en/latest/