Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
32702c1b0c | |||
03de71fe32 | |||
5d94b00bb1 |
1
.env
1
.env
@@ -17,5 +17,4 @@ POWER_TARGET_MIN=0 # minimum percentage for the inverter output
|
|||||||
POWER_TARGET_MAX=100 # maximum percentage for the inverter output limit, default: 100.0 [%]
|
POWER_TARGET_MAX=100 # maximum percentage for the inverter output limit, default: 100.0 [%]
|
||||||
POWER_DAMPING_FACTOR=0.7 # damping factor for changes of the inverter output limit (between 0-1), default: 0.3
|
POWER_DAMPING_FACTOR=0.7 # damping factor for changes of the inverter output limit (between 0-1), default: 0.3
|
||||||
POWER_LIMIT_CHANGE_TRESHOLD=0.3 # set a treshold for the api calls: they will not be executed if the new limit isn't that much higher, default: 0.5
|
POWER_LIMIT_CHANGE_TRESHOLD=0.3 # set a treshold for the api calls: they will not be executed if the new limit isn't that much higher, default: 0.5
|
||||||
POWER_LIMIT_TYPE=1 # the power limit type; DON'T CHANGE if you don't know what you're doing, default: 1 (see https://github.com/tbnobody/OpenDTU/discussions/742)
|
|
||||||
PYTHONUNBUFFERED=1 # for use in docker images (for fast logs, ...)
|
PYTHONUNBUFFERED=1 # for use in docker images (for fast logs, ...)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# SolarControl
|
# SolarControl
|
||||||
|
|
||||||
Enforce a zero export (or whatever consumption you like) policy with an OpenDTU-controlled inverter and energy data from MQTT
|
Enforce a zero export (or whatever consumption you like) policy with an OpenDTU-controlled inverter and energy data from MQTT.
|
||||||
|
|
||||||
|
|
||||||
## Configuring and usage
|
## Configuring and usage
|
||||||
|
@@ -45,9 +45,12 @@ power_target_min = float(os.getenv('POWER_TARGET_MIN', 0))
|
|||||||
power_target_max = float(os.getenv('POWER_TARGET_MAX', 100))
|
power_target_max = float(os.getenv('POWER_TARGET_MAX', 100))
|
||||||
power_damping_factor = float(os.getenv('POWER_DAMPING_FACTOR', 0.3))
|
power_damping_factor = float(os.getenv('POWER_DAMPING_FACTOR', 0.3))
|
||||||
power_limit_change_treshold = float(os.getenv('POWER_LIMIT_CHANGE_TRESHOLD', 0.5))
|
power_limit_change_treshold = float(os.getenv('POWER_LIMIT_CHANGE_TRESHOLD', 0.5))
|
||||||
power_limit_type = int(os.getenv('POWER_LIMIT_TYPE', 1))
|
|
||||||
dry_run = bool(int(os.getenv('DRY_RUN', 1)))
|
dry_run = bool(int(os.getenv('DRY_RUN', 1)))
|
||||||
|
|
||||||
|
# set other important variables
|
||||||
|
power_limit_type = 1 # only set the limit temporary to avoid memory damage; see also: https://github.com/tbnobody/OpenDTU/discussions/742
|
||||||
|
version = "v1.0" # the version number
|
||||||
|
|
||||||
# some checks for the correctness of supplied data
|
# some checks for the correctness of supplied data
|
||||||
if power_target_min < 0: power_target_min = 0
|
if power_target_min < 0: power_target_min = 0
|
||||||
if power_target_max > 100: power_target_max = 100
|
if power_target_max > 100: power_target_max = 100
|
||||||
@@ -55,6 +58,9 @@ if power_damping_factor < 0: power_damping_factor = 0.0
|
|||||||
if power_damping_factor > 1: power_damping_factor = 1.0
|
if power_damping_factor > 1: power_damping_factor = 1.0
|
||||||
|
|
||||||
|
|
||||||
|
print(f"{bcolors.OKCYAN}Welcome to {bcolors.ENDC}{bcolors.OKBLUE}{bcolors.BOLD}SolarControl{bcolors.ENDC}{bcolors.OKCYAN} ({version})!{bcolors.ENDC}")
|
||||||
|
|
||||||
|
|
||||||
# create the powers dict (containing the current use) and data variables (for thread sharing)
|
# create the powers dict (containing the current use) and data variables (for thread sharing)
|
||||||
powers_raw = {"solar": 0, "solar_ts": 0, "house": 0, "house_ts": 0}
|
powers_raw = {"solar": 0, "solar_ts": 0, "house": 0, "house_ts": 0}
|
||||||
powers = {"total": None, "total_house": None, "total_solar": None, "timestamp": 0}
|
powers = {"total": None, "total_house": None, "total_solar": None, "timestamp": 0}
|
||||||
|
Reference in New Issue
Block a user