Ignore voltages above 100V

This commit is contained in:
Ollo 2022-08-25 18:40:41 +02:00
parent e820301490
commit 195d3d3c1b
3 changed files with 8 additions and 2 deletions

View File

@ -110,6 +110,7 @@
#define MAX_PLANTS 7
#define SOLAR_CHARGE_MIN_VOLTAGE 7 /**< Sun is rising (morning detected) */
#define SOLAR_CHARGE_MAX_VOLTAGE 9 /**< Sun is shining (noon) */
#define SOLAR_MAX_VOLTAGE_POSSIBLE 100 /**< higher values are treated as not connected sensor */
#define VOLT_MAX_BATT 4.2f
#define MAX_CONFIG_SETTING_ITEMS 100 /**< Parameter, that can be configured in Homie */

View File

@ -38,3 +38,4 @@
#define LOG_SLEEP_CYCLE 102
#define LOG_MISSING_PUMP -4
#define LOG_BOOT_ERROR_DETECTION 10000
#define LOG_SOLAR_CHARGER_MISSING 300

View File

@ -1063,7 +1063,11 @@ void plantcontrol()
sensorLipo.setProperty("ICA").send(String(battery.getICA()));
sensorLipo.setProperty("DCA").send(String(battery.getDCA()));
sensorLipo.setProperty("CCA").send(String(battery.getCCA()));
if (mSolarVoltage < SOLAR_MAX_VOLTAGE_POSSIBLE) {
sensorSolar.setProperty("volt").send(String(mSolarVoltage));
} else {
log(LOG_LEVEL_INFO, String("Ignore unrealistc sun voltage" + String(mSolarVoltage) +"V"), LOG_SOLAR_CHARGER_MISSING);
}
sensorTemp.setProperty(TEMPERATUR_SENSOR_CHIP).send(String(chipTemp));
}
else