From 0ab8d43329996e0187696ac24094353a30cf0940 Mon Sep 17 00:00:00 2001 From: Christian Butterweck Date: Thu, 5 Oct 2023 22:54:39 +0200 Subject: [PATCH] Consider battery lifecycle costs Fix --- scripts/controller.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/controller.sh b/scripts/controller.sh index 3e7d43f..72f546d 100755 --- a/scripts/controller.sh +++ b/scripts/controller.sh @@ -882,7 +882,7 @@ if (( execute_charging == 1 && use_victron_charger == 1 )); then # Check if charging makes sense if (( economic_check == 1 )); then if [[ $highest_price_integer -ge $((current_price_integer+percent_of_current_price_integer+battery_lifecycle_costs_cent_per_kwh_integer)) ]]; then - echo "I: Difference between highest price and current price is greater than ${energy_loss_percent}%." | tee -a "$LOG_FILE" + echo "I: Highest price is lower than the sum of current price + ${energy_loss_percent}% energy loss for charging + battery lifecyle costs of $battery_lifecycle_costs_cent_per_kwh cent per KWh." | tee -a "$LOG_FILE" echo " Charging makes sense." | tee -a "$LOG_FILE" if [ 0 -lt $use_victron_charger ]; then $charger_command_turnon > /dev/null @@ -891,18 +891,18 @@ if (( economic_check == 1 )); then fi elif (( economic_check == 2 )); then if [[ $average_price_integer -ge $((current_price_integer+percent_of_current_price_integer+battery_lifecycle_costs_cent_per_kwh_integer)) ]]; then - echo "I: Difference between average price and current price is greater than ${energy_loss_percent}%." | tee -a "$LOG_FILE" + echo "I: Average price is lower than the sum of current price + ${energy_loss_percent}% energy loss for charging + battery lifecyle costs of $battery_lifecycle_costs_cent_per_kwh cent per KWh." | tee -a "$LOG_FILE" echo " Charging makes sense." | tee -a "$LOG_FILE" if [ 0 -lt $use_victron_charger ]; then $charger_command_turnon > /dev/null echo "I: Victron scheduled charging is ON. Battery SOC is at $SOC_percent %." | tee -a "$LOG_FILE" fi - fi else echo "I: Considering the charging losses of ${energy_loss_percent}% + battery lifecycle costs in relation to the actual purchase prices, the charging process is not worth to start." | tee -a "$LOG_FILE" echo " Charging makes no sense. Skipping charging." | tee -a "$LOG_FILE" fi fi +fi if (( execute_charging != 1 && use_victron_charger == 1 )); then echo "I: Victron scheduled charging is OFF. Battery SOC is at $SOC_percent %." | tee -a "$LOG_FILE"