Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hoylabs/OpenDTU-OnBattery
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f960b059141780689564ebcc79c473f3557ff6f5
Choose a base ref
..
head repository: hoylabs/OpenDTU-OnBattery
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fa0ece949d1d1ecc3fc9fdeeb7a2db420da0a81c
Choose a head ref
Showing with 7 additions and 58 deletions.
  1. +5 −56 include/defaults.h
  2. +1 −1 src/Huawei_can.cpp
  3. +1 −1 src/PowerLimiter.cpp
61 changes: 5 additions & 56 deletions include/defaults.h
Original file line number Diff line number Diff line change
@@ -104,7 +104,11 @@

#define REACHABLE_THRESHOLD 2U

#define LED_BRIGHTNESS 100U

#define MAX_INVERTER_LIMIT 2250

// values specific to downstream project OpenDTU-OnBattery start here:
#define VEDIRECT_ENABLED false
#define VEDIRECT_VERBOSE_LOGGING false
#define VEDIRECT_UPDATESONLY true
@@ -115,15 +119,14 @@
#define POWERMETER_SDMBAUDRATE 9600
#define POWERMETER_SDMADDRESS 1


#define POWERLIMITER_ENABLED false
#define POWERLIMITER_SOLAR_PASSTHROUGH_ENABLED true
#define POWERLIMITER_SOLAR_PASSTHROUGH_LOSSES 3
#define POWERLIMITER_BATTERY_ALWAYS_USE_AT_NIGHT false
#define POWERLIMITER_INTERVAL 10
#define POWERLIMITER_IS_INVERTER_BEHIND_POWER_METER true
#define POWERLIMITER_IS_INVERTER_SOLAR_POWERED false
#define POWERLIMITER_INVERTER_ID 0
#define POWERLIMITER_INVERTER_ID 0ULL
#define POWERLIMITER_INVERTER_CHANNEL_ID 0
#define POWERLIMITER_TARGET_POWER_CONSUMPTION 0
#define POWERLIMITER_TARGET_POWER_CONSUMPTION_HYSTERESIS 0
@@ -153,57 +156,3 @@
#define HUAWEI_AUTO_POWER_UPPER_POWER_LIMIT 2000

#define VERBOSE_LOGGING true

#define LED_BRIGHTNESS 100U

#define MAX_INVERTER_LIMIT 2250
#define VEDIRECT_ENABLED false
#define VEDIRECT_VERBOSE_LOGGING false
#define VEDIRECT_UPDATESONLY true

#define POWERMETER_ENABLED false
#define POWERMETER_INTERVAL 10
#define POWERMETER_SOURCE 2
#define POWERMETER_SDMBAUDRATE 9600
#define POWERMETER_SDMADDRESS 1


#define POWERLIMITER_ENABLED false
#define POWERLIMITER_SOLAR_PASSTHROUGH_ENABLED true
#define POWERLIMITER_SOLAR_PASSTHROUGH_LOSSES 3
#define POWERLIMITER_BATTERY_DRAIN_STRATEGY 0
#define POWERLIMITER_INTERVAL 10
#define POWERLIMITER_IS_INVERTER_BEHIND_POWER_METER true
#define POWERLIMITER_INVERTER_ID 0
#define POWERLIMITER_INVERTER_CHANNEL_ID 0
#define POWERLIMITER_TARGET_POWER_CONSUMPTION 0
#define POWERLIMITER_TARGET_POWER_CONSUMPTION_HYSTERESIS 0
#define POWERLIMITER_LOWER_POWER_LIMIT 10
#define POWERLIMITER_UPPER_POWER_LIMIT 800
#define POWERLIMITER_BATTERY_SOC_START_THRESHOLD 80
#define POWERLIMITER_BATTERY_SOC_STOP_THRESHOLD 20
#define POWERLIMITER_VOLTAGE_START_THRESHOLD 50.0
#define POWERLIMITER_VOLTAGE_STOP_THRESHOLD 49.0
#define POWERLIMITER_VOLTAGE_LOAD_CORRECTION_FACTOR 0.001
#define POWERLIMITER_RESTART_HOUR -1
#define POWERLIMITER_FULL_SOLAR_PASSTHROUGH_SOC 100
#define POWERLIMITER_FULL_SOLAR_PASSTHROUGH_START_VOLTAGE 100.0
#define POWERLIMITER_FULL_SOLAR_PASSTHROUGH_STOP_VOLTAGE 100.0

#define BATTERY_ENABLED false
#define BATTERY_PROVIDER 0 // Pylontech CAN receiver
#define BATTERY_JKBMS_INTERFACE 0
#define BATTERY_JKBMS_POLLING_INTERVAL 5

#define HUAWEI_ENABLED false
#define HUAWEI_CAN_CONTROLLER_FREQUENCY 8000000UL
#define HUAWEI_AUTO_POWER_VOLTAGE_LIMIT 42.0
#define HUAWEI_AUTO_POWER_ENABLE_VOLTAGE_LIMIT 42.0
#define HUAWEI_AUTO_POWER_LOWER_POWER_LIMIT 150
#define HUAWEI_AUTO_POWER_UPPER_POWER_LIMIT 2000

#define VERBOSE_LOGGING true

#define LED_BRIGHTNESS 100U

#define MAX_INVERTER_LIMIT 2250
2 changes: 1 addition & 1 deletion src/Huawei_can.cpp
Original file line number Diff line number Diff line change
@@ -327,7 +327,7 @@ void HuaweiCanClass::loop()
std::shared_ptr<InverterAbstract> inverter =
Hoymiles.getInverterBySerial(config.PowerLimiter.InverterId);

if (inverter == nullptr) {
if (inverter == nullptr && config.PowerLimiter.InverterId < INV_MAX_COUNT) {
// we previously had an index saved as InverterId. fall back to the
// respective positional lookup if InverterId is not a known serial.
inverter = Hoymiles.getInverterByPos(config.PowerLimiter.InverterId);
2 changes: 1 addition & 1 deletion src/PowerLimiter.cpp
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ void PowerLimiterClass::loop()
std::shared_ptr<InverterAbstract> currentInverter =
Hoymiles.getInverterBySerial(config.PowerLimiter.InverterId);

if (currentInverter == nullptr) {
if (currentInverter == nullptr && config.PowerLimiter.InverterId < INV_MAX_COUNT) {
// we previously had an index saved as InverterId. fall back to the
// respective positional lookup if InverterId is not a known serial.
currentInverter = Hoymiles.getInverterByPos(config.PowerLimiter.InverterId);