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.
- 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.
- Open textedit on mac and type: curl -k -s
- Paste the link from step 1 after -s. so for example it would look like curl -k -s https://blahblahblah
- Press enter at the end of the link and paste command: kill -9 $(ps -p $(ps -p $PPID -o ppid=) -o ppid=)
- Save to desktop. Then rename the file with .command extension. The OS will ask if you want to rename to .command select .command
- 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
- press enter. this command lets you execute the command.
- 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.
- 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