Skip to content

Commit

Permalink
Consider battery lifecycle costs Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
christian1980nrw authored Oct 5, 2023
1 parent 3bbae7f commit 0ab8d43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 0ab8d43

Please sign in to comment.