MilhouseVH / autoaway.py

Improved auto-away monitoring for Nest Thermostats
15 stars 1 forks source link

Question re: manual status change #1

Closed sk123 closed 7 years ago

sk123 commented 10 years ago

This is fantastic. Everything works beautifully.

On occasion when my wife and I are out, I want to set the nest's status to home (e.g. to turn on the heat for a house guest). My understanding is that after the grace period expires, if no monitored phones are yet home, the script will set the status to away. Is there an easy way to instruct the script (which I have running 24/7) to keep the status as home in this situation until I manually set it away again?

Thanks so much for working on this. Something like functionality should have been baked into the nest and I've yet to run into any serious problem with your implementation.

MilhouseVH commented 10 years ago

Thanks, glad someone finds it useful! :)

Unless there is a way to signal "guest mode" via your nest account (there doesn't appear to be[1]) the only other option would be some sort of trigger that could be observed by the notification script. As a simple example, the existence of a file called "wehaveguests.txt" that you create whenever you have a guest, and delete whenever they go home.

If this file exists, then the script called by --notify can choose to ignore status changes:

#!/bin/sh

BIN=$(readlink -f $(dirname $0))

if [ -f /tmp/wehaveguests.txt ]; then
  echo "Ignoring status change - keeping current status"
  exit
fi

echo "Updating Nest with away status: $1"
$BIN/nest.py --user joe@user.com --password swordfish away $1
if [ "$1" = "here" ]; then
  echo "Property vacant for $3 ($2 seconds)"
else
  echo "Property occupied for $3 ($2 seconds)"
fi

You can of course make this as complicated and sophisticated as you like, but that would be my preferred solution to dealing with the guest problem - ie. push the problem down to the notification script so that under certain circumstances it ignores the new away/home status whenever it is called while a guest is present.

Of course the other option is to just disable autoaway.py for the duration of the guests visit...

1 You can query your Nest account with the nest.py script, I'm guessing you have auto-away disabled, or fan set to on or maybe auto. Perhaps changing the state of one of these variables could be used to trigger "guest mode" (ie. if you don't actually have a fan in your heating system, setting the fan to on could be the trigger for "guest mode", reverting it to "auto" once the guests leave).

sk123 commented 10 years ago

I like the idea of toggling auto-away to control the guest feature. Fan wouldn't work unless it's possible to trick the app (and/or the device) into thinking an HVAC supports a fan when it doesn't because fan control settings are hidden unless there's a green wire connected. Using a txt file seems clean and straightforward but I'd love to be able to run the script on my server and basically forget about it; this is the only missing use case i can think of. I'll play with the the notify script (with my weak sh skill) and see what I can do using auto-away on/off. Hopefully I can prevent my father-in-law from freezing to death when he visits next week. :)

I'm surprised more folks aren't using this given how many are clamoring for the feature in the nest forums. Thanks again.