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

Test #2809

Closed
wants to merge 176 commits into from
Closed

Test #2809

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
3147fb5
Patch for u1p3p.sh to stop "flapping" 1/3 phases
Oct 11, 2021
52b2614
Alle 3 Vorschlaege: 1P3P-Flapping, 16A-Start bei 3P, 6/7-Flapping bei…
Oct 14, 2021
dfcc2b3
Update update.sh
matzempc Oct 19, 2021
14df011
Merge remote-tracking branch 'gvzdus/master'
matzempc Oct 19, 2021
ebc777a
Merge branch 'snaptec:master' into master
matzempc Oct 20, 2021
b43bd48
Revert "Merge remote-tracking branch 'gvzdus/master'"
matzempc Oct 21, 2021
11f3289
Merge branch 'snaptec:master' into master
matzempc Oct 22, 2021
3980b0a
Merge branch 'master' of https://github.com/matzempc/openWB
matzempc Oct 27, 2021
72dd8b2
Merge branch 'snaptec:master' into master
matzempc Oct 27, 2021
ba954f2
fix/beautify log output
matzempc Nov 3, 2021
88cde80
Merge branch 'master' of https://github.com/matzempc/openWB
matzempc Nov 3, 2021
aa8178e
go-e: read RFID also if go-e is second LP
matzempc Nov 3, 2021
cdece97
Merge branch 'snaptec:master' into master
matzempc Nov 3, 2021
f6cd246
goe: added RFID capability also for LP3
matzempc Nov 3, 2021
57d02ca
Merge branch 'master' of https://github.com/matzempc/openWB
matzempc Nov 3, 2021
f3ca496
1phase-3phases switch for goe (HW V3)
matzempc Nov 4, 2021
41f7be8
1phase-3phases switch for goe (HW V3) II
matzempc Nov 4, 2021
6686188
1phase-3phases switch for goe (HW V3) III
matzempc Nov 4, 2021
1d7e751
u1p3pcheck.sh - commented out goe start,stop,slowstart - could raise …
matzempc Nov 4, 2021
9a3c9ca
Merge branch 'goe-u1p3p-switch' into HEAD
matzempc Nov 4, 2021
e66c782
goe: lower ampere to min ampere PV on switching from 1 to 3 phases
matzempc Nov 5, 2021
77d48d0
goe u1p3p: set minampere BEFORE fsp cause switching phases takes some…
matzempc Nov 6, 2021
f2ae3b0
Merge branch 'snaptec:master' into master
matzempc Nov 6, 2021
10053d9
u1p3pgoe.py - PEP8 corrections
matzempc Nov 6, 2021
29fe4b3
Merge branch 'snaptec:master' into master
matzempc Nov 8, 2021
7d6eab1
goe: use new api V2 on main.sh
matzempc Nov 9, 2021
d56807f
u1p3pgoe.py PEP8 fixes
matzempc Nov 9, 2021
000bea2
Merge branch 'master' of https://github.com/matzempc/openWB
matzempc Nov 9, 2021
c3e0ba3
Merge branch 'snaptec:master' into goe_api_v2
matzempc Nov 12, 2021
74dd24d
Merge branch 'snaptec:master' into master
matzempc Nov 12, 2021
9d4fa55
goe: automatically select using API V1 or V2
matzempc Nov 12, 2021
48d5986
Merge branch 'goe_api_v2' of https://github.com/matzempc/openWB into …
matzempc Nov 12, 2021
765b6b7
goe: fixes for API V2
matzempc Nov 12, 2021
ec4013a
goe: remove debug messages
matzempc Nov 12, 2021
46a534e
goe: APIv2 set rfidtag to 0 if null from goE (which means no transact…
matzempc Nov 12, 2021
65eff06
goe: remove debug
matzempc Nov 12, 2021
f653190
goe: autodetect whether APIv2 is useable and use it if so
matzempc Nov 12, 2021
266fc3e
go-e: fixing new APIv2
matzempc Nov 13, 2021
0ccaeb8
goe 1p3p: use new APIv2 for setting values
matzempc Nov 13, 2021
32e3e4c
goe: APIv2 remove debug messages
matzempc Nov 13, 2021
388ccce
u1p3pgoe: fix change to APIv2 *argl*
matzempc Nov 13, 2021
2f2d2df
u1p3pgoe: fix change to APIv2 *argl* II
matzempc Nov 13, 2021
fc59fd1
u1p3pgoe: fix change to APIv2 *argl* III
matzempc Nov 13, 2021
c69b02d
Merge branch 'master' into goe_api_v2
matzempc Nov 13, 2021
9813768
Merge pull request #1 from matzempc/goe_api_v2
matzempc Nov 13, 2021
6e71bb7
goecheck: use new APIv2 also if goe is LP1 oder LP3
matzempc Nov 13, 2021
a04a70d
Merge branch 'goe_api_v2'
matzempc Nov 13, 2021
c5d0d9f
u1p3pgoe: further fixes for APIv2
matzempc Nov 13, 2021
7484254
Merge branch 'goe_api_v2'
matzempc Nov 13, 2021
57ea9b5
u1p3pgoe: beautification
matzempc Nov 13, 2021
b91a3c6
Merge branch 'goe_api_v2'
matzempc Nov 13, 2021
b64da29
Merge branch 'snaptec:master' into master
matzempc Nov 15, 2021
451b174
goe: Fix check for APIv1 vs. APIv2
matzempc Nov 15, 2021
d816960
goecheck: Fix detection of APIv1 vs. APIv2
matzempc Nov 15, 2021
4e2b898
goe: fix APIv1 vs. APIv2 detection
Nov 15, 2021
c24133b
goe: further fix and beautification APIv1 vs. APIv2 detection
Nov 15, 2021
6fdced9
goe: fix APIv1 vs. APIv2 detection III
Nov 15, 2021
5ef3db4
goe: fix copy&paste bug
Nov 15, 2021
ba6933e
goecheck: further copy&paste fixes
Nov 15, 2021
1b6c972
goe: autodetect and use APIv2 also for LP1 and LP3
Nov 15, 2021
ad00d10
Merge branch 'snaptec:master' into goe_api_v2
matzempc Nov 15, 2021
e71a9a2
goe: autodetect and use APIv2 also for LP3
Nov 15, 2021
1a58adf
Merge branch 'goe_api_v2' of https://github.com/matzempc/openWB into …
Nov 15, 2021
fcb329e
goe: fix chargestat and plugstat for LP3
Nov 15, 2021
6eb3b2b
goe: fix llkwh for LP3
Nov 15, 2021
d72e20e
Merge branch 'snaptec:master' into master
matzempc Nov 15, 2021
9ab09ca
Merge branch 'snaptec:master' into goe_api_v2
matzempc Nov 16, 2021
832de55
Merge branch 'snaptec:master' into master
matzempc Nov 16, 2021
02523bf
first step: adding state URL for http smarthome module
matzempc Nov 16, 2021
dc36c11
mqttsub: fix tabs space
matzempc Nov 16, 2021
d27c7b8
mqttsub: fix
matzempc Nov 16, 2021
1804714
Merge pull request #2 from matzempc/goe_api_v2
matzempc Nov 17, 2021
e773fba
Merge branch 'snaptec:master' into master
matzempc Nov 18, 2021
92234f3
Merge branch 'snaptec:master' into smarthome_http_stateurl
matzempc Nov 18, 2021
41515a2
Merge branch 'snaptec:master' into master
matzempc Nov 21, 2021
8a2ede0
Merge branch 'snaptec:master' into smarthome_http_stateurl
matzempc Nov 21, 2021
16b9dc0
Merge branch 'snaptec:master' into master
matzempc Nov 22, 2021
59c2361
Merge branch 'snaptec:master' into smarthome_http_stateurl
matzempc Nov 22, 2021
4405d98
Merge branch 'snaptec:master' into master
matzempc Nov 23, 2021
cf67ad0
Merge branch 'snaptec:master' into smarthome_http_stateurl
matzempc Nov 23, 2021
ce02c5d
Merge branch 'snaptec:master' into master
matzempc Nov 25, 2021
fa778ca
Merge branch 'snaptec:master' into smarthome_http_stateurl
matzempc Nov 25, 2021
a735cf6
Merge branch 'snaptec:master' into master
matzempc Nov 27, 2021
77a4c29
Merge branch 'snaptec:master' into smarthome_http_stateurl
matzempc Nov 27, 2021
8cd5d34
smarthome http: fix and hardened urlstate handling
matzempc Nov 27, 2021
c0beed5
smarthome http: set stateurl input to not required - shall be only op…
matzempc Nov 27, 2021
2983f3e
smarthome http: fix stateurl handling in case of is "none"
matzempc Nov 27, 2021
98b05a2
Merge branch 'master' into smarthome_http_stateurl
matzempc Nov 27, 2021
151ab28
web smarthome settings: http stateurl - fixed and adapted description
matzempc Nov 27, 2021
9a2728a
Merge branch 'smarthome_http_stateurl' of https://github.com/matzempc…
matzempc Nov 27, 2021
54ea420
Merge pull request #3 from matzempc/smarthome_http_stateurl
matzempc Nov 27, 2021
b0b0f1d
smarthome http: defensive programming / hardened watt.py on stateurl …
matzempc Nov 27, 2021
057c3d3
smarthome http: removed testvalue on watt.py
matzempc Nov 27, 2021
343a83f
Merge pull request #4 from matzempc/smarthome_http_stateurl_hardening
matzempc Nov 27, 2021
9312868
Merge branch 'snaptec:master' into master
matzempc Nov 30, 2021
7566374
Merge branch 'snaptec:master' into master
matzempc Dec 8, 2021
97e9c33
Merge branch 'snaptec:master' into master
matzempc Dec 9, 2021
ea08712
Merged
matzempc Dec 13, 2021
d0b0eba
fix merge
matzempc Dec 13, 2021
583a8fb
merge
matzempc Dec 13, 2021
325a45b
fix merge again *argl*
matzempc Dec 13, 2021
d1b450f
Merge branch 'snaptec:master' into master
matzempc Dec 14, 2021
11e8840
Merge branch 'snaptec:master' into master
matzempc Dec 14, 2021
35f619f
Merge branch 'snaptec:master' into master
matzempc Dec 16, 2021
12340c9
Merge branch 'snaptec:master' into master
matzempc Dec 17, 2021
6026aac
Merge branch 'snaptec:master' into master
matzempc Dec 17, 2021
0da57aa
wr_http: fix use http module from packages and convert pv-num to int
matzempc Dec 18, 2021
088fbf2
Merge branch 'snaptec:master' into master
matzempc Dec 18, 2021
24db26d
Merge branch 'snaptec:master' into wr_http_package_fix
matzempc Dec 18, 2021
6cde526
Merge pull request #6 from matzempc/wr_http_package_fix
matzempc Dec 18, 2021
412a7d5
Merge branch 'snaptec:master' into master
matzempc Dec 20, 2021
eb86458
Merge branch 'snaptec:master' into master
matzempc Dec 20, 2021
1cf3679
fix: http device dictionary access
matzempc Dec 20, 2021
847218e
Merge pull request #7 from matzempc/fix_http_device_counter_dict
matzempc Dec 20, 2021
1a46d81
merge
matzempc Dec 21, 2021
544c646
Merge branch 'snaptec-master'
matzempc Dec 21, 2021
b3aea82
Merge branch 'snaptec:master' into master
matzempc Dec 26, 2021
3055efe
Merge branch 'snaptec:master' into master
matzempc Jan 3, 2022
b136d8c
Merge branch 'snaptec:master' into master
matzempc Jan 5, 2022
60dc4db
Merge branch 'snaptec:master' into master
matzempc Jan 16, 2022
66885dc
Merge branch 'snaptec:master' into master
matzempc Feb 1, 2022
3762d44
Merge branch 'snaptec:master' into master
matzempc Feb 23, 2022
67c1644
Merge branch 'snaptec:master' into master
matzempc Feb 25, 2022
568d1c8
Merge branch 'snaptec:master' into master
matzempc Mar 15, 2022
b289f41
Merge branch 'snaptec:master' into master
matzempc Apr 4, 2022
f20fe66
Merge branch 'snaptec:master' into master
matzempc Apr 9, 2022
b16761c
Merge branch 'snaptec:master' into master
matzempc Apr 11, 2022
39a4ef0
Merge branch 'snaptec-master'
matzempc Apr 13, 2022
bf25a18
Merge branch 'snaptec:master' into master
matzempc Apr 26, 2022
9a1b017
Merge branch 'snaptec:master' into master
matzempc May 10, 2022
ab5881d
fix(goe): prevent continously reset of current when llsoll (wanted cu…
matzempc May 10, 2022
edbefc0
Merge pull request #10 from matzempc/goe_prevent_reset_current_when_zero
matzempc May 10, 2022
1e127dd
u1p3p: only switch from 3 to 1 phase if either a car is loading or re…
matzempc May 12, 2022
494b8de
u1p3p: avoid switching only when loading check not necessary for 1to3…
matzempc May 12, 2022
38063b3
goecheck: beautification
matzempc May 12, 2022
299fd9d
u1p3pcheck: check for uberschuss on reducing not necessary in case of…
matzempc May 13, 2022
773f893
Merge pull request #11 from matzempc/u1p3p_only_charging
matzempc May 16, 2022
77f4005
Merge branch 'snaptec:master' into master
matzempc May 16, 2022
479a807
Merge branch 'snaptec-master' into mergesnaptec
matzempc May 17, 2022
04e5077
Merge pull request #15 from matzempc/mergesnaptec
matzempc May 17, 2022
dc09b7d
fix http module crash: initialization of device_config done after fir…
matzempc May 17, 2022
937ac94
Merge pull request #16 from matzempc/fix_http_module
matzempc May 17, 2022
5ebf19f
Merge branch 'snaptec:master' into master
matzempc May 18, 2022
11c7e42
fix(set-current): fixed merge
matzempc May 19, 2022
e081b88
Merge branch 'master' of https://github.com/matzempc/openWB
matzempc May 19, 2022
0999b2c
Merge branch 'snaptec:master' into master
matzempc May 19, 2022
8906be2
chore(u1p3pcheck): fix - added goelp3 for 1 phase change, beautificat…
matzempc May 19, 2022
d82edc1
Merge pull request #17 from matzempc/goe_u1p3p_switch_verbose_and_lp3
matzempc May 19, 2022
1bd0362
Merge branch 'snaptec-master' into merge-snaptec
May 25, 2022
7ef998e
Merge pull request #19 from matzempc/merge-snaptec
matzempc May 25, 2022
652bc94
Merge branch 'snaptec:master' into master
matzempc May 29, 2022
aa16876
goecheck: fix merge
matzempc May 31, 2022
605dbff
Merge branch 'snaptec:master' into master
matzempc Jun 20, 2022
47b1b74
Merge branch 'snaptec:master' into master
matzempc Jun 30, 2022
0a5ba6f
Merge branch 'snaptec-master' into merger
matzempc Jul 4, 2022
4813b57
Merge pull request #20 from matzempc/merger
matzempc Jul 4, 2022
b7e5f94
fix(goecheck): HW3 - set force to 1 (disabled) also on frc=2
matzempc Jul 5, 2022
cddcb17
Merge branch 'snaptec:master' into master
matzempc Jul 6, 2022
422f5cf
Merge branch 'snaptec:master' into master
matzempc Jul 12, 2022
df7a6a3
Merge branch 'snaptec:master' into master
matzempc Jul 19, 2022
c279b0e
Merge branch 'snaptec:master' into master
matzempc Jul 25, 2022
c5298cf
Merge branch 'snaptec-master' into merge_snaptec
matzempc Aug 3, 2022
06f6b0a
Merge pull request #22 from matzempc/merge_snaptec
matzempc Aug 3, 2022
8153e5f
Merge branch 'snaptec:master' into master
matzempc Sep 6, 2022
0816031
Merge branch 'snaptec:master' into master
matzempc Oct 4, 2022
6f33d28
Merge branch 'snaptec:master' into master
matzempc Oct 5, 2022
65d26c2
Merge branch 'snaptec:master' into master
matzempc Oct 6, 2022
f20e6de
Merge branch 'snaptec:master' into master
matzempc Oct 11, 2022
aba0685
Merge branch 'snaptec:master' into master
matzempc Oct 20, 2022
9d217fe
Merge branch 'snaptec:master' into master
matzempc Nov 2, 2022
66665c7
Merge remote-tracking branch 'upstream/master' into merge_snaptec
matzempc Feb 6, 2023
eb38044
Merge remote-tracking branch 'upstream/master' into merge_snaptec
matzempc Feb 6, 2023
8a70735
Merge branch 'merge_snaptec'
matzempc Feb 6, 2023
438f8dc
Merge branch 'snaptec:master' into master
matzempc Feb 16, 2023
d83be7d
Merge branch 'snaptec:master' into master
matzempc Mar 6, 2023
e1176fc
Merge remote-tracking branch 'upstream/master'
matzempc Jan 11, 2024
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
163 changes: 117 additions & 46 deletions goecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,24 @@
goecheck(){
#######################################
#goe mobility check
digit='^[0-9]$'

if [[ $evsecon == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp1/status)
if [[ $? == "0" ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
lp1enabled=$(</var/www/html/openWB/ramdisk/lp1enabled)
if ((state == "0")) && (( lp1enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=0 > /dev/null
fi
fi

version=$(echo $output | jq -r '.fwv') # get firmware version
majorVersion=${version%.*} # remove everything after a "."
majorVersion=${majorVersion%-*} # remove everything after a "-"
majorVersion=${majorVersion#0} # remove leading "0"


oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsoll)
if (( oldcurrent != $current )) && (( $current != 0 )); then
if (($majorVersion >= 40)) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=amx=$current > /dev/null
else
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=amp=$current > /dev/null
fi
fi
fi
fi
if [[ $lastmanagement == "1" ]]; then
if [[ $evsecons1 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp2/status)
if [[ $? == "0" ]] ; then
#check whether goe has 1to3phase switch capability => new HWV3 and new API V2
fsp=$(echo $output | jq -r '.fsp')
if [[ ! $fsp =~ $digit ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
lp2enabled=$(</var/www/html/openWB/ramdisk/lp2enabled)
if ((state == "0")) && (( lp2enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=1 > /dev/null
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
lp1enabled=$(</var/www/html/openWB/ramdisk/lp1enabled)
if ((state == "0")) && (( lp1enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=0 > /dev/null
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=alw=0 > /dev/null
fi
fi

Expand All @@ -57,25 +28,104 @@ goecheck(){
majorVersion=${majorVersion%-*} # remove everything after a "-"
majorVersion=${majorVersion#0} # remove leading "0"


oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls1)
current=$(</var/www/html/openWB/ramdisk/llsoll)
if (( oldcurrent != $current )) && (( $current != 0 )); then
if (($majorVersion >= 40)) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=amx=$current > /dev/null
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=amx=$current > /dev/null
else
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=amp=$current > /dev/null
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/mqtt?payload=amp=$current > /dev/null
fi
fi
else
output=$(curl --connect-timeout 1 -s http://$goeiplp1/api/status)
state=$(echo $output | jq -r '.frc')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
lp1enabled=$(</var/www/html/openWB/ramdisk/lp1enabled)
if ((state == "1")) && (( lp1enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/api/set?frc=0 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
if (( state == "0" )) || (( state == "2" )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/api/set?frc=1 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsoll)
if (( oldcurrent != $current )) && (( $current != 0 )) ; then
curl --silent --connect-timeout $goetimeoutlp1 -s http://$goeiplp1/api/set?amp=$current > /dev/null
fi
fi
fi
fi
if [[ $lastmanagement == "1" ]]; then
if [[ $evsecons1 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp2/status)
if [[ $? == "0" ]] ; then
#check whether goe has 1to3phase switch capability => new HWV3 and new API V2
fsp=$(echo $output | jq -r '.fsp')
if [[ ! $fsp =~ $digit ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
lp2enabled=$(</var/www/html/openWB/ramdisk/lp2enabled)
if ((state == "0")) && (( lp2enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=1 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
if ((state == "1")) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=alw=0 > /dev/null
fi
fi
version=$(echo $output | jq -r '.fwv') # get firmware version
majorVersion=${version%.*} # remove everything after a "."
majorVersion=${majorVersion%-*} # remove everything after a "-"
majorVersion=${majorVersion#0} # remove leading "0"

oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls1)
if (( oldcurrent != $current )) && (( $current != 0 )); then
if (($majorVersion >= 40)) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=amx=$current > /dev/null
else
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/mqtt?payload=amp=$current > /dev/null
fi
fi
else
output=$(curl --connect-timeout 1 -s http://$goeiplp2/api/status)
state=$(echo $output | jq -r '.frc')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
lp2enabled=$(</var/www/html/openWB/ramdisk/lp2enabled)
if ((state == "1")) && (( lp2enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/api/set?frc=0 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss1"; then
if (( state == "0" )) || (( state == "2" )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/api/set?frc=1 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls1)
if (( oldcurrent != $current )) && (( $current != 0 )) ; then
curl --silent --connect-timeout $goetimeoutlp2 -s http://$goeiplp2/api/set?amp=$current > /dev/null
fi
fi
fi
fi
if [[ $lastmanagements2 == "1" ]]; then
if [[ $evsecons2 == "goe" ]]; then
output=$(curl --connect-timeout 1 -s http://$goeiplp3/status)
if [[ $? == "0" ]] ; then
output=$(curl --connect-timeout 1 -s http://$goeiplp3/status)
if [[ $? == "0" ]] ; then
#check whether goe has 1to3phase switch capability => new HWV3 and new API V2
fsp=$(echo $output | jq -r '.fsp')
if [[ ! $fsp =~ $digit ]] ; then
state=$(echo $output | jq -r '.alw')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
lp3enabled=$(</var/www/html/openWB/ramdisk/lp3enabled)
if ((state == "0")) && (( lp3enabled == "1" )) ; then
if ((state == "0")) && (( lp3enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=alw=1 > /dev/null
fi
fi
Expand All @@ -92,15 +142,36 @@ goecheck(){

oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls2)

if (( oldcurrent != $current )) ; then
if (($majorVersion >= 40)) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=amx=$current > /dev/null
else
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/mqtt?payload=amp=$current > /dev/null
fi
fi
else
output=$(curl --connect-timeout 1 -s http://$goeiplp3/api/status)
state=$(echo $output | jq -r '.frc')
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
lp3enabled=$(</var/www/html/openWB/ramdisk/lp3enabled)
if (( state == "1" )) && (( lp3enabled == "1" )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/api/set?frc=0 > /dev/null
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatuss2"; then
if (( state == "0" )) || (( state == "2" )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/api/set?frc=1 > /dev/null
fi
fi
oldcurrent=$(echo $output | jq -r '.amp')
current=$(</var/www/html/openWB/ramdisk/llsolls2)
if (( oldcurrent != $current && $current != 0 )) ; then
curl --silent --connect-timeout $goetimeoutlp3 -s http://$goeiplp3/api/set?amp=$current > /dev/null
fi
fi
fi
fi
fi
fi
}
Loading
Loading