From 55a24930018c90eb750023a1347205285635b504 Mon Sep 17 00:00:00 2001 From: Michael Staemmler Date: Wed, 5 Jun 2019 08:26:30 +0200 Subject: [PATCH 1/3] Small fix. --- web/setTheme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/setTheme.php b/web/setTheme.php index bc22e3365..b23167cbd 100644 --- a/web/setTheme.php +++ b/web/setTheme.php @@ -40,7 +40,7 @@
  • Zurück
  • Einstellungen
  • PV Ladeeinstellungen
  • -
  • Modulkonfiguration
  • +
  • Modulkonfiguration
  • Theme
  • Misc
  • From 8ceb8fafa537b5684806cf8db489be8076d531e5 Mon Sep 17 00:00:00 2001 From: snaptec Date: Thu, 6 Jun 2019 13:09:41 +0200 Subject: [PATCH 2/3] GSI graph, Zoevars added --- runs/atreboot.sh | 13 +++++++++++++ runs/cronnightly.sh | 3 ++- runs/gsiabfrage.sh | 15 +++++++++++++++ web/gsigraph.js | 29 +++++++++++++++++++++++++++++ web/modulconfig.php | 7 +++++++ web/settings.php | 11 ++++++++++- web/status.php | 11 +++++++++-- web/version | 2 +- 8 files changed, 86 insertions(+), 5 deletions(-) create mode 100755 runs/gsiabfrage.sh create mode 100644 web/gsigraph.js diff --git a/runs/atreboot.sh b/runs/atreboot.sh index 79c8ca156..cb15ded47 100755 --- a/runs/atreboot.sh +++ b/runs/atreboot.sh @@ -1213,6 +1213,18 @@ if ! grep -Fq "fsm63a3modbusllid=" /var/www/html/openWB/openwb.conf then echo "fsm63a3modbusllid=8" >> /var/www/html/openWB/openwb.conf fi +if ! grep -Fq "wakeupzoelp1=" /var/www/html/openWB/openwb.conf +then + echo "wakeupzoelp1=0" >> /var/www/html/openWB/openwb.conf +fi +if ! grep -Fq "wakeupzoelp2=" /var/www/html/openWB/openwb.conf +then + echo "wakeupzoelp2=0" >> /var/www/html/openWB/openwb.conf +fi +if ! grep -Fq "plz=" /var/www/html/openWB/openwb.conf +then + echo "plz=36124" >> /var/www/html/openWB/openwb.conf +fi ethstate=$( /var/log/openWB.log diff --git a/runs/gsiabfrage.sh b/runs/gsiabfrage.sh new file mode 100755 index 000000000..0ddbdb60b --- /dev/null +++ b/runs/gsiabfrage.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +. /var/www/html/openWB/openwb.conf +data=$(curl -s https://api.corrently.io/core/gsi?plz=$plz) +rm /var/www/html/openWB/ramdisk/gsiforecast.csv + +echo $data |jq -r '.forecast[] | "\(.epochtime) \(.gsi)"' | while read line +do + time=$(echo $line | awk '{print $1;}') + ftime=$(date -d@"$time" +%d"Day"-%H"H") + gsi=$(echo $line | awk '{print $2;}') + + echo "$ftime,$gsi" >> /var/www/html/openWB/ramdisk/gsiforecast.csv +done + diff --git a/web/gsigraph.js b/web/gsigraph.js new file mode 100644 index 000000000..57fb5643d --- /dev/null +++ b/web/gsigraph.js @@ -0,0 +1,29 @@ + +am4core.useTheme(am4themes_animated); +// Create chart instance +var chart = am4core.create("gsidiv", am4charts.XYChart); +// Set up data source +chart.dataSource.url = "/openWB/ramdisk/gsiforecast.csv"; +//} +chart.validateData(); +chart.dataSource.parser = new am4core.CSVParser(); +chart.dataSource.parser.options.useColumnNames = false; + +// Create axes +var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis()); +categoryAxis.dataFields.category = "col0"; + +// Create value axis +var valueAxis = chart.yAxes.push(new am4charts.ValueAxis()); +valueAxis.title.text = "GSI"; + +var series1 = chart.series.push(new am4charts.LineSeries()); +series1.dataFields.valueY = "col1"; +series1.dataFields.categoryX = "col0"; +series1.name = "gsi"; +series1.fill = am4core.color("#ff0000"); +series1.stroke = am4core.color("#ff0000"); +series1.strokeWidth = 3; +series1.strokeWidth = 1.5; +series1.fillOpacity = 0.3; +// Add legend diff --git a/web/modulconfig.php b/web/modulconfig.php index 446b4dcee..b89866468 100644 --- a/web/modulconfig.php +++ b/web/modulconfig.php @@ -465,6 +465,13 @@ function checkmodification(){ if(strpos($line, "zoelp2passwort=") !== false) { list(, $zoelp2passwortold) = explode("=", $line); } + if(strpos($line, "wakeupzoelp1=") !== false) { + list(, $wakeupzoelp1old) = explode("=", $line); + } + if(strpos($line, "wakeupzoelp2=") !== false) { + list(, $wakeupzoelp2old) = explode("=", $line); + } + if(strpos($line, "evnotifytoken=") !== false) { list(, $evnotifytokenold) = explode("=", $line); } diff --git a/web/settings.php b/web/settings.php index d01dc6754..2922aff87 100644 --- a/web/settings.php +++ b/web/settings.php @@ -48,7 +48,9 @@ if(strpos($line, "dspeed=") !== false) { list(, $dspeedold) = explode("=", $line); } - + if(strpos($line, "plz=") !== false) { + list(, $plzold) = explode("=", $line); + } if(strpos($line, "sdmids1=") !== false) { list(, $sdmids1old) = explode("=", $line); } @@ -420,7 +422,14 @@
    +
    + +
    +
    +
    + Gültige Werte z.B. 36124
    Dient zur Ermittlung des GSI Index. Weitere Infos unter: Hier
    Derzeit als optische Einbindung unter Status zu finden. Künftig Laden nach GSI möglich.

    +