Hallo,
hier ein kleines Howto wie man die aktuelle Aussentemperatur aus dem Internet auf seinen KNX-Bus bekommt:
Der Shellscript (/usr/scripts/aussenTemp/putAussenTemp):
an die Linuxrechte denke:
Die Config für linknx.xml:
Weiteres zu dem InternetWeatherServices:
Aktuelle Wetter Information
und
Germany / Weather Location Codes/IDs
Gruß und Viel Spass :-)
hier ein kleines Howto wie man die aktuelle Aussentemperatur aus dem Internet auf seinen KNX-Bus bekommt:
Der Shellscript (/usr/scripts/aussenTemp/putAussenTemp):
Code:
#!/bin/bash
#
#
##############
# WEATHER LOCATION German overview >>> http://edg3.co.uk/snippets/weather-location-codes/germany/
LOCATION="GMXX0018" # COLOGNE
# LINKNX Object
OBJECTID="temp_aussen"
RESULT=$(wget -qO- "http://weather.tuxnet24.de/?id=$LOCATION")
RC=$?
if [ $RC -eq 0 ]; then
CURRENTTEMP=$(echo "$RESULT" | grep current_temp | awk {'print $3'})
# echo $CURRENTTEMP # DEBUG
printf '<write><object id="%s" value=%s /></write>\4' "$OBJECTID" "$CURRENTTEMP" | netcat localhost 1028 > /dev/null 2>&1
else
echo "$(date) - cant connect weather server"
fi
Code:
chmod 755 /usr/scripts/aussenTemp/putAussenTemp
Code:
...
<object id="temp_aussen" gad="0/1/10" type="9.xxx" flags="cwtus" log="true">TempAussen</object>
...
<!-- update der aussen Temp alle 15min -->
<rule id="sendAussenTemp">
<condition type="timer" trigger="true">
<every>900</every>
</condition>
<actionlist>
<action type="shell-cmd" cmd="/usr/scripts/aussenTemp/putAussenTemp" />
</actionlist>
</rule>
...
Aktuelle Wetter Information
und
Germany / Weather Location Codes/IDs
Gruß und Viel Spass :-)



Kommentar