Hi all,
this is the solution. I create an account on OpenSensemap and wrote a short script to upload my measurements or get them.
Here my script as example:
#!/bin/bash
# Werte nach OpenSenseMap posten bzw. holen
# ------------------------------------------------------------------------------
mode=$1
type=$2
value=$3
postValue='{"value":'$value'}'
post ()
{
case $type in
tempRef) curl -H "Content-Type: application/json" -X POST -d $postValue https://api.opensensemap.org/boxes/:boxID/:sensorID ;;
tempSonne) curl -H "Content-Type: application/json" -X POST -d $postValue https://api.opensensemap.org/boxes/:boxID/:sensorID ;;
lux) curl -H "Content-Type: application/json" -X POST -d $postValue https://api.opensensemap.org/boxes/:boxID/:sensorID ;;
esac
}
get ()
{
case $type in
tempRef) curl -s https://api.opensensemap.org/boxes/:boxID | jq -r '.sensors[0].lastMeasurement.value' ;;
tempSonne) curl -s https://api.opensensemap.org/boxes/:boxID | jq -r '.sensors[1].lastMeasurement.value' ;;
lux) curl -s https://api.opensensemap.org/boxes/:boxID | jq -r '.sensors[2].lastMeasurement.value' ;;
esac
}
case $mode in
post) post ;;
get) get ;;
esac
# ------------------------------------------------------------------------------
exit 0
A rule for upload:
When $temperature changes then execute "sh .../.../script.sh post temp $temperature >/dev/null 2>&1"
Get it into a ShellSensor with command:
sh .../.../script.sh get temp
You need the program ‘jq’ as mentioned in this post.
sudo apt-get install jq
That’s it!