Skip to content

Commit

Permalink
Update controller.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
christian1980nrw authored Jan 31, 2024
1 parent 6944df0 commit 8506f3f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/controller.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="2.4.12"
VERSION="2.4.13"

set -e

Expand Down Expand Up @@ -763,18 +763,25 @@ manage_discharging() {
fi
}

# Function to check abort conditions and log a message
# Functions to check abort conditions and log a message
check_abort_condition() {
local condition_result=$1
local log_message=$2

if ((condition_result)); then
log_message "I: $log_message Abort and turn ESS on to disable Spotmaktet-Switcher."
execute_charging=0
execute_discharging=1
execute_switchablesockets_on=0
fi
}
check_ess_abort_condition() {
local condition_result=$1
local log_message=$2
if ((condition_result)); then
log_message "I: $log_message Turn ESS on to enable discharging."
execute_discharging=1
fi
}

# Function to manage fritz sockets and log a message
manage_fritz_sockets() {
Expand Down Expand Up @@ -1489,6 +1496,7 @@ check_abort_conditions() {
check_abort_condition $((abort_suntime <= suntime_today)) "There are enough sun minutes today. No need to charge or switch."
check_abort_condition $((abort_solar_yield_today_integer <= solarenergy_today_integer)) "There is enough solarenergy today. No need to charge or switch."
check_abort_condition $((abort_solar_yield_tomorrow_integer <= solarenergy_tomorrow_integer)) "There is enough solarenergy tomorrow. No need to charge or switch."
check_ess_abort_condition $((SOC_percent >= 90)) "The battery is getting full. Re-enabling inverter. This is important on a DC-AC system to enable grid-feedin."
}

if ((use_solarweather_api_to_abort == 1)); then
Expand Down

0 comments on commit 8506f3f

Please sign in to comment.