Skip to content

Commit

Permalink
lastmanagement fuer Hauptladepunkt, Bezug/Einspeiseregelung PV Modus
Browse files Browse the repository at this point in the history
  • Loading branch information
snaptec committed Jun 12, 2018
1 parent 1fd3e3a commit f246952
Show file tree
Hide file tree
Showing 27 changed files with 10,646 additions and 178 deletions.
10,536 changes: 10,529 additions & 7 deletions openwb.conf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ramdisk/bezugkwh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8115674.300000001
0
2 changes: 1 addition & 1 deletion ramdisk/einspeisungkwh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2807752.9000000004
0
2 changes: 1 addition & 1 deletion ramdisk/lademodus
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2
0
2 changes: 1 addition & 1 deletion ramdisk/ladestatus
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
0
2 changes: 1 addition & 1 deletion ramdisk/llaltnv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
226
0
2 changes: 1 addition & 1 deletion ramdisk/llas11
Original file line number Diff line number Diff line change
@@ -1 +1 @@

0
2 changes: 1 addition & 1 deletion ramdisk/llhz
Original file line number Diff line number Diff line change
@@ -1 +1 @@
50
0
2 changes: 1 addition & 1 deletion ramdisk/llkwh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
499.73199462890625
0
2 changes: 1 addition & 1 deletion ramdisk/llpf1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
0
2 changes: 1 addition & 1 deletion ramdisk/llpf2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
0
2 changes: 1 addition & 1 deletion ramdisk/llpf3
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
0
2 changes: 1 addition & 1 deletion ramdisk/llsoll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6
0
2 changes: 1 addition & 1 deletion ramdisk/llv1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
227
0
2 changes: 1 addition & 1 deletion ramdisk/llv2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
227
0
2 changes: 1 addition & 1 deletion ramdisk/llv3
Original file line number Diff line number Diff line change
@@ -1 +1 @@
226
0
2 changes: 1 addition & 1 deletion ramdisk/pvkwh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
193.46200561523438
0
2 changes: 1 addition & 1 deletion ramdisk/pvwatt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2767
0
2 changes: 1 addition & 1 deletion ramdisk/soc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
99
0
1 change: 1 addition & 0 deletions ramdisk/soc1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
2 changes: 1 addition & 1 deletion ramdisk/wattbezug
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-1864
0
136 changes: 26 additions & 110 deletions regel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ $pvwattmodul != "none" ]]; then
else
pvwatt=0
fi
#Wattbezug
#Wattbezug i
if [[ $wattbezugmodul != "none" ]]; then
wattbezug=$(modules/$wattbezugmodul/main.sh)
if ! [[ $wattbezug =~ $re ]] ; then
Expand Down Expand Up @@ -126,56 +126,10 @@ fi
if grep -q 0 "/var/www/html/openWB/ramdisk/lademodus"; then
#zum test 1 durch 0 ersetzt
if [[ $lastmanagement == "0" ]]; then

# if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
# runs/$sofortll.sh
# if [[ $debug == "1" ]]; then
# echo starte sofort Ladeleistung von $sofortll aus
# fi
# exit 0
# fi
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
if grep -q $sofortll "/var/www/html/openWB/ramdisk/llsoll"; then
exit 0
else
runs/$sofortll.sh
if [[ $debug == "1" ]]; then
echo aendere sofort Ladeleistung auf $sofortll
fi
exit 0
fi
fi


# begrenzungap1=$(($lastmaxap1 - 6 ))
# begrenzungap2=$(($lastmaxap2 - 6 ))
# begrenzungap3=$(($lastmaxap3 - 6 ))
#
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
runs/$minimalstromstaerke.sh
if [[ $debug == "1" ]]; then
echo Starte sofort Ladeleistung mit Lastmanagement von $minimalstromstaerke aus
fi
exit 0
fi
# if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
# if [[ $lla1 > "2" ]] || [[ $lla2 > "2" ]] || [[ $lla3 > "2" ]]; then
# if (( $llalt < $sofortll )); then
# if ( $llalt >
# llneu=$((llalt + 1 ))
# runs/$llneu.sh
# fi
#
#
#
# fi


else
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
runs/$minimalstromstaerke.sh
if [[ $debug == "1" ]]; then
echo starte sofort Ladeleistung von $sofortll aus
echo starte sofort Ladeleistung von $minimalstromstaerke aus
fi
exit 0
fi
Expand Down Expand Up @@ -264,9 +218,9 @@ else
exit 0

fi



fi
else
if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
if grep -q $sofortll "/var/www/html/openWB/ramdisk/llsoll"; then
exit 0
else
Expand All @@ -276,7 +230,16 @@ else
fi
exit 0
fi
fi
fi
if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
runs/$minimalstromstaerke.sh
if [[ $debug == "1" ]]; then
echo Starte sofort Ladeleistung mit Lastmanagement von $minimalstromstaerke aus
fi
exit 0
fi


fi
fi

Expand Down Expand Up @@ -368,16 +331,13 @@ if (( $llalt > 3 )); then
anzahlphasen=$(cat /var/www/html/openWB/ramdisk/anzahlphasen)
fi



########################
# Berechnung für PV Regelung
mindestuberschussphasen=$(echo "($mindestuberschuss*$anzahlphasen)" | bc)
wattkombiniert=$(echo "($ladeleistung+$uberschuss)" | bc)
abschaltungw=$(echo "(($abschaltuberschuss-1320)*-1*$anzahlphasen)" | bc)
schaltschwelle=$(echo "(230*$anzahlphasen)" | bc)


if [[ $debug == "2" ]]; then
echo $date
echo uberschuss $uberschuss
Expand All @@ -390,7 +350,16 @@ schaltschwelle=$(echo "(230*$anzahlphasen)" | bc)
echo abschaltungw $abschaltungw
echo schaltschwelle $schaltschwelle
fi
#PV Regelmodus
if [[ $pvbezugeinspeisung == "0" ]]; then
pvregelungm="0"
fi


if [[ $pvbezugeinspeisung == "1" ]]; then
pvregelungm=$(echo "(230*$anzahlphasen*-1)" | bc)
schaltschwelle="0"
fi
########################
#Min Ladung + PV Uberschussregelung lademodus 1
if grep -q 1 "/var/www/html/openWB/ramdisk/lademodus"; then
Expand All @@ -413,7 +382,7 @@ if grep -q 1 "/var/www/html/openWB/ramdisk/lademodus"; then
fi

fi
if (( $uberschuss < 0 )); then
if (( $uberschuss < $pvregelungm )); then
if (( $llalt > $minimalstromstaerke )); then
llneu=$((llalt - 1 ))
runs/$llneu.sh
Expand Down Expand Up @@ -486,59 +455,6 @@ if grep -q 2 "/var/www/html/openWB/ramdisk/lademodus"; then
exit 0
fi
fi

# wenn evse bereits an, vergleiche ladestromstaerke und uberschuss und regle nach
# if (( $wattkombiniert < $abschaltungw )); then
# if grep -q 0 "/var/www/html/openWB/ramdisk/ladestatus"; then
# exit 0
# fi
# if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
#minimiere Ladeleistung bis kleinste stufe erreicht, dann schalte ab
# if (( $llalt > $minimalstromstaerke )); then
# llneu=$((llalt - 1 ))
# runs/$llneu.sh
# if [[ $debug == "1" ]]; then
# echo "pv ladung auf $llneu reduziert"
# fi
# exit 0
# else
# runs/0.sh
# exit 0
# fi
# fi
# else
# if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
# if (( $uberschuss < 0 )); then
# if (( $llalt == 0 )); then
# exit 0
# fi
# if (( $llalt > $minimalstromstaerke )); then
# llneu=$((llalt - 1 ))
# runs/$llneu.sh
# exit 0
# else
# runs/0.sh
# exit 0
# fi
# fi
# if (( $uberschuss > $schaltschwelle )); then
# if (( $llalt == $maximalstromstaerke )); then
# exit 0
# fi
# llneu=$((llalt + 1 ))
# if (( $llalt < $minimalstromstaerke )); then
# llneu=$minimalstromstaerke
# fi
# runs/$llneu.sh
# if [[ $debug == "1" ]]; then
# echo "pv ladung auf $llneu erhoeht"
# fi
# exit 0
# fi
# exit 0
# fi
# fi

if grep -q 1 "/var/www/html/openWB/ramdisk/ladestatus"; then
if (( $uberschuss > $schaltschwelle )); then
if (( $llalt == $maximalstromstaerke )); then
Expand All @@ -555,7 +471,7 @@ if grep -q 2 "/var/www/html/openWB/ramdisk/lademodus"; then
echo 0 > /var/www/html/openWB/ramdisk/pvcounter
exit 0
fi
if (( $uberschuss < 0 )); then
if (( $uberschuss < $pvregelungm )); then
if (( $llalt > $minimalstromstaerke )); then
llneu=$((llalt - 1 ))
runs/$llneu.sh
Expand Down
5 changes: 4 additions & 1 deletion runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,8 @@ else
sudo python /var/www/html/openWB/runs/ladetaster.py &
fi


if ! grep -Fq "pvbezugeinspeisung=" /var/www/html/openWB/openwb.conf
then
echo "pvbezugeinspeisung=0" >> /var/www/html/openWB/openwb.conf
fi

3 changes: 2 additions & 1 deletion runs/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sudo chmod +x /var/www/html/openWB/runs/*
sudo chmod 777 /var/www/html/openWB/ramdisk/*
sudo chmod 777 /var/www/html/openWB/web/lade.log
sleep 2
if ! grep -Fq "wr_http_w_url=" /var/www/html/openwb.conf
if ! grep -Fq "wr_http_w_url=" /var/www/html/openWB/openwb.conf
then
echo "wr_http_w_url=http://192.168.0.17/pvwatt.txt" >> /var/www/html/openWB/openwb.conf
fi
Expand Down Expand Up @@ -62,6 +62,7 @@ if ! grep -Fq "bezug_http_ekwh_url=" /var/www/html/openWB/openwb.conf
then
echo "bezug_http_ekwh_url=http://192.168.0.17/einspeisungwh.txt" >> /var/www/html/openWB/openwb.conf
fi

if [ ! -f /etc/php/7.0/apache2/conf.d/20-uploadlimit.ini ]; then
sudo /bin/su -c "echo 'upload_max_filesize = 30M' > /etc/php/7.0/apache2/conf.d/20-uploadlimit.ini"
fi
Expand Down
4 changes: 2 additions & 2 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function getfile() {
</button>
</div>
<div class="col-xs-6 text-center">
<button type="button" class="btn btn-primary btn-lg btn-block btn-blue">Ladeleistung Soll in A
<button type="button" class="btn btn-primary btn-lg btn-block btn-blue">Ladestromstaerke Soll in A
<div id="llsolldiv"></div>
</button>
</div>
Expand Down Expand Up @@ -342,7 +342,7 @@ function getfile() {
</div> -->
<div class="row">
<div class="col-xs-4">
Ver0.39
Ver0.40
</div>
<div class="col-xs-4 text-center">
<a href="http://openwb.de">www.openwb.de</a>
Expand Down
Loading

0 comments on commit f246952

Please sign in to comment.