Skip to content

Commit 9753a04

Browse files
openhabianopenhabian
authored andcommitted
neue Logik um das Logo zu ersetzen für 5.1 UND 5.2
Signed-off-by: openhabian <openhabian@openHABian>
1 parent e28e264 commit 9753a04

3 files changed

Lines changed: 130 additions & 64 deletions

File tree

build-image/openhabian.conf

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,39 @@ wallboxuser=
158158
wallboxpass=
159159
wallboxid=
160160
evcctoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjI5ODkzODYzMjQsImlhdCI6MTY5MzM4NjMyNCwiaXNzIjoiZXZjYy5pbyIsInN1YiI6ImVtc0BzdG9ybS5ob3VzZSIsInNwZSI6dHJ1ZX0.K5Qea8xGoLKcE0E4cyc3VrCc2utjAisAGx-ORrqbSbc
161-
cartype1=offline
162-
carname1=mein-EAuto
163-
carvin1=0000000000
164-
carcapacity1=50
165-
caruser1=user
166-
carpass1=pass
167-
cartoken1=
168-
cartype2=offline
169-
carname2=mein-anderes
170-
carvin2=0000000000
171-
carcapacity2=50
172-
caruser2=user
173-
carpass2=pass
174-
cartoken2=
161+
car1type=offline
162+
car1name=mein-EAuto
163+
car1vin=0000000000
164+
car1capacity=50
165+
car1user=user
166+
car1pass=pass
167+
# carXparamY hat das Format Parametername|Parameterwert
168+
car1param1=
169+
car1value1=
170+
car1param2=
171+
car1value2=
172+
car1param3=
173+
car1value3=
174+
car1param4=
175+
car1value4=
176+
car1param5=
177+
car1value5=
178+
car2type=offline
179+
car2name=mein-anderes
180+
car2vin=0000000000
181+
car2capacity=50
182+
car2user=user
183+
car2pass=pass
184+
car2param1=
185+
car2value1=
186+
car2param2=
187+
car2value2=
188+
car2param3=
189+
car2value3=
190+
car2param4=
191+
car2value4=
192+
car2param5=
193+
car2value5=
175194
chargeminexcess=2000
176195
chargemaxgrid=2000
177196
chargeractuator=shellyplusplug

functions/storm.house.bash

Lines changed: 73 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,22 @@ setup_whitegood_config() {
260260
## #11 car 1 capacity
261261
## #12 car 1 username in car manufacturer's online portal
262262
## #13 car 1 password for account in car manufacturer's online portal
263-
## #14 car 1 hcaptcha token for account in car manufacturer's online portal
264-
## #15 car 2 type (from EVCC)
263+
## #14/#15-#22/#23 car 1 generic parameter #1-5 and values #1-5
264+
## e.g. for car 1 specific parameters CAR1PARAM[1-5] and values CAR1VALUE[1-5] like for tokens in car manufacturer's online portal
265+
## #24 car 2 type (from EVCC)
265266
## audi bmw carwings citroen ds opel peugeot fiat ford kia hyundai mini nissan niu tesla
266267
## renault ovms porsche seat skoda enyaq vw id volvo tronity
267-
## #16 car 2 name
268-
## #17 car 2 VIN Vehicle Identification Number
269-
## #18 car 2 capacity
270-
## #19 car 2 username in car manufacturer's online portal
271-
## #20 car 2 password for account in car manufacturer's online portal
272-
## #21 car 2 hcaptcha token for account in car manufacturer's online portal
273-
## #22 grid usage cost per kWh in EUR ("0.40")
274-
## #23 grid feedin compensation cost per kWh in EUR
275-
## #24 excess power required to start charging
276-
## #25 max power to get from grid while charging
277-
##
278-
## NOTE #14 #21 are new and not called with everywhere yet
279-
## => only use if >23 arguments
268+
## #25 car 2 name
269+
## #26 car 2 VIN Vehicle Identification Number
270+
## #27 car 2 capacity
271+
## #28 car 2 username in car manufacturer's online portal
272+
## #29 car 2 password for account in car manufacturer's online portal
273+
## #30/#31 - #38/#39 car 2 generic parameter #1-5 e.g. for car 2 specific parameters CAR2PARAM[1-5] and values CAR2VALUE[1-5]
274+
## #40 grid usage cost per kWh in EUR ("0.40")
275+
## #41 grid feedin compensation cost per kWh in EUR
276+
## #42 excess power required to start charging
277+
## #43 max power to get from grid while charging
278+
##
280279
##
281280
## setup_wb_config(String wallbox typ, .... ) - all arguments are of type String
282281
##
@@ -338,11 +337,12 @@ setup_wb_config() {
338337
temp="$(mktemp "${TMPDIR:-/tmp}"/evcc.XXXXX)"
339338
cp "${includesDir}/EVCC/evcc.yaml-template" "$temp"
340339

341-
if [[ $# -gt 23 ]]; then
342-
sed -e "s|%WBTYPE|${1:-${wallboxtype:-demo}}|;s|%IP|${2:-${wallboxip:-192.168.178.200}}|;s|%MBID|${3:-${wallboxmodbusid}}|;s|%WBUSER|${4:-${wallboxuser}}|;s|%WBPASS|${5:-${wallboxpass}}|;s|%WBID|${6:-${wallboxid}}|;s|%TOKEN|${token}|;s|%CARTYPE1|${8:-${cartype1:-offline}}|;s|%CARNAME1|${9:-${carname1:-meinEAuto1}}|;s|%VIN1|${10:-${vin1:-0000000000}}|;s|%CARCAPACITY1|${11:-${carcapacity1:-50}}|;s|%CARUSER1|${12:-${caruser1:-user}}|;s|%CARPASS1|${13:-${carpass1:-pass}}|;s|%CARTOKEN1|${14:-${cartoken1}}|;s|%CARTYPE2|${15:-${cartype2:-offline}}|;s|%CARNAME2|${16:-${carname2:-meinEAuto2}}|;s|%VIN2|${17:-${vin2:-0000000000}}|;s|%CARCAPACITY2|${18:-${carcapacity2:-50}}|;s|%CARUSER2|${19:-${caruser2:-user}}|;s|%CARPASS2|${20:-${carpass2:-pass}}|;s|%CARTOKEN2|${21:-${cartoken2}}|;s|%GRIDCOST|${22:-${gridcost:-40}}|;s|%FEEDINCOMPENSATION|${23:-${feedincompensation:-8.2}}|;s|%CHARGEMINEXCESS|${24:-${chargeminexcess:-2000}}|;s|%CHARGEMAXGRID|${25:-${chargemaxgrid:-2000}}|" "$temp" | grep -Evi ': NULL$' > "$evccConfig"
343-
else
344-
sed -e "s|%WBTYPE|${1:-${wallboxtype:-demo}}|;s|%IP|${2:-${wallboxip:-192.168.178.200}}|;s|%MBID|${3:-${wallboxmodbusid}}|;s|%WBUSER|${4:-${wallboxuser}}|;s|%WBPASS|${5:-${wallboxpass}}|;s|%WBID|${6:-${wallboxid}}|;s|%TOKEN|${token}|;s|%CARTYPE1|${8:-${cartype1:-offline}}|;s|%CARNAME1|${9:-${carname1:-meinEAuto1}}|;s|%VIN1|${10:-${vin1:-0000000000}}|;s|%CARCAPACITY1|${11:-${carcapacity1:-50}}|;s|%CARUSER1|${12:-${caruser1:-user}}|;s|%CARPASS1|${13:-${carpass1:-pass}}|;s|%CARTYPE2|${14:-${cartype2:-offline}}|;s|%CARNAME2|${15:-${carname2:-meinEAuto2}}|;s|%VIN2|${16:-${vin2:-0000000000}}|;s|%CARCAPACITY2|${17:-${carcapacity2:-50}}|;s|%CARUSER2|${18:-${caruser2:-user}}|;s|%CARPASS2|${19:-${carpass2:-pass}}|;s|%GRIDCOST|${20:-${gridcost:-40}}|;s|%FEEDINCOMPENSATION|${21:-${feedincompensation:-8.2}}|;s|%CHARGEMINEXCESS|${22:-${chargeminexcess:-2000}}|;s|%CHARGEMAXGRID|${23:-${chargemaxgrid:-2000}}|" "$temp" | grep -Evi ': NULL$' > "$evccConfig"
345-
fi
340+
341+
342+
#sed -e "s|%WBTYPE|${1:-${wallboxtype:-demo}}|;s|%IP|${2:-${wallboxip:-192.168.178.200}}|;s|%MBID|${3:-${wallboxmodbusid}}|;s|%WBUSER|${4:-${wallboxuser}}|;s|%WBPASS|${5:-${wallboxpass}}|;s|%WBID|${6:-${wallboxid}}|;s|%TOKEN|${token}|;s|%CAR1TYPE|${8:-${car1type:-offline}}|;s|%CAR1NAME|${9:-${car1name:-meinEAuto1}}|;s|%CAR1VIN|${10:-${car1vin:-0000000000}}|;s|%CAR1CAPACITY|${11:-${car1capacity:-50}}|;s|%CAR1USER|${12:-${car1user:-user}}|;s|%CAR1PASS|${13:-${car1pass:-pass}}|;s|%CAR1PARAM1|${14:-${car1param1}}|;s|%CAR1PARAM2|${15:-${car1param2}}|;s|%CAR1PARAM3|${16:-${car1param3}}|;s|%CAR1PARAM4|${17:-${car1param4}}|;s|%CAR1PARAM5|${18:-${car1param5}}|;s|%CAR2TYPE|${19:-${car2type:-offline}}|;s|%CAR2NAME|${20:-${car2name:-meinEAuto2}}|;s|%CAR2VIN|${21:-${car2vin:-0000000000}}|;s|%CAR2CAPACITY|${22:-${car2capacity:-50}}|;s|%CAR2USER|${23:-${car2user:-user}}|;s|%CAR2PASS|${24:-${car2pass:-pass}}|;s|%CAR2PARAM1|${25:-${car2param1}}|;s|%CAR2PARAM2|${26:-${car2param2}}|;s|%CAR2PARAM3|${27:-${car2param3}}|;s|%CAR2PARAM4|${28:-${car2param4}}|;s|%CAR2PARAM5|${29:-${car2param5}}|;s|%GRIDCOST|${30:-${gridcost:-40}}|;s|%FEEDINCOMPENSATION|${31:-${feedincompensation:-8.2}}|;s|%CHARGEMINEXCESS|${32:-${chargeminexcess:-2000}}|;s|%CHARGEMAXGRID|${33:-${chargemaxgrid:-2000}}|" "$temp" | grep -Evi ': NULL$' > "$evccConfig"
343+
344+
sed -e "s|%WBTYPE|${1:-${wallboxtype:-demo}}|;s|%IP|${2:-${wallboxip:-192.168.178.200}}|;s|%MBID|${3:-${wallboxmodbusid}}|;s|%WBUSER|${4:-${wallboxuser}}|;s|%WBPASS|${5:-${wallboxpass}}|;s|%WBID|${6:-${wallboxid}}|;s|%TOKEN|${token}|;s|%CAR1TYPE|${8:-${car1type:-offline}}|;s|%CAR1NAME|${9:-${car1name:-meinEAuto1}}|;s|%CAR1VIN|${10:-${car1vin:-0000000000}}|;s|%CAR1CAPACITY|${11:-${car1capacity:-50}}|;s|%CAR1USER|${12:-${car1user:-user}}|;s|%CAR1PASS|${13:-${car1pass:-pass}}|;s|%CAR1PARAM1|${14:-${car1param1}}|;s|%CAR1VALUE1|${15:-${car1value1}}|;s|%CAR1PARAM2|${16:-${car1param2}}|;s|%CAR1VALUE2|${17:-${car1value2}}|;s|%CAR1PARAM3|${18:-${car1param3}}|;s|%CAR1VALUE3|${19:-${car1value3}}|;s|%CAR1PARAM4|${20:-${car1param4}}|;s|%CAR1VALUE4|${21:-${car1value4}}|;s|%CAR1PARAM5|${22:-${car1param5}}|;s|%CAR1VALUE5|${23:-${car1value5}}|;s|%CAR2TYPE|${24:-${car2type:-offline}}|;s|%CAR2NAME|${25:-${car2name:-meinEAuto2}}|;s|%CAR2VIN|${26:-${car2vin:-0000000000}}|;s|%CAR2CAPACITY|${27:-${car2capacity:-50}}|;s|%CAR2USER|${28:-${car2user:-user}}|;s|%CAR2PASS|${29:-${car2pass:-pass}}|;s|%CAR2PARAM1|${30:-${car2param1}}|;s|%CAR2VALUE1|${31:-${car2value1}}|;s|%CAR2PARAM2|${32:-${car2param2}}|;s|%CAR2VALUE2|${33:-${car2value2}}|;s|%CAR2PARAM3|${34:-${car2param3}}|;s|%CAR2VALUE3|${35:-${car2value3}}|;s|%CAR2PARAM4|${36:-${car2param4}}|;s|%CAR2VALUE4|${37:-${car2value4}}|;s|%CAR2PARAM5|${38:-${car2param5}}|;s|%CAR2VALUE5|${39:-${car2value5}}|;s|%GRIDCOST|${40:-${gridcost:-40}}|;s|%FEEDINCOMPENSATION|${41:-${feedincompensation:-8.2}}|;s|%CHARGEMINEXCESS|${42:-${chargeminexcess:-2000}}|;s|%CHARGEMAXGRID|${43:-${chargemaxgrid:-2000}}|" "$temp" | grep -Evi ': NULL$' > "$evccConfig"
345+
346346
rm -f "${temp}"
347347

348348
if ! grep -Eq "[[:space:]]certificate" "${evccConfig}"; then
@@ -360,14 +360,49 @@ setup_wb_config() {
360360
if [[ ${5:-${wallboxpass}} != "" && ${5:-${wallboxpass}} != "NULL" ]]; then
361361
uncomment "#AUTHPASS" "${evccConfig}"
362362
fi
363-
if [[ $# -gt 23 ]]; then
364-
if [[ ${14:-${cartoken1}} != "" && ${14:-${cartoken1}} != "NULL" ]]; then
365-
uncomment "#CAPTCHA1" "${evccConfig}"
366-
fi
367-
if [[ ${21:-${cartoken2}} != "" && ${21:-${cartoken2}} != "NULL" ]]; then
368-
uncomment "#CAPTCHA2" "${evccConfig}"
369-
fi
363+
364+
if [[ ${14:-${car1param1}} != "" && ${14:-${car1param1}} != "NULL" ]]; then
365+
uncomment "#CAR1PARAM1" "${evccConfig}"
366+
fi
367+
if [[ ${15:-${car1param2}} != "" && ${15:-${car1param2}} != "NULL" ]]; then
368+
uncomment "#CAR1PARAM2" "${evccConfig}"
369+
fi
370+
if [[ ${16:-${car1param3}} != "" && ${16:-${car1param3}} != "NULL" ]]; then
371+
uncomment "#CAR1PARAM3" "${evccConfig}"
372+
fi
373+
if [[ ${17:-${car1param4}} != "" && ${17:-${car1param4}} != "NULL" ]]; then
374+
uncomment "#CAR1PARAM4" "${evccConfig}"
370375
fi
376+
if [[ ${18:-${car1param5}} != "" && ${18:-${car1param5}} != "NULL" ]]; then
377+
uncomment "#CAR1PARAM5" "${evccConfig}"
378+
fi
379+
if [[ ${25:-${car2param1}} != "" && ${25:-${car2param1}} != "NULL" ]]; then
380+
uncomment "#CAR2PARAM1" "${evccConfig}"
381+
fi
382+
if [[ ${26:-${car2param2}} != "" && ${26:-${car2param2}} != "NULL" ]]; then
383+
uncomment "#CAR2PARAM2" "${evccConfig}"
384+
fi
385+
if [[ ${27:-${car2param3}} != "" && ${27:-${car2param3}} != "NULL" ]]; then
386+
uncomment "#CAR2PARAM3" "${evccConfig}"
387+
fi
388+
if [[ ${28:-${car2param4}} != "" && ${28:-${car2param4}} != "NULL" ]]; then
389+
uncomment "#CAR2PARAM4" "${evccConfig}"
390+
fi
391+
if [[ ${29:-${car2param5}} != "" && ${29:-${car2param5}} != "NULL" ]]; then
392+
uncomment "#CAR2PARAM5" "${evccConfig}"
393+
fi
394+
395+
# ACHTUNG: Beim Aufruf aus Grundfunktionen.rules
396+
# für den Normalfall (= kein Autotyp, der besonderer Parameter bedarf) muss user/password angegeben werden
397+
# bei manchen Autotypen dürfen diese aber nicht benutzt werde (evcc startet dann mit "invalid parameter" nicht)
398+
# => user/pw aus param #12/#13 bzw. #28/#29 checken und nur uncommenten, wenn nicht NULL
399+
if [[ ${12:-${car1user}} != "" && ${12:-${car1user}} != "NULL" ]]; then
400+
uncomment "#CAR1USERPASS" "${evccConfig}"
401+
fi
402+
if [[ ${28:-${car2user}} != "" && ${28:-${car2user}} != "NULL" ]]; then
403+
uncomment "#CAR2USERPASS" "${evccConfig}"
404+
fi
405+
371406
if [[ ${1:-${wallboxtype}} == "demo" ]]; then
372407
rm -f "$evccConfig"
373408
fi
@@ -568,19 +603,22 @@ setup_telegram() {
568603
replace_logo() {
569604
local JAR
570605
# shellcheck disable=SC2125
571-
local logoInJAR=app/images/openhab-logo.svg
606+
#local logoInJAR=app/assets/openhab-logo*.svg
607+
local logoInJAR="app/images/openhab-logo*.svg app/assets/openhab-logo*.svg"
572608
local logoNew="${BASEDIR:-/opt/openhabian}/includes"/logo.svg
573609

574610

575611
# shellcheck disable=SC2012
576-
JAR=$(ls -1t /usr/share/openhab/runtime/system/org/openhab/ui/bundles/org.openhab.ui/*/org.openhab.ui-*|sort -ru|head -1)
577-
rm -rf "app" #rm -rf "$logoInJAR"
578-
# shellcheck disable=SC2086
579-
unzip -qq $JAR "$logoInJAR"
580-
cp "$logoNew" "$logoInJAR"
612+
JAR=$(ls -1t /usr/share/openhab/runtime/system/org/openhab/ui/bundles/org.openhab.ui/*/org.openhab.ui-*.jar | sort -ru | head -1)
613+
rm -rf "app"
581614
# shellcheck disable=SC2086
582-
if ! cond_redirect zip -r $JAR "$logoInJAR"; then echo "FAILED (replace logo)"; fi
583-
rm -rf "$logoInJAR"
615+
unzip -qq "$JAR" $logoInJAR
616+
# shellcheck disable=SC2045,SC2086
617+
for s in $(ls -1 $logoInJAR 2>/dev/null); do
618+
cp "$logoNew" "$s"
619+
done
620+
if ! cond_redirect zip -r "$JAR" app; then echo "FAILED (replace logo)"; fi
621+
rm -rf app
584622
}
585623

586624

includes/EVCC/evcc.yaml-template

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,33 @@ chargers:
7272

7373
vehicles:
7474
- type: template
75-
template: %CARTYPE1
76-
vin: %VIN1
77-
user: %CARUSER1
78-
password: %CARPASS1
79-
#CAPTCHA1 hcaptcha: %CARTOKEN1
80-
capacity: %CARCAPACITY1
81-
# language: de
75+
template: %CAR1TYPE
8276
name: meinEAuto1
83-
title: %CARNAME1
77+
title: %CAR1NAME
78+
vin: %CAR1VIN
79+
#CAR1USERPASS user: %CAR1USER
80+
#CAR1USERPASS password: %CAR1PASS
81+
#CAR1PARAM1 %CAR1PARAM1: %CAR1VALUE1
82+
#CAR1PARAM2 %CAR1PARAM2: %CAR1VALUE2
83+
#CAR1PARAM3 %CAR1PARAM3: %CAR1VALUE3
84+
#CAR1PARAM4 %CAR1PARAM4: %CAR1VALUE4
85+
#CAR1PARAM5 %CAR1PARAM5: %CAR1VALUE5
86+
capacity: %CAR1CAPACITY
87+
# language: de
88+
8489
- type: template
85-
template: %CARTYPE2
90+
template: %CAR2TYPE
8691
name: meinEAuto2
87-
title: %CARNAME2
88-
vin: %VIN2
89-
user: %CARUSER2
90-
password: %CARPASS2
91-
#CAPTCHA2 hcaptcha: %CARTOKEN2
92-
capacity: %CARCAPACITY2
92+
title: %CAR2NAME
93+
vin: %CAR2VIN
94+
#CAR2USERPASS user: %CAR2USER
95+
#CAR2USERPASS password: %CAR2PASS
96+
#CAR2PARAM1 %CAR2PARAM1: %CAR2VALUE1
97+
#CAR2PARAM2 %CAR2PARAM2: %CAR2VALUE2
98+
#CAR2PARAM3 %CAR2PARAM3: %CAR2VALUE3
99+
#CAR2PARAM4 %CAR2PARAM4: %CAR2VALUE4
100+
#CAR2PARAM5 %CAR2PARAM5: %CAR2VALUE5
101+
capacity: %CAR2CAPACITY
93102

94103
loadpoints:
95104
- title: Wallbox

0 commit comments

Comments
 (0)