GUI Controller for PVOptimize
The project PVOptimize allows to flexibly manage how a PV rooftop installation charges an EV. However, the only way to make use of the flexibility is through a config.ini file.
This project provides a GUI to control relevant aspects from a Node-RED Dashboard. This GUI is an optional addition to PVOptimize. Some familiarity with Node-RED might be needed to install.
Improvements are welcome - please use Issues and Discussions in Git.
Table of contents generated with markdown-toc
The following depicts the basic architecture:
PVOptimizeis called every minute or so from eg. an appropriatecrontabentry- it returns a
pvstatus.jsonfile with three sectionsctrlstatus(controller status),pvstatus(PV system status) andwbstatus(wallbox status). (An additional memberpvcontrolis used to report current settings to the GUI, in case the GUI is re-started) - this contains sufficient information to initally configure the dashboard (slider lengths, default values, wallbox status to be displayed in rightmost State group)
- upon
Saveof the dashboard settings, agui_config.iniis created, which containsPVControlitems - on next call of
PVOptimize, (1) the default config fileconfig.iniis read, then (2) thegui_config.iniwhich overwrites values ofconfig.iniand thus makesPVOptimizebehave as configured in the dash board
The dashboard flow is basically generic to PVOptimize in version 2.0, except for a section marked as Hardy Barth specific (for the State group)
- The GUI is enabled in
config.iniby settingPVControl.enableGUI = 1. - The files
pvstatus.jsonandgui_config.iniare located in the directoryPVControl.guiPath, which defauts to~/.node-red/projects/PVControl
Since the above picture shows a loop, it is essential to understand how it is inialized:
- as soon as
PVControl.enableGUI = 1is set,PVOptimizestarts readinggui_control.iniand its values will overwrite corresponding values inconfig.iniin sectionPVControl. config.inicontains default values for slider ranges in the GUI:HardyBarth.I_chargeMinandHardyBarth.I_chargeMaxdetermine minimum and maximum of sliders in groupCharge ControlPVStorage.minSOCdetermines the lower end of the SOC sliders in groupSOC Control
- once
PVOptimizeruns (ie., every minute), these values are written intopvstatus.json - the Node-RED flow uses these values when deployed to setup the dashboard - hence if changes are needed, a re-deployment (flow re-start) is required
- once
Saveis pressed in the GUI, a newgui_control.iniis created, which is read by next call toPVOptimize. - Note that after every dashboard re-deployment (flow re-start), values will initialize as shown below, independent of actual values in
gui_contro.ini. Hence, one wants to save values immediatly, to gain consistency between display and behind-the-scenes activities.
To bootstrap the flow, default files for pvstatus.json and gui_config.ini are provided, but they may not fit every situation.
The GUI dashboard is called with <ip_of_host_running_GUI>:1880/ui from any browser and should bring up a panel similar to below:
It consists of three groups:
Charge ControlandSOC Controlcontrol the config items as described in PVOptimize documentationStatedisplays the current state of the wall box and a one-hour history of requested charge current
Charge Control contains two additional widgets, not described so far:
Delayed chargingdelays charging to the timeCharge Start(further subject of other constraints ofPVOptimize)Charge Startsets a starting time for enabling charging. For this to work,Start NOWobviously needs be disabled. Once the time is reached,Start NOWis enabled - in other words,Charge Startexpires after latest 24 hours.
The project requires Node-RED on the same host as PVOptimize is installed. It has been developped and seen running with the following versions and components:
| Software | Version |
|---|---|
| Node-RED | v 2.1.4 |
| node.js | 16.13.1 (or 17.3.0) |
| node-red-dashboard | 3.1.3 |
| node-red-contrib-projectdir | 2.0.5 |
Ensure that Node-RED is restarted at boot time as described here, using pm2
Node-RED has to be setup to handle projects and the project files reside in ~/node-red/projects/PVControl. This directory is also used to exchange information with PVOptimize as described above. Ensure that this project is deployed.
Once the flow is installed (and a manual trial run successfully executed), enable PVControl.enableGUI = 1 in config.ini of PVOptimize.
| Version | Date | Comment |
|---|---|---|
| 1.0 | January 2022 | Initial release |
| 1.1 | 2022-07-03 | minor bug-fixes, Start Now switch replaced with Delayed Charging |
The software controls PVOptimize. Errors in the GUI software can result in PVOptimize not to perform its desired task - as an example, the EV could remain un-charged in the morning. The author cannot be held liable for this or any other damage caused through the use of this software.
Use at your own risk!
Further warranty limitations are implied by the license. Note that PVOptimize contains a similar disclaimer.
Distributed under the terms of the GNU General Public License v3.

