add first scripts to get water levels.
This commit is contained in:
10
scripts/0BUILD
Normal file
10
scripts/0BUILD
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml?>
|
||||
|
||||
<gwbuild>
|
||||
|
||||
<data dist="true" install="$(pkgdatadir)/scripts">
|
||||
getlevel-nlwkn.sh
|
||||
getlevel-wsv.sh
|
||||
</data>
|
||||
|
||||
</gwbuild>
|
||||
34
scripts/getlevel-nlwkn.sh
Executable file
34
scripts/getlevel-nlwkn.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# see https://www.pegelonline.nlwkn.niedersachsen.de/pdf/BenutzerhandbuchWebservicePegelonline.pdf
|
||||
|
||||
JSONFILE="/tmp/pegel-nlwkn.json"
|
||||
AQHOME_TOOL="./aqhome-tool.sh"
|
||||
# AQHOME_TOOL="/usr/local/bin/aqhome-tool"
|
||||
|
||||
|
||||
STATION_ID="$1"
|
||||
WATER_NAME="$2"
|
||||
LOCATION="$3"
|
||||
|
||||
if test -z "$STATION_ID"; then
|
||||
echo "Usage: $0 STATION_ID WATER_NAME LOCATION"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if test -z "$WATER_NAME"; then
|
||||
echo "Usage: $0 STATION_ID WATER_NAME LOCATION"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if test -z "$LOCATION"; then
|
||||
echo "Usage: $0 STATION_ID WATER_NAME LOCATION"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
#
|
||||
# 106 for Fuhse/Wathlingen
|
||||
#
|
||||
if ( curl -s -S https://bis.azure-api.net/PegelonlinePublic/REST/station/$STATION_ID/datenspuren/parameter/1/tage/-1?key=9dc05f4e3b4a43a9988d747825b39f43 -o $JSONFILE ); then
|
||||
$AQHOME_TOOL addjsondata -J $JSONFILE -c pegel -d "$WATER_NAME/$LOCATION" -N "current" -v "@getPegelDatenspurenResult/Parameter/Datenspuren/AktuellerMesswert" -U "@getPegelDatenspurenResult/Parameter/Einheit"
|
||||
fi
|
||||
37
scripts/getlevel-wsv.sh
Executable file
37
scripts/getlevel-wsv.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# see https://www.pegelonline.wsv.de/webservice/guideRestapi
|
||||
|
||||
JSONFILE="/tmp/pegel-wsv.json"
|
||||
AQHOME_TOOL="./aqhome-tool.sh"
|
||||
# AQHOME_TOOL="/usr/local/bin/aqhome-tool"
|
||||
|
||||
|
||||
|
||||
STATION_ID="$1"
|
||||
WATER_NAME="$2"
|
||||
LOCATION="$3"
|
||||
|
||||
|
||||
if test -z "$STATION_ID"; then
|
||||
echo "Usage: $0 STATION_ID WATER_NAME LOCATION"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if test -z "$WATER_NAME"; then
|
||||
echo "Usage: $0 STATION_ID WATER_NAME LOCATION"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if test -z "$LOCATION"; then
|
||||
echo "Usage: $0 STATION_ID WATER_NAME LOCATION"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
#
|
||||
# b475386c-30cc-453a-b3b7-1d17ace13595 for Aller at Celle
|
||||
#
|
||||
if ( curl -s -S https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/$STATION_ID/W/currentmeasurement.json -o $JSONFILE ); then
|
||||
$AQHOME_TOOL addjsondata -J $JSONFILE -c pegel -d ""$WATER_NAME/$LOCATION"" -N "current" -v "@value" -U "cm"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user