-
Notifications
You must be signed in to change notification settings - Fork 32
PV Charging (with powerfox)
--- This function is still under development ---
--- Not supported by wbecLan !!! ---
The most convenient way to support "PV Charging" with wbec is via systems like openWB, EVCC, Wallbox Steuerung, etc. But all these systems require additional HW like a Raspberry Pi, which have to be configured/maintained.
Goal is to support PV charging directly with wbec.
The main information needed for PV charging is the current power feed into the net ('Einspeisung'). When this is high enough, then charging shall be started. When it's too low, or when even power is consumed from the net, then charging shall stop.
A convenient way for making the power consumption/feed available is the powerfox poweropti.
The poweropti is simply attached to the optical interface of your power meter and delivers the consumption/feed into the cloud. Unfortunately a local solution is not possible.
wbec is able read the power via the powerfox API from the cloud and adjust the charging current based on these values.
So all you need for PV charging is
- Heidelberg Wallbox Energy Control
- wbec
- powerfox poweropti (incl. cloud service)
Communcication with the powerfox API is only possible via https/TLS. This is quite a challenge for the ESP8266 since it consumes a huge amount of the available RAM.
Therefore the following limitations had to be applied:
- only 1 wallbox can be supported
- the usual http://x.x.x.x/json should not be used, as it uses much heap, which might lead to heap fragmentation (-> no big block for TLS can be reserved anymore). An alternative is http://x.x.x.x/pv, which contains less, but still all relevant data
{
"box": {
"chgStat": 7,
"power": 6500,
"currLim": 95,
"resCode": "0"
},
"modbus": {
"millis": 235290
},
"pv": {
"mode": 2,
"watt": -23
}
}
- the bootlog needs to be reduced (from 5kB to 0,2kB)
- other function are available but should not be used: MQTT, RFID, go-e Emulation
Anyway, it's still possible that from time to time a reset of wbec will occur. This is not per se critical, because it will reboot within ~10s. Charging will simply continue during that time.
It can be, that a future modification of the API by powerfox breaks the functionality.
Set your account data in cfg.json, e.g.:
"cfgFoxUser":"[email protected]", "cfgFoxPass":"myPassword","cfgFoxDevId":"0123456789AB"
--> This activates reading the power every 30s from the powerfox API
Enable the PV charging based on powerfox by:
http://x.x.x.x/pv?pvMode=1 (0 to disable, 1 for Off, 2 for PV charging, 3 for Min+PV charging)
--> wbec will adapt now the current limit of the wallbox every 60s.
uint8_t cfgPvActive; // PV charging: Active (1) or inactive (0)
uint8_t cfgPvCycleTime; // =30 PV charging: cycle time (in seconds)
uint8_t cfgPvLimStart; // =61 PV charging: Target current needed for starting (in 0.1A), e.g. 61=6.1A
uint8_t cfgPvLimStop; // =50 PV charging: Target current to stop charging when below (in 0.1A)
uint8_t cfgPvPhFactor; // =69 PV charging: Power/Current factor, e.g. 69: 1A equals 690W at 3phases, 23: 1A equals 230W at 1phase
uint16_t cfgPvOffset; // =0 PV charging: Offset for the available power calculation (in W); can be used to assure that no/less current is consumed from net