From 4f061801fb2c7e3699ccd78cc1b99fed54aead0d Mon Sep 17 00:00:00 2001 From: cmcg Date: Sat, 26 Nov 2022 16:01:06 +0000 Subject: [PATCH] Improve battery_save mode. With thanks to @Ernest-burgess --- Sofar2mqtt/Sofar2mqtt.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sofar2mqtt/Sofar2mqtt.ino b/Sofar2mqtt/Sofar2mqtt.ino index d062121..9eb72bc 100644 --- a/Sofar2mqtt/Sofar2mqtt.ino +++ b/Sofar2mqtt/Sofar2mqtt.ino @@ -4,7 +4,7 @@ // The device name is used as the MQTT base topic. If you need more than one Sofar2mqtt on your network, give them unique names. const char* deviceName = "Sofar2mqtt"; -const char* version = "v2.1"; +const char* version = "v2.1.1"; #define WIFI_SSID "xxxxx" #define WIFI_PASSWORD "xxxxx" @@ -468,7 +468,7 @@ void batterySave() // Switch to auto when any power flows to the grid. // We leave a little wriggle room because once you start charging the battery, // gridPower should be floating just above or below zero. - if(p < 65535/2 || p > 65525) + if((p < 65535/2 || p > 65525) && (INVERTER_RUNNINGSTATE != discharging)) { //exporting to the grid if(!sendPassiveCmd(SOFAR_SLAVE_ID, SOFAR_FN_AUTO, 0, "bsave_auto"))