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

Merge master into Release #1138

Merged
merged 195 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
77d8964
thread cloud backup
LKuemmel Jul 5, 2023
b691c0a
idm....mit PV Leistung
okaegi Jul 19, 2023
c8eb692
flake8...
okaegi Jul 19, 2023
0819c83
watt.py
okaegi Jul 19, 2023
b306d7a
draft
LKuemmel Jul 19, 2023
7f2a882
Merge pull request #2758 from okaegi/smart191
LKuemmel Jul 25, 2023
ce6f2ce
Bump version 1.9.302
LKuemmel Jul 25, 2023
fe107d2
pv Leistung für 1.9
okaegi Jul 25, 2023
4c23607
pv Leistung für Openwb 2.0
okaegi Jul 25, 2023
a8ac141
fix
LKuemmel Jul 26, 2023
5516aff
fix rcit
LKuemmel Jul 26, 2023
caf11b2
Merge pull request #2762 from LKuemmel/fix
LKuemmel Jul 26, 2023
f609dd9
fix bezug_rct2
Jul 27, 2023
3ed1409
fix typos and format
Jul 27, 2023
9b9037d
Merge pull request #2763 from benderl/bugfix
benderl Jul 27, 2023
bc14466
typos and format
Jul 28, 2023
f1e55f2
fix logging
Jul 28, 2023
f7db900
Merge pull request #2764 from benderl/bugfix
benderl Jul 28, 2023
b059e17
fix amount limit
LKuemmel Jul 31, 2023
bbab02b
Chargestatus
okaegi Jul 31, 2023
44c405a
flake8
okaegi Jul 31, 2023
0ae37f5
chargestatus nachgeführt
okaegi Jul 31, 2023
2773b17
fllake8....
okaegi Jul 31, 2023
3e8c67a
update openwb.conf
LKuemmel Jul 31, 2023
34382bc
fix month name generation
Aug 1, 2023
9bd2cfc
Merge pull request #2766 from benderl/bugfix
benderl Aug 1, 2023
8962088
Update runs/updateConfig.sh
LKuemmel Aug 1, 2023
ffa5ab4
Merge pull request #2765 from LKuemmel/rse
LKuemmel Aug 2, 2023
ac6be1e
fix rct
LKuemmel Aug 3, 2023
fab8b83
Merge pull request #2768 from LKuemmel/fix
LKuemmel Aug 3, 2023
9c99dd2
Bump version 1.9.303.0
LKuemmel Aug 3, 2023
641fb9b
Bump version 1.9.304.0
LKuemmel Aug 3, 2023
5eb44db
Update version 2.1.1-Alpha.1
LKuemmel Aug 3, 2023
e4b372b
Merge pull request #2761 from okaegi/smart192
LKuemmel Aug 3, 2023
27177ea
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Aug 3, 2023
066b715
Merge pull request #1072 from LKuemmel/changes_snaptec_repo
LKuemmel Aug 3, 2023
34433e2
script hardware configuration
LKuemmel Aug 3, 2023
a0522bd
Merge pull request #1073 from LKuemmel/support
LKuemmel Aug 4, 2023
0ce9c2b
Merge pull request #1061 from LKuemmel/fix_amount
LKuemmel Aug 4, 2023
750a3f7
Merge pull request #1049 from okaegi/sm25032
LKuemmel Aug 4, 2023
2cc4faa
Merge pull request #1051 from LKuemmel/repair_hierarchy
LKuemmel Aug 4, 2023
6fb9d3f
Soc Kia (#1029)
Flock82 Aug 4, 2023
6b971fc
Merge pull request #1019 from LKuemmel/cloud_backup
LKuemmel Aug 4, 2023
8b793ca
name threads (#1018)
LKuemmel Aug 4, 2023
0b4c1dd
Onedrive_Backup (#968)
MartinRinas Aug 4, 2023
36b0bb8
add solarmax bat (#1044)
LKuemmel Aug 4, 2023
8c0d572
build UI (#1076)
LKuemmel Aug 4, 2023
6f30729
phase powers and currents added (#1059)
andlem74 Aug 4, 2023
b5fc5e6
build UI
LKuemmel Aug 4, 2023
71b93de
Merge pull request #1077 from LKuemmel/web
LKuemmel Aug 4, 2023
bddf740
fix powerdog
LKuemmel Aug 4, 2023
25e6664
Merge pull request #1078 from LKuemmel/powerdog
LKuemmel Aug 4, 2023
7d1b676
remove obsolet simcount modules from loadvars
LKuemmel Aug 4, 2023
bb1ffce
Revert "Onedrive_Backup (#968)"
LKuemmel Aug 4, 2023
1ff6804
Merge pull request #1079 from openWB/revert-968-Onedrive_Backup
LKuemmel Aug 4, 2023
fb46325
abb b23
okaegi Aug 6, 2023
a595a7f
fix number of new phases in case of auto phase switch
LKuemmel Aug 7, 2023
978424a
naming sma
LKuemmel Aug 7, 2023
8ec76d3
configurable port for sungrow
LKuemmel Aug 7, 2023
110397e
Speicher wird in Smarthome nicht mehr korrekt erkannt (#1080)
okaegi Aug 8, 2023
ed9772e
idm .... (#2771)
okaegi Aug 8, 2023
851a275
Merge pull request #2772 from okaegi/smart194
LKuemmel Aug 8, 2023
5fc2776
avoid warnings
benderl Aug 8, 2023
64ba8bb
catch pip errors
benderl Aug 8, 2023
13ca44a
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Aug 8, 2023
0339c5e
Merge pull request #1083 from LKuemmel/sma
LKuemmel Aug 8, 2023
fff5be1
Merge pull request #1082 from LKuemmel/fix
LKuemmel Aug 8, 2023
48b7b77
Kostal Piko Old for software2 (#2773)
LKuemmel Aug 8, 2023
7fe0915
Merge pull request #2774 from LKuemmel/sungr
LKuemmel Aug 8, 2023
8837873
fix duo rfid
LKuemmel Aug 8, 2023
d81a9a0
add power factor to cp
LKuemmel Aug 8, 2023
cd8f1e7
fix
LKuemmel Aug 8, 2023
374879a
fix
LKuemmel Aug 8, 2023
e62228d
undo remove rct module
LKuemmel Aug 8, 2023
28ca87c
Merge pull request #2770 from LKuemmel/fix
LKuemmel Aug 8, 2023
4db1f1d
fix timeout soc
LKuemmel Aug 8, 2023
aff402e
Merge pull request #1086 from LKuemmel/changes_snaptec_repo
LKuemmel Aug 9, 2023
5dd2704
scheduler interval
LKuemmel Aug 9, 2023
b422602
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Aug 9, 2023
61b3c96
fix
LKuemmel Aug 9, 2023
7133e8a
fix duo rfid
LKuemmel Aug 9, 2023
677d52d
improve text
LKuemmel Aug 9, 2023
50136b8
Merge pull request #1090 from LKuemmel/web
LKuemmel Aug 9, 2023
15c0bdd
build UI
LKuemmel Aug 9, 2023
ff80846
Merge pull request #1091 from LKuemmel/web
LKuemmel Aug 9, 2023
6cc9664
Merge pull request #1087 from LKuemmel/changes_snaptec_repo
LKuemmel Aug 9, 2023
63e0e35
backport client_factory
Aug 10, 2023
3e340ae
Merge pull request #2776 from benderl/bugfix
benderl Aug 10, 2023
ca6f18f
fix sungrow
LKuemmel Aug 11, 2023
fb21b2c
Merge pull request #2777 from LKuemmel/sungr
LKuemmel Aug 11, 2023
bfccc05
Merge pull request #1085 from benderl/bugfix
benderl Aug 14, 2023
32c1578
[Kia] - Parameter update
Flock82 Aug 14, 2023
512c66b
[Kia] - Parameter Update
Flock82 Aug 14, 2023
ff4e7e7
Merge pull request #1098 from Flock82/soc-kia
benderl Aug 15, 2023
dd1d8da
Merge pull request #2779 from Flock82/soc-kia
benderl Aug 15, 2023
a46807c
wiki docs
benderl Aug 15, 2023
7b9b54f
typo
benderl Aug 17, 2023
af11258
update cards display theme
benderl Aug 17, 2023
8e58058
Merge pull request #1100 from benderl/bugfix
benderl Aug 17, 2023
b48c474
only local cp in minimal display theme
Aug 18, 2023
960b477
toggle display of total inverter yields
Aug 18, 2023
f474397
Merge pull request #2780 from benderl/bugfix
benderl Aug 18, 2023
8fe62d9
fix debug log messages
Aug 21, 2023
583e333
Merge pull request #2781 from benderl/bugfix
benderl Aug 21, 2023
d0b0738
fix update config
LKuemmel Aug 21, 2023
d7cb36f
Merge pull request #1103 from LKuemmel/fix
LKuemmel Aug 21, 2023
3b1f7f6
draft
LKuemmel Jul 28, 2023
fb09b19
fixes
LKuemmel Jul 28, 2023
bec9eda
diagramm data
LKuemmel Jul 28, 2023
c2df7e4
flake8
LKuemmel Jul 28, 2023
b976e1c
rewrite chart data calculation
benderl Aug 14, 2023
bf808b9
add todo for home consumption
benderl Aug 14, 2023
8bf6ffa
fix test
benderl Aug 17, 2023
1d796f5
Steca: Fix no production
LKuemmel Aug 22, 2023
0043d8d
Merge pull request #1089 from LKuemmel/fix_duo_rfid
LKuemmel Aug 22, 2023
4e32a80
improve module settings
LKuemmel Aug 21, 2023
0bcedca
Merge pull request #1102 from LKuemmel/web
LKuemmel Aug 22, 2023
25d7c90
build UI
LKuemmel Aug 22, 2023
d32e88e
Merge pull request #1105 from LKuemmel/web
LKuemmel Aug 22, 2023
21cdf94
Update packages/modules/common/store/_chargepoint.py
LKuemmel Aug 22, 2023
057677a
build UI
LKuemmel Aug 22, 2023
51e4b81
Merge pull request #1074 from openWB/feature_measurement_log
LKuemmel Aug 22, 2023
e13d8de
Merge pull request #1106 from LKuemmel/web
LKuemmel Aug 22, 2023
cd9c0b8
Update version 2.1.1-Beta.1
LKuemmel Aug 22, 2023
da5eb08
BatterX: fix entity of external inverter
LKuemmel Aug 24, 2023
a88f2c9
Merge pull request #2783 from LKuemmel/fix
LKuemmel Aug 24, 2023
4e1842c
Merge pull request #2775 from LKuemmel/cp_power_factor
LKuemmel Aug 24, 2023
d12d26b
Merge pull request #2782 from LKuemmel/kostal_steca
LKuemmel Aug 24, 2023
55d6039
Update version 2.1.1-Alpha.2
LKuemmel Aug 24, 2023
8e93655
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Aug 24, 2023
54a8432
Merge pull request #1109 from LKuemmel/changes_snaptec_repo
LKuemmel Aug 24, 2023
a435c84
Varta: invalid register
LKuemmel Aug 24, 2023
5cd9fe5
Merge pull request #2784 from LKuemmel/fix
LKuemmel Aug 24, 2023
585a499
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Aug 24, 2023
fb55cec
Merge pull request #1110 from LKuemmel/changes_snaptec_repo
LKuemmel Aug 24, 2023
ae40c16
setdata powers and frequency
LKuemmel Aug 25, 2023
5c565ad
fix BatterX
LKuemmel Aug 25, 2023
0510a06
Merge pull request #2785 from LKuemmel/fix
LKuemmel Aug 25, 2023
d984e28
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Aug 25, 2023
058a319
Merge pull request #1112 from LKuemmel/changes_snaptec_repo
LKuemmel Aug 25, 2023
4e984a5
default value datastore version
LKuemmel Aug 28, 2023
952bac9
Merge pull request #1111 from LKuemmel/fix
LKuemmel Aug 28, 2023
d2d79cf
Merge pull request #1113 from LKuemmel/default_value_datastore_version
LKuemmel Aug 28, 2023
47d6b93
fix datastore version
benderl Aug 29, 2023
4896a48
Merge pull request #1116 from benderl/bugfix
benderl Aug 29, 2023
43ae3e6
draft
LKuemmel Aug 23, 2023
a9f6f3f
fix
LKuemmel Aug 24, 2023
13f4026
fix
LKuemmel Aug 24, 2023
bc79ec3
fix test
LKuemmel Aug 24, 2023
d84fe96
fix datastore version
LKuemmel Aug 24, 2023
aabe17a
calc daily yields only one time, fix new data.data names
LKuemmel Aug 29, 2023
c017fa6
fix datastore upgrade
benderl Aug 29, 2023
56c78c4
catch missing measurement groups
benderl Aug 29, 2023
96997ab
fix control range
LKuemmel Aug 25, 2023
1f41ff8
counter must be on top of hierarchy
LKuemmel Aug 29, 2023
bfdf1e7
fix test
LKuemmel Aug 30, 2023
30ee58b
run update soc as thread
LKuemmel Aug 30, 2023
5b5fe85
no exception log if file not found
benderl Aug 31, 2023
b203502
improve wiki hybrid screenshot
LKuemmel Aug 31, 2023
ef2e92e
Merge pull request #1122 from LKuemmel/wiki
LKuemmel Aug 31, 2023
4d0aaa8
Merge pull request #1117 from openWB/feature_hv_in_log_data
benderl Aug 31, 2023
1fbbc5d
rebuild
benderl Aug 31, 2023
db37e35
Merge pull request #1123 from benderl/ui-build
benderl Aug 31, 2023
bc34377
Merge pull request #1094 from openWB/feature_timeout_soc
benderl Aug 31, 2023
1a02f09
Merge pull request #1119 from LKuemmel/hierarchy
benderl Aug 31, 2023
c1756a2
Merge pull request #1120 from LKuemmel/fix
benderl Aug 31, 2023
af505bc
fix display wrapper
benderl Aug 25, 2023
f644ffe
external display mode and filter
benderl Aug 25, 2023
81502de
Merge pull request #1124 from openWB/feature-secondary-display
benderl Sep 1, 2023
fa40f5f
rebuild
benderl Sep 1, 2023
63ba045
Merge pull request #1125 from benderl/build-ui
benderl Sep 1, 2023
e558c0c
rebuild settings
benderl Sep 5, 2023
02f314e
bump version 2.1.1-Beta.2
benderl Sep 5, 2023
e6fca17
Merge pull request #1126 from benderl/settings-build
benderl Sep 5, 2023
10350e6
add missed display topic
benderl Sep 8, 2023
5cc3427
build ui
benderl Sep 8, 2023
bca9e25
Merge pull request #1128 from benderl/bugfix
benderl Sep 8, 2023
ccaa35b
fix smartme factor (#2790)
LKuemmel Sep 20, 2023
5b41428
fix soc interval config
LKuemmel Sep 20, 2023
5619a86
Merge pull request #1131 from LKuemmel/fix
LKuemmel Sep 20, 2023
d2c3d56
fix solarwatt
LKuemmel Sep 22, 2023
4638481
Merge pull request #2791 from LKuemmel/fix
LKuemmel Sep 22, 2023
ee3b14c
Merge remote-tracking branch 'openWB/master' into changes_snaptec_repo
LKuemmel Sep 22, 2023
50b45c1
Merge pull request #1133 from LKuemmel/changes_snaptec_repo
LKuemmel Sep 22, 2023
2b0c6f2
fix parent_cp
LKuemmel Sep 25, 2023
0097a1d
fix
LKuemmel Sep 25, 2023
3e7eb79
fix
LKuemmel Sep 25, 2023
d55d13b
fix obsolet parent_cp
LKuemmel Sep 25, 2023
b461fa6
redirect instead of iframe
benderl Sep 25, 2023
0831aca
Merge pull request #1134 from LKuemmel/parent_cp
benderl Sep 25, 2023
604fe4a
Merge pull request #1135 from benderl/display-bugfix
benderl Sep 25, 2023
c6080b7
fix socket migration
LKuemmel Sep 25, 2023
40746c7
Merge pull request #1136 from LKuemmel/import_logdata
LKuemmel Sep 25, 2023
ce00a8f
Update version 2.1.1-Beta.3
LKuemmel Sep 25, 2023
b7ac399
Update version 2.1.1
LKuemmel Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion data/config/boot_config.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# openwb - begin
# openwb-version:2
# openwb-version:3
# Do not edit this section! We need begin/end and version for proper updates!
[all]
gpio=4,5,7,11,17,22,23,24,25,26,27=op,dl
Expand All @@ -8,4 +8,5 @@ gpio=6,8,9,10,12,13,16,21=ip,pu
# this also requires to disable Bluetooth
dtoverlay=disable-bt
enable_uart=1
avoid_warnings=1
# openwb - end
27 changes: 19 additions & 8 deletions docs/Ladung nur nach Freischaltung.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
Nach Abstecken des Fahrzeugs soll der Ladepunkte gesperrt werden und eine Ladung erst nach Eingeben einer PIN, Vorhalten eines RFID-Tags oder Auswahl eines Fahrzeugs im User Interface gestartet werden.
Nach Abstecken des Fahrzeugs soll der Ladepunkt gesperrt werden und eine neue Ladung erst nach Freischalten durch:

* für jedes physische Fahrzeug unter _Einstellungen->Konfiguration->Fahrzeuge_ zusätzlich zum Standardprofil ein Fahrzeug anlegen
* Lademodus des Standardfahrzeugs auf `Stop`
* in jedem Ladeprofil: `Standard nach Abstecken` aktivieren
- Eingeben einer PIN am openWB-Display (sofern mit Touchdisplay) oder
- Vorhalten eines RFID-Tags an der openWB mit RFID-Reader oder
- Direkt-tagging über den Ladestecker mit der openWB-Pro oder
- Auswahl eines Fahrzeugs im User Interface

Wenn die Freischaltung mittels RFID oder Pin erfolgen soll:
gestartet werden.

* _Einstellungen -> Optional_: RFID aktivieren
* im Fahrzeug: Tag zuweisen
* in dem Ladepunkt-Profil: Freischaltung mit RFID aktivieren und die gültigen Tags eintragen
Hierzu ist folgendes zu konfigurieren:

1. für jedes Fahrzeug mit Freischaltwunsch unter Einstellungen -> Konfiguration -> Fahrzeuge zusätzlich zum Standard-Fahrzeug **ein separates Fahrzeug** anlegen
2. unter Lade-Profile -> **Standard-Lade-Profil** (wird nur dem Standard-Fahrzeug zugeordnet) -> **Lademodus auf Stop** stellen
3. ein **neues Lade-Profil** für Fahrzeuge mit Freischaltwunsch anlegen (z.B. RFID-Lade-Profil) und dort -> **Standard nach Abstecken** aktivieren sowie bevorzugten Lademodus wählen
4. den Fahrzeugen mit Freischaltwunsch **das Lade-Profil** für Fahrzeuge mit Freischaltwunsch **zuweisen** (z.B. RFID-Lade-Profil)
5. **Speichern** nicht vergessen

Wenn die Freischaltung mittels PIN, RFID oder MAC-Adresse erfolgen soll:

- Einstellungen -> Optionale Hardware: **RFID aktivieren** + Speichern
- unter Konfiguration -> Fahrzeuge -> gewünschtes Fahrzeug -> Zugeordnete Tags: dem jeweiligen Fahrzeug **den Tag (PIN/RFID-Tag/MAC-Adresse) zuweisen** + Speichern
- unter Konfiguration -> Ladepunkte -> Ladepunkt-Profile -> im gewünschten Ladepunkt-Profil: **Freischaltung mit RFID aktivieren und die gültigen Tags eintragen** + Speichern
Binary file modified docs/standard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/control/algorithm/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def _check_auto_phase_switch_delay(self) -> None:
cp.num,
cp.data.get.currents,
cp.data.get.power,
cp.template.data.max_current_single_phase)
cp.template.data.max_current_single_phase,
cp.get_max_phase_hw())
if message is not None:
cp.data.get.state_str = message
# Nachdem im Automatikmodus die Anzahl Phasen bekannt ist, Einhaltung des Maximalstroms
Expand Down
12 changes: 6 additions & 6 deletions packages/control/auto_phase_switch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ def __init__(self,

cases = [
Params("1to3, enough power, start timer", max_current_single_phase=16, timestamp_auto_phase_switch=None,
phases_to_use=1, required_current=6, evu_surplus=800, reserved_evu_overhang=0, get_currents=[15.6, 0, 0],
phases_to_use=1, required_current=6, evu_surplus=-800, reserved_evu_overhang=0, get_currents=[15.6, 0, 0],
get_power=3450, state=ChargepointState.CHARGING_ALLOWED, expected_phases_to_use=1, expected_current=6,
expected_message="Umschaltverzögerung von 1 auf 3 Phasen für 7.0 Min aktiv.",
expected_timestamp_auto_phase_switch="05/16/2022, 08:40:52",
expected_state=ChargepointState.PHASE_SWITCH_DELAY),
Params("1to3, not enough power, start timer", max_current_single_phase=16, timestamp_auto_phase_switch=None,
phases_to_use=1, required_current=6, evu_surplus=300, reserved_evu_overhang=0, get_currents=[15.6, 0, 0],
phases_to_use=1, required_current=6, evu_surplus=-300, reserved_evu_overhang=0, get_currents=[15.6, 0, 0],
get_power=3450, state=ChargepointState.CHARGING_ALLOWED, expected_phases_to_use=1, expected_current=6,
expected_state=ChargepointState.CHARGING_ALLOWED),
Params("1to3, enough power, timer not expired", max_current_single_phase=16,
timestamp_auto_phase_switch="05/16/2022, 08:35:52", phases_to_use=1, required_current=6,
evu_surplus=1200, reserved_evu_overhang=460, get_currents=[15.6, 0, 0], get_power=3450,
evu_surplus=-1200, reserved_evu_overhang=460, get_currents=[15.6, 0, 0], get_power=3450,
state=ChargepointState.PHASE_SWITCH_DELAY, expected_phases_to_use=1, expected_current=6,
expected_message="Umschaltverzögerung von 1 auf 3 Phasen für 7.0 Min aktiv.",
expected_timestamp_auto_phase_switch="05/16/2022, 08:40:52",
Expand All @@ -87,7 +87,7 @@ def __init__(self,
expected_state=ChargepointState.CHARGING_ALLOWED),
Params("1to3, enough power, timer expired", max_current_single_phase=16,
timestamp_auto_phase_switch="05/16/2022, 08:32:52", phases_to_use=1, required_current=6,
evu_surplus=1200, reserved_evu_overhang=460, get_currents=[15.6, 0, 0], get_power=3450,
evu_surplus=-1200, reserved_evu_overhang=460, get_currents=[15.6, 0, 0], get_power=3450,
state=ChargepointState.PHASE_SWITCH_DELAY,
expected_phases_to_use=3, expected_current=6, expected_state=ChargepointState.PHASE_SWITCH_DELAY_EXPIRED),

Expand All @@ -108,7 +108,7 @@ def __init__(self,
expected_state=ChargepointState.PHASE_SWITCH_DELAY),
Params("3to1, enough power, timer not expired", max_current_single_phase=16,
timestamp_auto_phase_switch="05/16/2022, 08:35:52", phases_to_use=3, required_current=6,
evu_surplus=860, reserved_evu_overhang=0, get_currents=[4.5, 4.4, 5.8],
evu_surplus=-860, reserved_evu_overhang=0, get_currents=[4.5, 4.4, 5.8],
get_power=3381, state=ChargepointState.PHASE_SWITCH_DELAY, expected_phases_to_use=3, expected_current=6,
expected_message=f"Umschaltverzögerung von 3 auf 1 Phasen abgebrochen{Ev.ENOUGH_POWER}",
expected_timestamp_auto_phase_switch="05/16/2022, 08:40:52",
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_auto_phase_switch(monkeypatch, vehicle: Ev, params: Params):
vehicle.data.control_parameter.state = params.state

# execution
phases_to_use, current, message = vehicle.auto_phase_switch(0, params.get_currents, params.get_power, 32)
phases_to_use, current, message = vehicle.auto_phase_switch(0, params.get_currents, params.get_power, 32, 3)

# evaluation
assert phases_to_use == params.expected_phases_to_use
Expand Down
8 changes: 4 additions & 4 deletions packages/control/bat_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ def calc_power_for_all_components(self):
self.data.get.power += battery.data.get.power
self.data.get.imported += battery.data.get.imported
self.data.get.exported += battery.data.get.exported
self.data.get.daily_exported += battery.data.get.daily_exported
self.data.get.daily_imported += battery.data.get.daily_imported
soc_sum += battery.data.get.soc
soc_count += 1
except Exception:
log.exception(f"Fehler im Bat-Modul {battery.num}")
self.data.get.soc = int(soc_sum / soc_count)
# Alle Summen-Topics im Dict veröffentlichen
{Pub().pub("openWB/set/bat/get/"+k, v) for (k, v) in asdict(self.data.get).items()}
Pub().pub("openWB/set/bat/get/power", self.data.get.power)
Pub().pub("openWB/set/bat/get/exported", self.data.get.exported)
Pub().pub("openWB/set/bat/get/imported", self.data.get.imported)
Pub().pub("openWB/set/bat/get/soc", self.data.get.soc)
else:
self.data.config.configured = False
Pub().pub("openWB/set/bat/config/configured", self.data.config.configured)
Expand Down
53 changes: 33 additions & 20 deletions packages/control/chargepoint/chargepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ def _is_ev_plugged(self) -> Tuple[bool, Optional[str]]:
if not state:
message = "Keine Ladung, da kein Auto angesteckt ist."
else:
if self.data.set.plug_time is None:
self.data.set.plug_time = timecheck.create_timestamp()
Pub().pub("openWB/set/chargepoint/"+str(self.num)+"/set/plug_time",
self.data.set.plug_time)
message = None
return state, message

Expand Down Expand Up @@ -431,9 +427,19 @@ def _process_charge_stop(self) -> None:
self.data.set.energy_to_charge = 0
Pub().pub("openWB/set/chargepoint/"+str(self.num)+"/set/energy_to_charge", 0)

def reset_values_at_start(self):
def setup_values_at_start(self):
self._reset_values_at_start()
self._set_values_at_start()

def _reset_values_at_start(self):
self.data.set.loadmanagement_available = True

def _set_values_at_start(self):
if self.data.get.plug_state and self.data.set.plug_time is None:
self.data.set.plug_time = timecheck.create_timestamp()
Pub().pub("openWB/set/chargepoint/"+str(self.num)+"/set/plug_time",
self.data.set.plug_time)

def remember_previous_values(self):
self.data.set.plug_state_prev = self.data.get.plug_state
Pub().pub("openWB/set/chargepoint/"+str(self.num)+"/set/plug_state_prev", self.data.set.plug_state_prev)
Expand All @@ -445,12 +451,12 @@ def prepare_cp(self) -> Tuple[int, Optional[str]]:
self.__validate_rfid()
charging_possible, message = self.is_charging_possible()
if charging_possible:
num, message_ev = self.template.get_ev(self.data.get.rfid or self.data.set.rfid, self.data.config.ev)
if self.data.get.rfid is not None:
self._link_rfid_to_cp()
num, message_ev = self.template.get_ev(self.data.set.rfid, self.data.config.ev)
if message_ev:
message = message_ev
if num != -1:
if self.data.get.rfid is not None:
self.__link_rfid_to_cp()
return num, message
else:
self.data.get.state_str = message
Expand Down Expand Up @@ -510,6 +516,8 @@ def _is_phase_switch_required(self, charging_ev: Ev) -> bool:
return True
return False

STOP_CHARGING = ", dafür wird die Ladung unterbrochen."

def initiate_phase_switch(self):
"""prüft, ob eine Phasenumschaltung erforderlich ist und führt diese durch.
"""
Expand Down Expand Up @@ -549,9 +557,9 @@ def initiate_phase_switch(self):
else:
# Wenn eine Umschaltung im Gange ist, muss erst gewartet werden, bis diese fertig ist.
if self.data.set.phases_to_use == 1:
message = "Umschaltung von 3 auf 1 Phase."
message = f"Umschaltung von {self.get_max_phase_hw()} auf 1 Phase{self.STOP_CHARGING}"
else:
message = "Umschaltung von 1 auf 3 Phasen."
message = f"Umschaltung von 1 auf {self.get_max_phase_hw()} Phasen{self.STOP_CHARGING}"
self.set_state_and_log(message)
return
if charging_ev.data.control_parameter.state == ChargepointState.WAIT_FOR_USING_PHASES:
Expand Down Expand Up @@ -580,12 +588,12 @@ def initiate_phase_switch(self):
"control_parameter phases " +
str(charging_ev.data.control_parameter.phases))
if charging_ev.data.control_parameter.phases == 1:
message = "Umschaltung von 3 auf 1 Phase."
message = f"Umschaltung von {self.get_max_phase_hw()} auf 1 Phase{self.STOP_CHARGING}"
# Ladeleistung reservieren, da während der Umschaltung die Ladung pausiert wird.
evu_counter.data.set.reserved_surplus += charging_ev. \
ev_template.data.max_current_single_phase * 230
else:
message = "Umschaltung von 1 auf 3 Phasen."
message = f"Umschaltung von 1 auf {self.get_max_phase_hw()} Phasen{self.STOP_CHARGING}"
# Ladeleistung reservieren, da während der Umschaltung die Ladung pausiert wird.
evu_counter.data.set.reserved_surplus += charging_ev. \
ev_template.data.max_current_single_phase * 3 * 230
Expand Down Expand Up @@ -701,18 +709,22 @@ def check_min_max_current(self, required_current: float, phases: int, pv: bool =
self.set_state_and_log(msg)
return required_current

def __link_rfid_to_cp(self) -> None:
def _link_rfid_to_cp(self) -> None:
""" Wenn der Tag einem EV zugeordnet worden ist, wird der Tag unter set/rfid abgelegt und muss der Timer
zurückgesetzt werden.
"""
rfid = self.data.get.rfid
cp2_num = self.find_duo_partner()
# Tag wird diesem LP der Duo zugewiesen oder es ist keine Duo
if not (cp2_num is not None and
self.data.get.rfid == data.data.cp_data[f"cp{cp2_num}"].data.get.rfid and
data.data.cp_data[f"cp{cp2_num}"].data.get.plug_state and
timecheck.get_difference(self.data.set.plug_time,
data.data.cp_data[f"cp{cp2_num}"].data.set.plug_time) < 0):
if ((cp2_num is not None and
# EV am anderen Ladepunkt, am eigenen wurde zuerst angesteckt
((data.data.cp_data[f"cp{cp2_num}"].data.get.plug_state and
timecheck.get_difference(self.data.set.plug_time,
data.data.cp_data[f"cp{cp2_num}"].data.set.plug_time) > 0) or
# kein EV am anderen Duo-Ladepunkt
data.data.cp_data[f"cp{cp2_num }"].data.get.plug_state is False)) or
# keine Duo
cp2_num is None):
self.data.set.rfid = rfid
Pub().pub("openWB/chargepoint/"+str(self.num)+"/set/rfid", rfid)
self.chargepoint_module.clear_rfid()
Expand Down Expand Up @@ -760,7 +772,8 @@ def find_duo_partner(self) -> Optional[int]:
if self.data.config.type == "external_openwb" or self.data.config.type == "internal_openwb":
for cp2 in data.data.cp_data.values():
if (cp2.num != self.num and
self.data.config.configuration.ip_address == cp2.data.config.configuration.ip_address):
self.data.config.configuration["ip_address"] == cp2.data.config.configuration[
"ip_address"]):
return cp2.num
return None
except Exception:
Expand Down Expand Up @@ -807,7 +820,7 @@ def update(self, ev_list: Dict[str, Ev]) -> None:
charging_ev.data.control_parameter.phases = min(
self.get_phases_by_selected_chargemode(), max_phase_hw)
state, message_ev, submode, required_current, phases = charging_ev.get_required_current(
self.data.set.log.imported_since_mode_switch,
self.data.get.imported,
max_phase_hw,
self.cp_ev_support_phase_switch())
phases = self.set_phases(phases)
Expand Down
2 changes: 1 addition & 1 deletion packages/control/chargepoint/chargepoint_state_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self,
self.ev_data = ev_data
self.ev_charge_template_data = ev_charge_template_data
self.ev_template_data = ev_template_data
Thread(target=self.update, args=()).start()
Thread(target=self.update, args=(), name=f"ChargepointStateUpdate cp {index}").start()

def update(self):
self.event_global_data_initialized.wait()
Expand Down
43 changes: 42 additions & 1 deletion packages/control/chargepoint/chargepoint_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List
from typing import List, Optional
from unittest.mock import Mock
import pytest
from control import data

from control.chargepoint.chargepoint import Chargepoint
from control.chargepoint.chargepoint_template import CpTemplate
Expand Down Expand Up @@ -49,3 +50,43 @@ def test_check_min_max_current(required_current, phases, expected_required_curre

# assertion
assert ret == expected_required_current


@pytest.fixture()
def mock_data() -> None:
data.data_init(Mock())
data.data.cp_data["cp1"] = Chargepoint(1, None)
data.data.cp_data["cp1"].data.get.rfid = "1234"


@pytest.mark.parametrize("partner_id, cp1_plug_state, cp0_plug_time, cp1_plug_time, expected_set_rfid",
[
pytest.param(None, False, None, None, "1234", id="no duo"),
pytest.param(1, False, None, None, "1234", id="second cp not plugged"),
pytest.param(1, True, "08/08/2023, 11:36:00",
"08/08/2023, 11:37:00", None, id="self first plugged"),
pytest.param(1, True, "08/08/2023, 11:37:00",
"08/08/2023, 11:36:00", "1234", id="second first plugged"),
])
def test_link_rfid_to_cp(partner_id: Optional[int],
cp1_plug_state: bool,
cp0_plug_time: Optional[str],
cp1_plug_time: Optional[str],
expected_set_rfid: Optional[str],
mock_data,
monkeypatch):
# setup
cp = Chargepoint(0, None)
cp.chargepoint_module = Mock()
cp.data.get.rfid = "1234"
cp.data.set.plug_time = cp0_plug_time
data.data.cp_data["cp1"].data.get.plug_state = cp1_plug_state
data.data.cp_data["cp1"].data.set.plug_time = cp1_plug_time
mock_find_duo_partner = Mock(return_value=partner_id)
monkeypatch.setattr(Chargepoint, "find_duo_partner", mock_find_duo_partner)

# execution
cp._link_rfid_to_cp()

# evaluation
assert cp.data.set.rfid == expected_set_rfid
4 changes: 2 additions & 2 deletions packages/control/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def calc_surplus(self):
# eingeschaltet werden. Es darf bloß nicht für zu viele zB die Einschaltverzögerung gestartet werden.
evu_counter = data.data.counter_all_data.get_evu_counter()
bat_surplus = data.data.bat_all_data.power_for_bat_charging()
surplus = - evu_counter.data.get.power + bat_surplus
surplus = evu_counter.data.get.power - bat_surplus
ranged_surplus = self._control_range(surplus)
log.info(f"Überschuss zur PV-geführten Ladung: {ranged_surplus}W")
return ranged_surplus
Expand Down Expand Up @@ -356,7 +356,7 @@ def calc_switch_off_threshold(self, chargepoint: Chargepoint) -> Tuple[float, fl
return threshold, feed_in_yield

def calc_switch_off(self, chargepoint: Chargepoint) -> Tuple[float, float]:
switch_off_power = - self.calc_surplus() - self.data.set.released_surplus
switch_off_power = self.calc_surplus() - self.data.set.released_surplus
threshold, feed_in_yield = self.calc_switch_off_threshold(chargepoint)
log.debug(f'LP{chargepoint.num} Switch-Off-Threshold prüfen: {switch_off_power}W, Schwelle: {threshold}W, '
f'freigegebener Überschuss {self.data.set.released_surplus}W, Einspeisegrenze {feed_in_yield}W')
Expand Down
Loading