question

matzedonien avatar image
matzedonien asked

Frage/Problem mit dem Spotmarket Switcher

Hallo,

ich habe einen selbstgebauten Batteriespeicher, welchen ich mit einem Raspberry Pi und Venus OS betreibe.

Nun habe ich mir zum testen den "Spotmarket Switcher" installiert. Wenn ich die controller.sh ausführe, so zeigt er mit folgendes an:

root@raspberrypi4:/data/etc/Spotmarket-Switcher# bash controller.sh
I: Bash Version: GNU bash, version 5.0.18(1)-release (arm-ve-linux-gnueabi)
I: Spotmarket-Switcher - Version 2.4.7
[-] Loading...Config validation passed.
I: aWATTar today-data is up to date.
I: aWATTar tomorrow-data is up to date.
Data available for 48 hours.
I: Please verify correct system time and timezone:
Thu Jan 4 16:03:40 CET 2024
I: Current price is 10.57300 Cent/kWh energy price.
I: The average price will be 8.83902 Cent/kWh energy price.
I: Highest price will be 14.46500 Cent/kWh energy price.
I: Sorted prices: 1:2.54800 2:3.50000 3:4.00000 4:5.04600 5:5.73000 6:5.77300 7:7.26500 8:7.32100 9:7.40500 10:7.60300 11:7.70100 12:8.05100
13:8.10000 14:8.50200 15:8.59600 16:8.60800 17:8.63000 18:8.68000 19:8.70000 20:8.88300 21:8.95700 22:9.00300 23:9.14700 24:9.15400
25:9.16100 26:9.21100 27:9.22400 28:9.41900 29:9.42000 30:9.48600 31:9.49200 32:9.49300 33:9.62800 34:9.64100 35:9.82200 36:9.86200
37:10.00100 38:10.00500 39:10.00900 40:10.29700 41:10.35900 42:10.39600 43:10.57300 44:10.73800 45:10.84500 46:12.50000 47:13.32300 48:14.46500

controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1224: [: -ge: unary operator expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
controller.sh: line 1259: [: : integer expression expected
I: Charge at prices: 1 2 3 4 5 6
I: Dynamic ESS discharge (depending SOC) at prices:
I: Switchable sockets at prices: 1 2 3 4 5 6
W: skip Solarweather. not activated
W: skip Victron Charger. not activated
D: skip Fritz DECT. not activated
D: skip Shelly Api. not activated

Nun ist meine Frage, was in den Zeilen 1224 und 1259 nicht stimmt. Ich bin leider absolut unwissend was die Programmierung angeht und kann dies maximal nach Anleitung anwenden. Wenn ich die Preise verändere, so dass die Ladung des Speichers eigentlich eingeschaltet werden sollte, so passiert leider nichts. Ich weiß nicht ob das an diesen Zeilen liegt oder ob hier sonst noch etwas im argen ist.

Ich habe natürlich einen Zeitplan für die Ladung eingerichtet und diesen dann deaktiviert.

Zeile 1224 beginnt mit:

if [ $SOC_percent -ge $discharge_value ]; then
declare "$discharge_var_name=1"
if [ -n "$DEBUG" ]; then
log_message "D: $discharge_var_name=1"
fi

Zeile 1259 beginnt mit:

if [ "$SOC_percent" -ge "$discharge_value" ]; then
discharge_table+="$discharge_var_name "


Es wäre schön, wenn mir jemand mitteilen könnte, was hier faul ist.


Vielen Dank

Matthias







system integration
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Matthias Lange - DE avatar image Matthias Lange - DE ♦ commented ·

Das ist eher was für den Modification Bereich:

https://community.victronenergy.com/spaces/31/index.html

Der ist speziell für solche inoffiziellen Geschichten gedacht.
Idealerweise fragst du da aber auf englisch.

0 Likes 0 ·
matzedonien avatar image matzedonien Matthias Lange - DE ♦ commented ·
Vielen Dank,


ich werde mich dort mal kümmern.


Gruß

Matthias


0 Likes 0 ·
3 Answers
d-ferdi avatar image
d-ferdi answered ·

hallo,

die variable discharge_value existiert nicht oder ist leer.

deshalb sollte man variablen im script immer in anfuehrungszeichen setzen. dann funktioniert zwar das script noch nicht, aber es kommen keine solchen fehlermeldungen mehr!

und beim vergleich wird eine zahl erwartet und keine leere zeichenkette, das verursacht dann auch wieder einen fehler. fuer den fall, dass die variable nicht gesetzt ist und 0 als wert nicht vorkommt, kann man noch eine 0 vor das dollar-zeichen setzen, um eine fehlermeldung zu unterdruecken.

allerdings macht es auch sinn, am anfang des scripts die benoetigten variablen auf gueltige werte oder auf existenz zu pruefen.

tschuess

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matzedonien avatar image
matzedonien answered ·

Vielen Dank für die Info.

Leider weiß ich natürlich nicht, warum die Variable leer ist oder fehlt. Ich hoffe, dass mir der Ersteller helfen kann.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Christian Butterweck avatar image
Christian Butterweck answered ·

Hallo,

Die Antwort darauf habe an dieser Stelle gegeben:

https://www.akkudoktor.net/forum/stell-dein-batterie-powerwall-projekt-vor/script-victron-venus-os-ess-avm-fritz-dect200-210-spotmarket-switcher/paged/3/#post-174400


Problem ist also denke ich gelöst.


Gruß Christian

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic