forked from snaptec/openWB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/snaptec/openWB
- Loading branch information
Showing
23 changed files
with
653 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,57 @@ | ||
#!/bin/bash | ||
soctimer=$(</var/www/html/openWB/ramdisk/soctimer) | ||
|
||
#soc_bluelink_email='[email protected]' | ||
#soc_bluelink_password='xxx' | ||
#soc_bluelink_pin='xxx' | ||
#soc_bluelink_interval='5' | ||
OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) | ||
RAMDISKDIR="$OPENWBBASEDIR/ramdisk" | ||
MODULEDIR=$(cd `dirname $0` && pwd) | ||
LOGFILE="$RAMDISKDIR/soc.log" | ||
CHARGEPOINT=$1 | ||
|
||
tmpintervall=$(( soc_bluelink_interval * 6 )) | ||
socDebug=$debug | ||
# for developement only | ||
socDebug=1 | ||
|
||
if (( soctimer < tmpintervall )); then | ||
soctimer=$((soctimer+1)) | ||
echo $soctimer > /var/www/html/openWB/ramdisk/soctimer | ||
case $CHARGEPOINT in | ||
2) | ||
# second charge point | ||
soctimerfile="$RAMDISKDIR/soctimer1" | ||
socfile="$RAMDISKDIR/soc1" | ||
bluelink_email=$soc2user | ||
bluelink_password=$soc2pass | ||
bluelink_pin=$soc2pin | ||
bluelink_intervall=20 | ||
;; | ||
*) | ||
# defaults to first charge point for backward compatibility | ||
# set CHARGEPOINT in case it is empty (needed for logging) | ||
CHARGEPOINT=1 | ||
soctimerfile="$RAMDISKDIR/soctimer" | ||
socfile="$RAMDISKDIR/soc" | ||
bluelink_email=$soc_bluelink_email | ||
bluelink_password=$soc_bluelink_password | ||
bluelink_pin=$soc_bluelink_pin | ||
bluelink_intervall=$soc_bluelink_interval | ||
;; | ||
esac | ||
|
||
socDebugLog(){ | ||
if (( $socDebug > 0 )); then | ||
timestamp=`date --rfc-3339=seconds` | ||
echo "$timestamp: Lp$CHARGEPOINT: $@" >> $LOGFILE | ||
fi | ||
} | ||
|
||
soctimervalue=$(<$soctimerfile) | ||
|
||
tmpintervall=$(( bluelink_intervall * 6 )) | ||
|
||
socDebugLog "SoCtimer: $soctimervalue, SoCIntervall: $tmpintervall" | ||
|
||
if (( soctimervalue < tmpintervall )); then | ||
socDebugLog "Nothing to do yet. Incrementing timer." | ||
soctimervalue=$((soctimervalue+1)) | ||
echo $soctimervalue > $soctimerfile | ||
else | ||
/var/www/html/openWB/modules/evcc-soc hyundai --user $soc_bluelink_email --password $soc_bluelink_password --pin $soc_bluelink_pin > /var/www/html/openWB/ramdisk/soc & | ||
echo 0 > /var/www/html/openWB/ramdisk/soctimer | ||
socDebugLog "Requesting SoC" | ||
$MODULEDIR/../evcc-soc hyundai --user $soc_bluelink_email --password $soc_bluelink_password --pin $soc_bluelink_pin > $socfile & | ||
echo 0 > $soctimerfile | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
#!/bin/bash | ||
soctimer=$(</var/www/html/openWB/ramdisk/soctimer1) | ||
|
||
tmpintervall=120 | ||
OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) | ||
|
||
if (( soctimer < tmpintervall )); then | ||
soctimer=$((soctimer+1)) | ||
echo $soctimer > /var/www/html/openWB/ramdisk/soctimer1 | ||
else | ||
/var/www/html/openWB/modules/evcc-soc hyundai --user $soc2user --password $soc2pass --pin $soc2pin > /var/www/html/openWB/ramdisk/soc1 & | ||
echo 0 > /var/www/html/openWB/ramdisk/soctimer1 | ||
fi | ||
# for backward compatibility only | ||
# functionality is in soc_bluelink | ||
$OPENWBBASEDIR/modules/soc_bluelink/main.sh 2 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.