DIY Mac Desktop Shortcuts (alias) to Switch/Lights

So I have certain triggers setup in my house for scenarios for my office lamp but I find myself at my desk randomly working and need to turn on my lamp across the desk. Now I could get up and turn it on, get my phone out and use smartthings or use oauth endpoints through a browser and turn it on. But all those options are boring…anywho.

Desktop shortcuts (alias) setup guide.

  1. First make a copy of the link from the oauth endpoint Tutorial: Creating a REST SmartApp Endpoint for the switch you wish to use. I used the toggle option.
  2. Open textedit on mac and type: curl -k -s
  3. Paste the link from step 1 after -s. so for example it would look like curl -k -s https://blahblahblah
  4. Press enter at the end of the link and paste command: kill -9 $(ps -p $(ps -p $PPID -o ppid=) -o ppid=)
  5. Save to desktop. Then rename the file with .command extension. The OS will ask if you want to rename to .command select .command
  6. open terminal and type chmod u+x and then drag and drop the file you just made into the window. example chmod u=x /desktop/Lamp.command
  7. press enter. this command lets you execute the command.
  8. to make it look a little better you can change the icon by right clicking the file and clicking get info. Then simply dragging an icon over the existing image.
  9. Rename the file without the extension to whatever you wish and you now have a neat little desktop icon to toggle your office lamp. Enjoy
1 Like

Or you can use StatusThing

I initially used it but it kept crashing and causing issues so i ended up giving up on the app. Update* I checked out the app with the latest update and get a chrome error with constant popups when I try to auth certain switches/lights, so again back to the original reason i did this.