Jump to content

Another Nest thermostat workflow


Recommended Posts

jc-nest_screenshot.png

 

I wrote a workflow to control my Nest thermostat a few days ago. When I was 90% done and was looking for a last bit of how-to info, I saw Nate's fully functional workflow in the forums. Oh well, nothing says fun like a little duplication of effort. :)

 

My workflow currently lets you see the Nest's general status, away status, target temp, and local weather, and it will let you toggle the away status and set the target temp. It uses a different technique than Nate's to get your login information--I open dialogs via AppleScript to ask for your email and password, which keeps them out of Alfred's history.

 

To use the workflow, just install it, type 'nest' in the Alfred input window, and select one of the available commands. If you need to authenticate the workflow will ask for your login information. Once that's done you should be good to go.

 

The workflow is written in Python with a couple of embedded AppleScripts for the dialogs. It's available at https://github.com/jason0x43/jc-nest.

 

 

Download

 

 

Update 2014/03/19 (again):

 

The weather command should now show temperatures in Celsius if that's how your Nest is configured.

 

Update 2014/03/19:

 

I updated the workflow to use TLSv1 because of recent updates to the Nest API servers.

 

Update 2014/02/06:

 

I added a "clear" command to make it easier to clear the workflow's session data. Doing this, which basically logs the workflow out of nest.com so that it has to create a new session, can help when the workflow isn't...flowing.

 

Update 2013/10/06:

 

Bug fixes

 

Update 2013/08/30.4:

 

A bunch of small updates were made to fix issues with multi-nest support.

 

Update 2013/08/30:

 

I added support for multiple Nests (for those of you lucky enough to be in that situation...sigh). You can use the "nest nest" command to list your Nests and choose the current active one.

 

Update 2013/08/20:

 

Fixed a major bug in how actions were being called (they weren't).

 

Update 2013/08/14:

 

Added support for Alleyoop updating. Login info is now stored in the Mac OS Keychain

Edited by jason0x43
Link to comment
  • 4 weeks later...

How do you put in username and password? I know you say "I open dialogs via AppleScript" but how do I get it to do this/where do I go?

Just try any of the commands. The first time you try to do anything (get status, set temp, etc) the workflow will ask you for you login info.

Link to comment

I'm gettin' 'Error: "OK"' when I try a command.

Sorry, new to this.

Hmmm...let me look into it a bit more and see if I can reproduce the problem.

Could you tell me what version of Alfred you're using? And is this the first time you've tried this workflow, or are you upgrading from the previous version?

Link to comment

Awesome, sounds good.

 

Alfred v2.0.3 (187) and This is the first time. In fact, first day with Powerpack haha

 

The problem should be fixed now--just download and install it again. Basically I had upgraded one part of my code without updating the other parts that were using it. Sorry about that.

Link to comment
  • 2 months later...

I came back to the forums to see if anybody else had tackled the idea, as I am gearing up to update my version with more control, and saw this one. Looks good. I am going to be changing up the authentication piece to use this neat little app which stores the users credentials in the keychain. It solves the problem of having the user store their credentials in the plist (my problem) and the problem of having to authenticate every so often after the session cookie expires (your problem). 

Link to comment

I came back to the forums to see if anybody else had tackled the idea, as I am gearing up to update my version with more control, and saw this one. Looks good. I am going to be changing up the authentication piece to use this neat little app which stores the users credentials in the keychain. It solves the problem of having the user store their credentials in the plist (my problem) and the problem of having to authenticate every so often after the session cookie expires (your problem). 

 

Yeah, I've started using the keychain in some other workflows I've been playing around with on my system, although just directly from Python rather than with an app. It definitely makes life easier. That Authenticate app looks pretty neat, I'll have to try it out.

Link to comment
  • 1 month later...

Not sure if this is an issue but seems like I can't set the temperature.  I type "nest temp" and the current temp comes up and then I add "74" (so the command looks like "nest temp 74") and hit enter.  I'll get an empty notification in notification center that just says "Nest" and the nest doesn't respond.

Link to comment

Not sure if this is an issue but seems like I can't set the temperature.  I type "nest temp" and the current temp comes up and then I add "74" (so the command looks like "nest temp 74") and hit enter.  I'll get an empty notification in notification center that just says "Nest" and the nest doesn't respond.

 

That was, indeed, an issue. :)

 

It should be fixed now.

Link to comment

Love the workflow.  Thanks for your time and for sharing.  I'm in near Nest Nirvana...now if only I could control the second thermostat.  :-)  

 

Hmmm...that shouldn't actually be too hard, although me only having a single Nest to test with makes things trickier. I have the beginnings of a plan, though.

Link to comment

Very cool.  Quick question.  I deleted the old workflow, installed the new and when I attempt to do any of the commands it appears to attempt to connect to Nest but quickly times out and just leaves the commands in Alfred's input box.  I thought perhaps I needed to refresh credentials, so I deleted the jc-nest password from keychain hoping to re-prompt for credentials again but to no avail.  Just downloaded off GitHub minutes ago so think I have the most current version.  Any suggestions?

Link to comment

Ok, to confirm it is pulling the workflow from http://dl.dropbox.com/s/qmu1iyora9h6pr9/jc-nest.alfredworkflow

 

I have deleted the old.  For good measure, I cleaned out the volatile and non-volatile Workflow Data for jc-nest.  Deleted the password from keychain.

 

Then did a clean install.

 

It prompts me for login information...confirms I'm all set and ready to go.  On any of the commands, I see "Talking to Nest..." for about 1 second or so below the input box and the selected filter item.  Then it just goes away.

 

On the "nest nest" command it says "Finding Nests..." and then times out the same.

 

Happy to continue and test.

Edited by meadeiator
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...