openSenseMap.org dashboard for gnome shell
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

00opensensemap.r.3m.sh 820B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. # export OSEM_BOX=yourboxid
  3. BOX=${OSEM_BOX:-5b26181b1fef04001b69093c}
  4. API="https://api.opensensemap.org"
  5. boxMeta=`curl "${API}/boxes/${BOX}"`
  6. sensors=`curl "${API}/boxes/${BOX}/sensors"`
  7. updated=`echo $boxMeta | jq -r '.lastMeasurementAt'`
  8. weblink=`echo $boxMeta | jq -r '.weblink'`
  9. name=`echo $boxMeta | jq -r '.name'`
  10. temp=`echo $sensors | jq -r '.sensors[0] | .lastMeasurement.value + .unit'`
  11. echo "$name 🌡 $temp"
  12. echo "---"
  13. echo $sensors | jq -r '.sensors[] | .title + ":\t\t" + .lastMeasurement.value + " " + .unit'
  14. echo "---"
  15. echo "🕗\tdata from `date -d $updated +'%d.%m. %H:%M'`"
  16. echo "⭮\trefresh | refresh=true"
  17. echo "---"
  18. echo "🗺view on openSenseMap.org | href='https://opensensemap.org/explore/$BOX'"
  19. [ ! $weblink == "null" ] && echo "🔗\topen weblink | href='$weblink'"