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

Anpassung Ziel-SoC/Limit-SoC #1662

Merged
merged 4 commits into from
Jun 27, 2024
Merged

Anpassung Ziel-SoC/Limit-SoC #1662

merged 4 commits into from
Jun 27, 2024

Conversation

pama87
Copy link
Contributor

@pama87 pama87 commented Jun 12, 2024

Stellt man im Lade-Profil der Fahrzeuge auf Zielladen ein und hinterlegt einen Plan mit Uhrzeit und stellt Ziel auf SoC können Ziel-SoC (Akkustand, der zum Zeitpunkt erreicht werden muss) und SoC-Limit (Akkustand, der zum Zeitpunkt mit PV-Überschuss erreicht werden kann) per Slider (5 - 100 %) eingestellt werden.

Ziel-SoC beschreibt hier den Akkustand zum Zielzeitpunkt (Sofortladen des Fahrzeuges) und SoC-Limit (Laden des Fahrzeuges mit PV-Überschuss) beschreibt das Laden mit PV-Überschuss, wenn PV-Überschuss vorhanden und noch genug Zeit für das Erreichen des Ladeziels vorhanden ist

Problem:
Wird der Ziel-SoC kleiner als das SoC-Limit gewählt, dann stoppt momentan der Ladevorgang beim Erreichen des SoC-Limits, obwohl der Ziel-SoC noch nicht erreicht wurde.

Lösung: Anpassung des Codes
Der Ladevorgang stoppt erst, wenn Ziel-SoC UND SoC-Limit erreicht wurde.
Wird der SoC-Limit erreicht, stoppen jegliche Ladevorgänge mit PV-Überschuss. Nur wenn sich der soc unterhalb des SoC-Limits befindet, ist eine PV-Überschuss Ladung möglich (auch bei preisbasiertem Laden).
Liegt der Zielzeitpunkt zu weit entfernt, wird immer in den Modus Sofortladen gewechselt, sodass der Ladevorgang rechtzeitig abgeschlossen wird und die Stromstärke entsprechend angepasst.
Preisbasiertes Laden hat trotzdem Priorität, falls es aktiviert wurde und Überschuss vorhanden ist. Werden günstige Stunden ermittelt und ist noch genügend Zeit vorhanden, dann startet der Ladevorgang im Modus Sofortladen, auch wenn PV-Überschuss vorhanden ist.
Sind keine günstigen Stunden ermittelt worden und ist das SoC-Limit erreicht, dann findet auch trotz PV-Überschuss kein Laden mit Überschuss statt.
Sind keine günstigen Stunden ermittelt worden und ist das SoC-Limit nicht erreicht, dann wird mit Überschuss geladen.

Allerdings wurde hier nicht überprüft, ob die Zeiten korrekt ermittelt wurden. Im MQTT Explorer werden die Zeiten zum Erreichen des Ladeziels anders ermittelt als im Betrieb. Der Mechanismus zum Ermitteln und Umschalten aber funktioniert.
Es sieht so aus, dass wenn das Zielladen startet, der Strom aus PV-Anlage und Netz gleichermassen entnommen wird, falls PV-Überschuss vorhanden. Der Speicher entleert sich anteilig.

Wenn das Ziel-SoC noch nicht erreicht wurde, aber noch genug Zeit zum Erreichen vorhanden ist, wird der Fahrzeug-Akku nicht mit PV-Überschuss gefüllt wird, wenn das SoC-Limit bereits erreicht wurde.

Getestet mit MQTT-Explorer Stand 12. Juni 2024

@pama87 pama87 requested a review from LKuemmel June 12, 2024 13:30
@LKuemmel LKuemmel linked an issue Jun 13, 2024 that may be closed by this pull request
Comment on lines 758 to 759
SCHEDULED_REACHED_LIMIT_SOC = ("Kein Zielladen, da noch Zeit bis zum Zieltermin ist. "
"Kein Zielladen mit Überschuss, da das SoC-Limit erreicht wurde.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SCHEDULED_REACHED_LIMIT_SOC = ("Kein Zielladen, da noch Zeit bis zum Zieltermin ist. "
"Kein Zielladen mit Überschuss, da das SoC-Limit erreicht wurde.")
SCHEDULED_REACHED_LIMIT_SOC = ("Kein Zielladen, da noch Zeit bis zum Zieltermin ist. "
"Kein Zielladen mit Überschuss, da das SoC-Limit für Überschuss-Laden erreicht wurde.")

@LKuemmel LKuemmel added this to the 2.1.5 Step 3 milestone Jun 25, 2024
@LKuemmel LKuemmel merged commit 45ad961 into openWB:master Jun 27, 2024
1 check passed
LKuemmel added a commit that referenced this pull request Jul 24, 2024
* soc BMW: fix env issue in main.sh

* MQTT: Allow other devices to use the branch other/#

* Bump aiohttp from 3.9.2 to 3.9.4

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.2 to 3.9.4.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.2...v3.9.4)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* trap failing api in fetch_soc

* use also surplus in mode scheduled charging submode instant charging

* req.get_http_session implemented

* long line trncated

* indent fixed

* immediately switch off in case of submode change and switch off threshold reached

* pv phases automatic: directly start with max phases

* backup file before writing

* Fix livegraph date display and pricelist scale granularity

* Prevent division by zero error in day graph

* polestar api:cleaned and exceptions added

* blank line removed

* fix charged range display

* Increment version number in mosquitto.acl as requested by benderl

* build ui

* Update powergraph.js

Index zu kurz, Verbrauche2 erscheint als LP3

* build UI

* remove spinning wheel from graph

* add registry entry for os error none in case of timed out network connection

* fix client handler fault state

* fix year graph

* fix template deletion

* Update version 2.1.4

* Update pycarwings2.py

Two changes

1st re line 75: Nissan changed the Base URL of its Carwings API. Since May 20, 2024 the old URL used by pycarwings2 in soc_leaf doesn't work anymore.

2nd re line 121: At least on a Windows 10 PC with Python 3.12 for test purpose, the additional parameter 'headers={"User-Agent": ""}' is needed to run pycarwings2.py successfully. The need for this parameter within OpenWB itself has tbc.

For more details see posts on https://forum.openwb.de/viewtopic.php?p=109761#p109761 ff

* update ramdisk settings

* Update pycarwings2.py

2nd change removed, because it is not needed on the OpenWB software platform.

* Update version 2.1.5-Alpha.1

* Wiki: Fehlerbehandlung im Kontextmanager (#1616)

* Wiki: Fehlerbehandlung im Kontextmanager

* zusammenfassen für Geräte und SoC

* struktur

* Update docs/Neues Modul programmieren.md

Co-authored-by: benderl <benderl@users.noreply.github.com>

---------

Co-authored-by: benderl <benderl@users.noreply.github.com>

* Gerätenamen (#1619)

* Gerätenamen

* SMA Sunny Home Manager 2.0, Energy Meter

* build UI

* Boersenmodul (#1568)

* #Boersenstrompreise allgemein energycharts mit Grundpreisoption

* #Laenderauswahl fix

* #Boersenmodul v1

* #removed unused import

* #removed topics, cleaned code

* #removed whitespace flake8

* #use req

* # change variable serve_price to surchar_price

* #requested changes

* # requested change, cleaned code

* SOC-Module BMW - via bimmer_connected, supporting calculate_soc (#1610)

* SOC-Module BMW - via bimmer_connected, supporting calculate_soc

* changes as requested

* removed obsolete imports

* Rabot dynamischer Tarif (#1655)

* Grundstruktur ohne Anpassung

* Anapssung Rabot

* fix Umrechnungsfaktor

* fix flake8 + added try except for get_raw_prices

* fix pv yields: yields for inverters added in the current month or year (#1654)

* fix pv yields: yields for inverters added in the current month or year

* consider first day  when no monthly logfile exists

* fix timestamp text (#1646)

* fix timestamp text

* review

* "Neu" statt "Standard-" (#1641)

* "Neu" statt "Standard-"

* cp: phase_1 must be 1/2/3

* fix hierarchy validation (#1629)

* fix hierarchy validation

* reuse text

* Fix pip SSL-error in github action

* build UI

* fix missing logfiles

* improve ui text

* build UI

* Hausverbrauch bei Hausverbrauchszählern (#1640)

* draft

* Hausverbrauch bei Hausverbrauchszählern

* Smart-hello Vehicle SoC (#1653)

* initial version

* flake8

* LoginHello error handling

* handle empty VIN

* remove unused functions

* add sessioncache to config

* formatting and cleanup

* flake8

* soc timestamp

* add retry logic

* no calc_while_charging

* recommendations from review

* review

* Boersenmodul (#1665)

* #Boersenstrompreise allgemein energycharts mit Grundpreisoption

* #Laenderauswahl fix

* #Boersenmodul v1

* #removed unused import

* #removed topics, cleaned code

* #removed whitespace flake8

* #use req

* # change variable serve_price to surchar_price

* #requested changes

* # requested change, cleaned code

* Fix Börsenmodul Zeit

* remove unused import

* Flake8

Removed unused import

* fix UTC Zeit +02:00 ud +01:00

* Feature shelly pro3em (#1670)

* add shelly as battery and counter

* add Shelly 3EM

* minor changes to modules

* improve readability

* disable PSA modul (#1672)

* disable PSA modul

* flake8

* Update packages/modules/vehicles/psa/api.py

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* flake8

---------

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* fix counters in daily log

* fix Errorhandling Backup vor Update (#1631)

* Wechseln des Entwickungszweiges liefert StackTrace

* Aenderung Error logging

* fix phases in case of no hw phase switch (#1612)

* fix phases in case of no hw phase switch

* check hw phase switch first

* fix simcount nan (#1657)

* fix simcount nan

* fix

* typo

* typo

* new module mtec

* fix log grid attribute

* skip if error doesn't occur

* colors theme: update packages (#1684)

* update packages

* update dist package

* Elwa2.... (#2843)

* Elwa2....

Elwa2 anpaasungen für 1.9 und 2.0,
Gui für 2.0 kommt noch separat.

* typeo...

* typo

* Metadata bat all (#1635)

* changed_values_handler

improve test

fix

fix test

* Metadata for bat_all

* clean up

* fixes

* remove obsolet metadata

* remove obsolet topic (#1621)

* remove obsolet topic

* update file version

* fix path backup_before_update (#1623)

Co-authored-by: benderl <benderl@users.noreply.github.com>

* fix build cards theme workflow

* Revert "remove obsolet topic (#1621)"

This reverts commit 7c7b5e8.

* Remove obsolet (#1689)

* remove obsolet topic

* update file version

* Build Display Theme: Cards

* update display theme

* add features to display theme

* reduce parameters for theme

* add binary version

* fix python linter problem

* fix python linter problem

* fix smarthome display

* build UI

* improve log file sizes (#1659)

* improve log file sizes

* use more rotating files

* Update deye (#1691)

* fix power factors and registers

* change ModbusDataType fo frequency

* Wiki (#1658)

* Create manual-workflow.yml

* clean branch

* Create Huawei-Smartlogger.md

* Add files via upload

* Update Huawei-Smartlogger.md

* Update _Sidebar.md

* Update _Sidebar.md

* Update _Sidebar.md

* Update docs/Huawei-Smartlogger.md

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Update docs/Huawei-Smartlogger.md

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Update docs/Huawei-Smartlogger.md

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Update docs/Huawei-Smartlogger.md

* Update docs/Huawei-Smartlogger.md

* Update docs/Huawei-Smartlogger.md

---------

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Phasenumschaltung (#1644)

* Phasenumschaltung Zielladen mit submode

* New topic setdata & update_config

* Anpassung Kommentar

* topic von phase_switch_delay geändert und von Klasse PVCharging in ChargeModeConfig migriert

* Flake8 line too long

* fix pytest auto_phase_switch_test.py

* added upgrade_datastore_44

* update_config merge

* altes topic

* build UI

* Neues Konzept ID-Tag (#1652)

* disable_after_unplug migriert von ev.py nach chargepoint topic verschoben in setdata

* removed rfid_enabled

* changed definition set manual_lock active

* changed access to disable_after_unplug

* new concept disable_after_unplug

* flake8

* Anpassung wiki Ladung nur nach Freischaltung

* Korrektur Rechtsschreibung

* Korrektur Rechtsschreibung

* Korrektur Rechtsschreibung

* Anapssung Text wiki

* Korrektur Rechtschreibung

* added datastore in update_conf (not tested)

* resolve datastore merge conflict

* flake8 whitespace after merge conflict

* flake8 whitespace

* flake8 whitespace

* Update packages/control/chargepoint/chargepoint_template.py

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Update packages/control/ev.py

---------

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* build UI (#1697)

* fix phases to use if MAX_FAILED_PHASE_SWITCHES is reached (#1698)

* improve text, wiki: fix visibility and content (#1700)

* improve text

* wiki: fix visibility and content

* fix wiki (#1701)

* add timeout for display unlock

* add timeout for display unlock

* hook for uncaught exceptions (#1703)

* hook for uncaught exceptions

log stdout and stderr

fix

* flake8

* Revert "hook for uncaught exceptions (#1703)" (#1704)

This reverts commit f4c4106.

* Hook uncaught exceptions (#1705)

* hook for uncaught exceptions

log stdout and stderr

fix

* flake8

* fix import error

* Anpassung Ziel-SoC/Limit-SoC (#1662)

* Anpassung Ziel-SoC/Limit-SoC

* Anpassung if-statement -> pytest

* fix text

* flake8 line too long

* build UI (#1706)

* Wiki: Add Content (#1452)

* Wiki: Fehlerhafte Links korrigiert und Inhalte ergänzt

* Wiki: Ergänzungen und neue Seite Fehlersuche

* Wiki: MQTT Doku als erster Entwurf

* Wiki: Formatierungen an MQTT-Doc

* Wiki: Korrekturen zu Kommentaren #1

* Apply suggestions from code review

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Update docs/Ladeprofile.md

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* Wiki: Fehler in MQTT Doku

* Wiki: Warnung hinzugefügt

* Wiki: Erkentnisse zu den Darstellungen eingefügt

* Wiki: Menü Anpassung

* Apply suggestions from code review

Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

---------

Co-authored-by: ChristianK <christian@koellings.de>
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>

* fix update_conf datastore_46 (#1702)

* Aufteilung datastore_46 in 46 und 47

* fix update_config

* improve default value  max_current_single_phase = 16 (#1707)

* improve default value  max_current_single_phase = 16

* fix test

* fix PHASE_SWITCH_DELAY_EXPIRED and no phase switch required (#1709)

* Update _Sidebar.md (#1708)

Typo in der Formatierung des Menüs

* fix double log entries in child logs (#1710)

* Wiki Hausverbrauchs-Zähler (#1711)

* Wiki Hausverbrauchs-Zähler

* fix

* fix-alpha_ess-counter-bug (#1713)

* headers for chargelog in download-link (#1714)

* Metadata chargepoint all (#1634)

* Metadata for chargepoint_all

* fix

* clean up

* fix

* Extend charge log (#1651)

* draft

* fix

* csv: match key to row, parse power sources

* clean up

* flake8

* fix

* fixes

* fix

* fix

* clean up log (#1717)

* clean up log

* fix get phases chargemode

* Anpassung Wiki Ladung nur nach Freischaltung (#1718)

* build UI (#1719)

* Goodwe v1 1 (#1715)

* add version and firmware information

* add alternative registers for battery and counter

* fix breaking changes

* solve breaking changes

* fix breaking changes, add comments

* metadata for ev (#1716)

* Colors theme: Fixes and Improvements (#1712)

* increase font size in badges

* fix livegraph SOC

* fix chargelog energy source (#1720)

* handle errors during configurable initialization - RSE (#1458)

* handle errors during configurable initialisation

* fix

* fix

* handle errors during configurable initialisation - backup clouds (#1630)

* handle errors during configurable initialisation - backup clouds

* fix

* Implementierung Einrichtungsassistent automatisches Aufrufen beim Starten

Rename of InstallWizard to InstallAssistantDone

datastore_upgrade Einrichtungsassistent

Rename of InstallWizard to InstallAssistantDone

Update update_config.py

* fix

* build UI (#1723)

* fix visibility assistant after update (#1724)

* build UI (#1729)

* Goodwe v1 1 (#1727)

* add version and firmware information

* add alternative registers for battery and counter

* fix breaking changes

* solve breaking changes

* fix breaking changes, add comments

* fix SimCounter

* remove duplicate lines

* fix badge font color (#1728)

* handle errors during configurable initialization - electronic tariffs (#1632)

* handle errors during configurable initialization - electronic tariffs

* docs

* energycharts

* fix daygraph

* fix visibility of bat on dashboard (#1731)

* fix satellite modbus error (#1732)

* fix satellite modbus error

* mock contextmanager

* detect and fix invalid cached vehicle (#1673)

* fix pv yield for deleted inverters (#1737)

* Smart260 (#1739)

* samrthome 2.0 startup

Nur für openwb 2.0 übernehmen.
Neu wird beim smarthome startup der letzte manual / automatisch Mode aus mqtt übenommen.
flake8 Anpassungen

* blank removed

* flake8

...

* Goodwe v1 1 (#1738)

* add version and firmware information

* add alternative registers for battery and counter

* fix breaking changes

* solve breaking changes

* fix breaking changes, add comments

* fix SimCounter

* remove duplicate lines

* add component ID for SimCounter

* correct pv total power reg for v1.1

* adjust line length

* fix and remove obsolet topics (#1736)

* fix and remove obsolet topics

* fix

* update valid topics (#1740)

* show ripple control receiver config in log (#1741)

* Use create_device for byd, huawei smartlogger, carlo gavazzi, good_we, kostal piko, janitza (#1742)

* BYD, CarloGavazzi, GoodWe

* sample

* huawei smartlogger

* kostal piko

* janitza

* build

* hotfix

* fix samba default path

* naming (#1749)

* increase evse error tolerance (#1750)

* Goodwe v1 1 (#1745)

* add version and firmware information

* add alternative registers for battery and counter

* fix breaking changes

* solve breaking changes

* fix breaking changes, add comments

* fix SimCounter

* remove duplicate lines

* add component ID for SimCounter

* correct pv total power reg for v1.1

* adjust line length

* change ModbusDataType for power and power factors

* adjust inverter total power

* fix goodwe inverter power, remove unused device id

* fix pin validation

* add switch for soc limit in PV mode

* add upper limit for autarchy in energy graph

* fix CP colors in month graph and remove calculation of autarchy

* add different factors for deye three phase inverters (#1735)

* add different factors for deye three phase inverters

* fix deye breaking changes

* remove factor selection

* handle device_type internally

* remove topic device_type

* read device_type just once

* add enum device_type for better readability

* Ticket (#1726)

* draft

* ticket

* remove comment

* delete old script

* fixes

* secondary

* fix

* show primary/secondary mode

* fix

* add fox_ess device (#1755)

* mqtt, powerdog, saxpower, siemens, lg (#1754)

* mqtt, powerdog, saxpower, siemens

* lg

* build UI (#1756)

* Fix charge log (#1757)

* fix chargelog

* fix rebase

* test

* test

* fix

* f

* fix

* fix

* test

* running test only local

* undo

* read energy counter from inverter, remove simcount (#1758)

* Fix charge log-bugfix (#1763)

* fix

* typo

* Revert "Fix charge log-bugfix (#1763)" (#1764)

This reverts commit 71b3fe0.

* Revert "Fix charge log (#1757)" (#1765)

This reverts commit ea7aac7.

* Improve Wiki (#1766)

* integrate energy flow view from simple interface

* fix vehicle settings header

* enlarge some elements

* update vulnerable dependencies

* update fontawesome packages

* update other dependencies except eslint

* linting

* upgrade eslint

* fix linting errors ans warnings

* migrate simple display theme

* tune energy flow view

* add reboot and shutdown buttons for secondaries

* cleanup display wrapper

* tweak flow elements

* Revert "add reboot and shutdown buttons for secondaries"

This reverts commit eb83208.

* build settings ui

* Build Display Theme: Cards

* improve ticket (#1769)

* metadata  (#1760)

* metadata all

* fix test

* improve

* new connection on exception (#1771)

* detect broken evse and broken meter (#1759)

* Update update_config.py

* rename consumption counter (#1768)

* fix skipped datastore version (#1773)

* fix daily yield topic (#1776)

* inital http-api

* enable http api apache site

* minor changes

* http-api send msg added

* inital http-api

* enable http api apache site

* minor changes

* http api topic

* returns in json

* command

* cleanup after rebase and fix

* refactor api v1

* remove unsecure access to api

* refactor apache configuration in atreboot.sh

* command

* migrate command to regular topic update

* build settings ui

* fix calculation of charge costs including one hour change (#1781)

* fix sma error handling (#1782)

* fix sma error handling

* dc power NaN

* ticket: catch request timeout (#1779)

* Update version 2.1.5-Beta.1

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: benderl <benderl@users.noreply.github.com>
Co-authored-by: rleidner <rl111@gmx.de>
Co-authored-by: DerHerrW <spam@zut.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Philipp Kainz <pkainz@Philipps-MacBook-Pro.fritz.box>
Co-authored-by: PK <pk.hh8@online.de>
Co-authored-by: Claus Hagen <cshagen@hagens.ch>
Co-authored-by: DerHerrW <129861137+DerHerrW@users.noreply.github.com>
Co-authored-by: Lutz Bender <github@lutz-bender.de>
Co-authored-by: Penny <89247538+hhoefling@users.noreply.github.com>
Co-authored-by: mekrapp <158028484+mekrapp@users.noreply.github.com>
Co-authored-by: pama87 <163103468+pama87@users.noreply.github.com>
Co-authored-by: rleidner <89418596+rleidner@users.noreply.github.com>
Co-authored-by: Martin Rinas <martrin@microsoft.com>
Co-authored-by: ndrsnhs <156670705+ndrsnhs@users.noreply.github.com>
Co-authored-by: ndrsnhs <andreas.neuhaus@openwb.de>
Co-authored-by: okaegi <72255431+okaegi@users.noreply.github.com>
Co-authored-by: LKuemmel <LKuemmel@users.noreply.github.com>
Co-authored-by: Sebastian Reinhold <44172078+sreinhold95@users.noreply.github.com>
Co-authored-by: Christian <76468662+Pendragon77@users.noreply.github.com>
Co-authored-by: ChristianK <christian@koellings.de>
Co-authored-by: pama87 <patrick.mayer@openwb.de>
Co-authored-by: kevinwieland <kevin.wieland@opewnb.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SoC-Limit kleiner Ziel-SoC
2 participants