Hi everyone,
I’ve found an easy solution to show values (like temperature, door open/closed etc.) inside your Notification Center on Mac OS X. Here’s what it looks like:
In order to get this running on your machine, install Today-Scripts (https://github.com/SamRothCA/Today-Scripts Today-Scripts) first. Then open the following URL: http://USER:PASS@pimatic/api/variables/
(Remember to change user/pass/url, of course)
There you’ll see a list of the names of the values you will be able to use later. In my case, I chose temp-aussen-strasse.temperature
which is the name of my outside temperature. Afterwards, add the following script inside the Today-Scripts section of your Notification center:
tput setaf 1; curl -s "http://USER:PASS@pimatic/api/variables/temp-aussen-strasse.temperature" | tail -n 5 | head -n 1 | sed 's/\"value\":\ //' | sed 's/\ \ \ \ //' | sed 's/,//' | sed 's/$/\ °C/'
Same as before: Don’t forget to use the correct URL; that means that you need to change your username, password, address and of course the name of your value. The same should go for any other temperature values; you’ll just need to change the name of the value.
If you want to change the color of your output, you might want to do a quick google search for “tput”. In the example above, I used the colourcode 1
, which colours your output red.
Feel free to ask any questions if you can’t get this running or if you want to display other values!
Cheers
ituri
P.S.: I know that the regular expressions used are ugly, but at least it does the job.