diff --git a/modules/soc_audi/main.sh b/modules/soc_audi/main.sh index 8471cc523..18462fe51 100755 --- a/modules/soc_audi/main.sh +++ b/modules/soc_audi/main.sh @@ -9,17 +9,6 @@ if (( auditimer < 180 )); then fi echo $auditimer > /var/www/html/openWB/ramdisk/soctimer else - answer=$(sudo python3 /var/www/html/openWB/modules/soc_audi/Run.py $soc_audi_username $soc_audi_passwort) - vin=$(echo $answer | sed 's/.*: //' | head -c-3 | cut -c 2-) - acctoken=$(cat token.json | jq -r .access_token) - battsoc=$(curl -s --header "Accept: application/json" --header "X-App-Name: eRemote" --header "X-App-Version: 1.0.0" --header "User-Agent: okhttp/2.3.0" --header "Authorization: AudiAuth 1 $acctoken" https://msg.audi.de/fs-car/bs/batterycharge/v1/Audi/DE/vehicles/$vin/charger) - soclevel=$(echo $battsoc | jq .charger.status.batteryStatusData.stateOfCharge.content) - - re='^-?[0-9]+$' - if [[ $soclevel =~ $re ]] ; then - if (( $soclevel != 0 )) ; then - echo $soclevel > /var/www/html/openWB/ramdisk/soc - fi - fi + /var/www/html/openWB/modules/evcc-soc audi --user "$soc_audi_username" --password "$soc_audi_passwort" > /var/www/html/openWB/ramdisk/soc & echo 1 > /var/www/html/openWB/ramdisk/soctimer fi diff --git a/modules/soc_audilp2/main.sh b/modules/soc_audilp2/main.sh index aed154b93..85014f4ad 100755 --- a/modules/soc_audilp2/main.sh +++ b/modules/soc_audilp2/main.sh @@ -9,17 +9,7 @@ if (( auditimer < 180 )); then fi echo $auditimer > /var/www/html/openWB/ramdisk/soctimer1 else - answer=$(sudo python3 /var/www/html/openWB/modules/soc_audilp2/Run.py $soc2user $soc2pass) - vin=$(echo $answer | sed 's/.*: //' | head -c-3 | cut -c 2-) - acctoken=$(cat token.json | jq -r .access_token) - battsoc=$(curl -s --header "Accept: application/json" --header "X-App-Name: eRemote" --header "X-App-Version: 1.0.0" --header "User-Agent: okhttp/2.3.0" --header "Authorization: AudiAuth 1 $acctoken" https://msg.audi.de/fs-car/bs/batterycharge/v1/Audi/DE/vehicles/$vin/charger) - soclevel=$(echo $battsoc | jq .charger.status.batteryStatusData.stateOfCharge.content) + /var/www/html/openWB/modules/evcc-soc audi --user "$soc2user" --password "$soc2pass" > /var/www/html/openWB/ramdisk/soc1 & - re='^-?[0-9]+$' - if [[ $soclevel =~ $re ]] ; then - if (( $soclevel != 0 )) ; then - echo $soclevel > /var/www/html/openWB/ramdisk/soc1 - fi - fi echo 1 > /var/www/html/openWB/ramdisk/soctimer1 fi