Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nachladen aus dem Netz ab 1 Uhr Nachts (Sinnvoll bei dynamischem Stromtarif) #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ def fsm_auto_idle(self, entry):
self.set_fsm_state('auto_feed')
elif self.is_charge_start():
self.set_fsm_state('auto_charge')

# Night charge
if (self.get_setting('charge_night_end_soc') > 0) and (self.bms.soc < self.get_setting('charge_night_end_soc')):
if (int(time.strftime("%H")) == 1) and (int(time.strftime("%M")) == 0):
self.set_fsm_state('auto_night_charge')
if mp2_state=='sleep':
self.multiplus.wakeup()

if self.state_timer.is_expired() and mp2_state != 'sleep':
self.state_timer.start(5) # resend
Expand All @@ -292,7 +299,27 @@ def fsm_auto_idle(self, entry):
except Exception as e:
self.log.error("[auto_idle] exception {}".format(e))
self.set_fsm_state('error')

# ==================================================================================================================
# AUTO_NIGHT_CHARGE
# ==================================================================================================================

def fsm_auto_night_charge(self, entry):

if entry:
self.log.info("AUTO-NIGHT-CHARGE")

try:
if (self.bms.soc == self.get_setting('charge_night_end_soc')) or ((int(time.strftime("%H")) == 4) and (int(time.strftime("%M")) == 0)):
self.set_p = 0
self.set_fsm_state('auto_idle')

self.set_p = 2000 # charge max Power of Multiplus II 48/3000

except Exception as e:
self.log.error("[auto_night_charge] exception {}".format(e))
self.set_fsm_state('error')

# ==================================================================================================================
# AUTO_CHARGE
# ==================================================================================================================
Expand Down Expand Up @@ -388,6 +415,13 @@ def fsm_auto_feed(self, entry):
self.set_fsm_state('auto_idle')

self.set_p = -feed_set_p

# Night charge
if (self.get_setting('charge_night_end_soc') > 0) and (self.bms.soc < self.get_setting('charge_night_end_soc')):
if (int(time.strftime("%H")) == 1) and (int(time.strftime("%M")) == 0):
self.set_p = 0
self.set_fsm_state('auto_night_charge')

except Exception as e:
self.log.error("[auto_feed] exception {}".format(e))
self.set_fsm_state('error')
Expand Down Expand Up @@ -468,6 +502,8 @@ def get_info_text(self):
s = "Automatik - Laden"
elif self._fsm_state == 'auto_feed' and mp2_state == 'on':
s = "Automatik - Einspeisen"
elif self._fsm_state == 'auto_night_charge' and mp2_state == 'on':
s = "Automatik - Nachtladen"
elif mp2_state == 'wait':
s = "Automatik - Warten"
return s
Expand Down
5 changes: 5 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@
'feed_throttle_power': 1500, # [W] Performance limit with throttling

'idle_sleep_time': 10 * 60, # [s] Sleeptimer, (idle --> sleep) Multiplus

'charge_night_end_soc': 0, # [%] SOC to reach in night charge
},
{
'name': 'Standard + Nacht laden',
'charge_night_end_soc': 80, # [%] SOC to reach in night charge
{
'name': 'Maximal-Entladen (Sommer)',
'feed_max_power': 2400,
Expand Down