Monday, January 30, 2017

Home Automation via MacOS Command Line

Read my post on how to setup commands on your Mac to control your home automation platform from the command line - http://ift.tt/2jHexBN



via Tumblr http://ift.tt/2jmZqPo

Sunday, January 29, 2017

Home Automation via MacOS Command Line

Apple added Siri to MacOS but Siri on the Mac cannot issue HomeKit commands or commands to devices that are not HomeKit compatible. Siri can be used to send SMS messages to an IFTTT phone channel which can trigger an IFTTT applet that sends commands to your Harmony or other devices and activities. Here is what you have to do to setup Harmony activities, IFTTT applets, and MacOS commands to control your activities and devices from the command line on a Mac/Macbook.


Step 1 - Create Harmony Activities


This article uses the Logitech Harmony home automation platform to demonstrate automated control of devices and activities. I own the Harmony Elite:
    http://www.logitech.com/en-us/product/harmony-elite

Any platform that provides IFTTT support can be used in a similar manner.

In order for IFTTT to issue commands to the Harmony system you must first create Harmony Activities. Use the Harmony application on your iPad or iPhone to create activities. I have created activities to "Watch TV", "Play Blu-Ray", "Watch Apple TV", and so on. These activities combine the devices and commands to those devices necessary to start and end the activity. For instance, to start the "Watch TV" activity the TV is turned on and set to HDMI 1, the Receiver is turned on and set to TV/SAT, and the TiVo Roamio Pro is powered on. Similar sets of devices and actions are used to create the other activities.

Step 2 - Create An IFTTT Account and Phone Channel

Create an account with IFTTT at https://ifttt.com and you will be assigned an IFTTT phone number:
    https://ifttt.com/services/phone_call/settings
You will use this phone number as the recipient for SMS messages that contain triggers for IFTTT applets.

Step 3 - Connect IFTTT Services

For this demonstration we will need to connect the SMS and Harmony services to our IFTTT account. Login at IFTTT, click the Search link and enter "SMS" in the search text field. Configure and connect the IFTTT SMS service. Similarly, search for "Harmony" (or the service that controls your home automation platform),  configure and connect the Harmony IFTTT service.

Step 4 - Create IFTTT Applets

You can create IFTTT Applets that use the IFTTT services you have connected to your account. In this example we use the SMS and  Harmony services. Login at IFTTT, click your IFTTT user name and select "New Applet" from the dropdown menu or go to https://ifttt.com/create

Click the "+ this" link and search for the SMS service. Click the SMS service box. Click the "Send IFTTT an SMS tagged" box. Make sure it is the "tagged" box and not the "... any SMS" box. Enter the tag you want to use to trigger the activity. For example, I used the tag "WatchTV" to trigger my Watch TV activity. No need to put a "#" at the beginning of the string here, just the string to use as a tag. Click "Create trigger".

This should bring you back to the "If this then that" page with the "this" part filled out with SMS. Now click the "+ that" link and search for the Harmony service. Click the Harmony service box. With the Harmony service you need to now select either the "Start activity" or "End activity" box. This may vary with other home automation platforms. Click the "Start activity" box for this example.

If you have correctly connected your Harmony IFTTT service then you should now see a "Start activity" box with a dropdown menu that lists the Harmony activities you have created and enabled. Select the Harmony activity you want to start with this applet and click "Create action".

Edit the title of your new applet and click "Finish".

You now have an IFTTT account, an IFTTT phone channel, IFTTT services that connect to your phone and home automation platform, and IFTTT applets that are triggered by SMS tags sent to your IFTTT phone channel.

Step 5 - Send an SMS Message to Your IFTTT Phone Channel

You should now be able to activate an IFTTT applet by sending the appropriate SMS message to your IFTTT phone channel. From the phone number you used to configure your IFTTT phone channel (see https://ifttt.com/services/phone_call/settings) send an SMS with one of  the tags you used to create an IFTTT applet. For example, I used "WatchTV" as the tag to trigger my Watch TV activity. I can send the SMS message "#WatchTV" to my IFTTT phone channel and that activates my Watch TV IFTTT applet. Note that the SMS message must contain the "#" symbol at the beginning of the tag.

Try it with the Messages app on your Mac/Macbook after configuring an "IFTTT Phone Channel" contact to use. You can also try it with Siri on your Mac/Macbook by asking Siri to send an SMS message to IFTTT phone channel. Unfortunately, for me, Siri often misunderstands what I say and changes "Play Blu-Ray" to "Say Tuesday" or some nonsense. The SMS message tag must correspond exactly to the tag you entered when creating the IFTTT applet. It's even case sensitive so you may have to go back and modify the IFTTT applet to match what Siri sends (e.g. Siri will capitalize the 'A' and the 'TV' in AppleTV and does not insert a space. I played around with it but soon decided to use a command line script rather than the finicky Siri voice commands.

Step 6 - Create Scripts to Send SMS Messages

I found it easier to simply type in a simple command than try to get Siri to understand exactly what I wanted to send. I'm a programmer and I almost always have several terminal windows open so I chose to write some simple scripts to allow me to easily type a command to control my devices and activities.

Here is the "ifttt" Bash script I wrote to send SMS messages to my IFTTT phone channel. You should be able to modify this slightly, setting the IFT variable to your IFTTT phone number and changing the tag strings to match those you have used. Or you may choose to write your own shell script or AppleScript - all I'm really doing here is executing the following AppleScript with the osascript command in a shell script:

tell application "Messages"
  send "$MSG" to buddy "$IFT" of service "SMS"
end tell

Where the MSG variable contains the message I want to send and the IFT variable contains the IFTTT phone number.

My ifttt shell script:

The ifttt script can be invoked directly but to simplify further I wrote additional scripts which then run the ifttt script with the appropriate arguments. For example, to run the Watch TV activity I can execute the ifttt command directly as:
    # ifttt tv on
or
    # ifttt tv off
or with no arguments it turns the activity on
    # ifttt tv
I also wrote a shell script "tv" which does just that:

#!/bin/bash
ifttt tv $*


So now I can also start the Watch TV activity by typing:
    # tv on
or
    # tv
And end the Watch TV activity by typing:
    # tv off

The latest version of my ifttt script and associated convenience scripts are available in the IFTTT subdirectory of my Scripts github repository at https://github.com/doctorfree/Scripts

Enjoy!

Tuesday, January 17, 2017

What’s the best Muse album? “The Resistance”...



What’s the best Muse album? “The Resistance” includes “MK Ultra”, “I Belong To You”, and the Exogenesis symphony. It’s my favorite and displays Muse as both the Queen and the George Gershwin of our time. Thanks Muse! #muse #queen #gershwin #theresistance #exogenesis #mkultra http://ift.tt/2jvNbin



via Tumblr http://ift.tt/2jty617

What’s the best Muse album? “The Resistance”...



What’s the best Muse album? “The Resistance” includes “MK Ultra”, “I Belong To You”, and the Exogenesis symphony. It’s my favorite and displays Muse as both the Queen and the George Gershwin of our time. Thanks Muse! #muse #queen #gershwin #theresistance #exogenesis #mkultra (at Casa de Recuerdo)



via Tumblr http://ift.tt/2jtxgl2

Monday, January 16, 2017

In June of 2016 The Traveling Wilburys released a really fine...



In June of 2016 The Traveling Wilburys released a really fine vinyl box set. The linen-cloth box cover itself is exquisite and contains both Wilbury albums on 180 gram vinyl, a bonus LP with extended mixes, a 12x12 14 page booklet, a 36x12 poster, 6 4x6 sepia postcards, and liner notes. The bonus LP tracks are:
“Handle With Care (Extended Version)”
“Like a Ship”
“Maxine”
“End of the Line (Extended Version)”
“Nobody’s Child”
“Not Alone Anymore (Remix)”
“Runaway”

There is also a CD/DVD box set which I also have but this vinyl box is super sweet. http://a.co/33X2Yap

Thanks Wilburys!

#travelingwilburys #vinyl #bobdylan #jefflynne #georgeharrison #tompetty #royorbison #boxset http://ift.tt/2jpxEkE



via Tumblr http://ift.tt/2ivk67B

In June of 2016 The Traveling Wilburys released a really fine...



In June of 2016 The Traveling Wilburys released a really fine vinyl box set. The linen-cloth box cover itself is exquisite and contains both Wilbury albums on 180 gram vinyl, a bonus LP with extended mixes, a 12x12 14 page booklet, a 36x12 poster, 6 4x6 sepia postcards, and liner notes. The bonus LP tracks are:
“Handle With Care (Extended Version)”
“Like a Ship”
“Maxine”
“End of the Line (Extended Version)”
“Nobody’s Child”
“Not Alone Anymore (Remix)”
“Runaway”

There is also a CD/DVD box set which I also have but this vinyl box is super sweet. http://a.co/33X2Yap

Thanks Wilburys!

#travelingwilburys #vinyl #bobdylan #jefflynne #georgeharrison #tompetty #royorbison #boxset (at Casa de Recuerdo)



via Tumblr http://ift.tt/2ivdFRP

Sunday, January 15, 2017

The 150 gram double LP 45 rpm vinyl pressing of the 2013...



The 150 gram double LP 45 rpm vinyl pressing of the 2013 masterpiece “…Like Clockwork” by Queens of the Stone Age is an excellent example of why vinyl is a superior medium. I dare anybody to listen to this on vinyl (with a good turntable, cartridge, amp, and speakers) and compare that to any other medium. Also, it’s just a super fantastic album. Nowhere in the description on Amazon or the album cover or the records does it say 45 rpm so you just gotta know that little detail. It’s an important little detail as properly mastered 45 rpm vinyl offers even greater audio reproduction as the stylus is able to read a greater detail of wiggles in the grooves.

Thanks QotSA! http://a.co/5eYEwTJ #qotsa #vinyl #45rpm #likeclockwork http://ift.tt/2jnTRiA



via Tumblr http://ift.tt/2jUcLP2

The 150 gram double LP 45 rpm vinyl pressing of the 2013...



The 150 gram double LP 45 rpm vinyl pressing of the 2013 masterpiece “…Like Clockwork” by Queens of the Stone Age is an excellent example of why vinyl is a superior medium. I dare anybody to listen to this on vinyl (with a good turntable, cartridge, amp, and speakers) and compare that to any other medium. Also, it’s just a super fantastic album. Nowhere in the description on Amazon or the album cover or the records does it say 45 rpm so you just gotta know that little detail. It’s an important little detail as properly mastered 45 rpm vinyl offers even greater audio reproduction as the stylus is able to read a greater detail of wiggles in the grooves.

Thanks QotSA! http://a.co/5eYEwTJ #qotsa #vinyl #45rpm #likeclockwork (at Casa de Recuerdo)



via Tumblr http://ift.tt/2jUaumZ