<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WiredPrairie &#187; General</title>
	<atom:link href="http://www.wiredprairie.us/blog/index.php/archives/category/general/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wiredprairie.us/blog</link>
	<description>A little bit of everything: software, apps, usability, programming, design and whatever else</description>
	<lastBuildDate>Sun, 05 Feb 2012 23:36:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Nest Thermostat Review, Update #9</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1508</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1508#comments</comments>
		<pubDate>Sun, 22 Jan 2012 15:57:37 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Recommendations]]></category>
		<category><![CDATA[Experience]]></category>
		<category><![CDATA[Issue]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1508</guid>
		<description><![CDATA[Summary/Index When I woke up this morning, I decided that I’d use the remote features of my Nest Thermostat to increase the temperature of the first floor as the normal schedule hadn’t started yet. Here’s what I saw on my iPad: Basement: ? First Floor: ? When I tapped the Basement image, this alert was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wiredprairie.us/blog/index.php/nest-thermostat-reviews">Summary/Index</a></p>
<p>When I woke up this morning, I decided that I’d use the remote features of my Nest Thermostat to increase the temperature of the first floor as the normal schedule hadn’t started yet.</p>
<p>Here’s what I saw on my iPad:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image22.png" width="500" height="194" /></p>
<p>Basement: ?</p>
<p>First Floor: ?</p>
<p>When I tapped the Basement image, this alert was displayed:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image23.png" width="500" height="338" /></p>
<p>“Thermostat Disconnected: The thermostat Basement last connected to nest.com more than 7 hours ago.”</p>
<p><strong><font style="background-color: #ffff00">What? </font></strong></p>
<p>I next checked the First Floor. Thankfully, it said that it had only been 17 minutes since it last connected. I’ve seen that issue before and it usually resolves. But, I’ve never seen one go more than about <strike>50</strike> 53 minutes without reporting in.</p>
<p>The fact that I was using the iPad and the Nest application meant that WiFi Internet was available in our house. </p>
<p>I went to the Basement thermostat and noticed this glaring issue after clicking through to settings:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image24.png" width="240" height="226" /></p>
<p><strong><font style="background-color: #ffff00">What?</font>&#160; </strong>Seriously? </p>
<p>As I wasn’t sure what the best option was at 6:45AM for support, I decided to re-add the thermostat to our account. The thermostat had no trouble accessing the Nest cloud and obtaining one of the one time connection keys. (So, I maintain, it’s not general Internet connectivity issues).</p>
<p>After deleting and adding it back, the web site still reported it as MIA. So, I tried a reset:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image25.png" width="240" height="228" /></p>
<p>After resetting, and waiting several minutes after it had completely restarted, it appeared again on the Nest web site.</p>
<p>However, 3 hours later:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image26.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb16.png" width="318" height="480" /></a></p>
<p>It&#8217;s again, gone missing. </p>
<p>So, I called support this fine Sunday morning and talked to one of the same support engineers I’ve spoken with in the past (“DK”). I explained the general problem (and emphasized that my biggest concern was that it had lost my account information), my “solution”, and said that it was again not reporting in. In a typical (somewhat ironic) support fashion, as I was explaining the issue and walking to the basement, the thermostat reported in successfully to the Nest cloud. </p>
<p>He had me drop the account, add it to my account, and restart it again. He said that resolves the problem in about 70% of the cases. In the other 30%, he mentioned that they often manually update the firmware and that will help. [ugh]</p>
<p>I’m going to keep an eye on it and will add more details as needed/available.</p>
<p>&#160;</p>
<p>If you want to talk and discuss more about digital thermostats with others, I’d suggest here: <a href="http://digtstat.com/">digtstat.com</a> (it’s a web site I created to help provide a better place to have discussions about the Nest thermostat). </p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1508/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Macbook Pro battery fails to charge</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1499</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1499#comments</comments>
		<pubDate>Sat, 21 Jan 2012 19:27:13 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[MacBook Pro]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1499</guid>
		<description><![CDATA[The non replaceable battery on my Macbook Pro (2010) had discharged recently completely as I’d left the laptop unplugged for more than a month without turning it on. When I went to use it this morning, I plugged it in, and then turned it on. After a few minutes of use, the battery status still [...]]]></description>
			<content:encoded><![CDATA[<p>The non replaceable battery on my Macbook Pro (2010) had discharged recently completely as I’d left the laptop unplugged for more than a month without turning it on. </p>
<p>When I went to use it this morning, I plugged it in, and then turned it on. After a few minutes of use, the battery status still showed as “not charging.” </p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image21.png" width="122" height="22" /></p>
<p>The light on the mag-safe connection was green, as if the battery was completely charged. </p>
<p>When I depressed the battery indicator button on the side of the MacBook Pro, the response was 5 quick green flashes on the first LED. <a href="http://support.apple.com/kb/HT3205">According</a> to Apple support, that indicates the battery hasn’t been charged to what’s required for a single indicator light yet. However, while my MacBook Pro had discharged like this before, it would normally start charging right away.</p>
<p>So, apparently, before taking it in for a repair (which is what a lot of people in forums were recommending), you might try resetting the <a href="http://support.apple.com/kb/HT3964?viewlocale=en_US">System Management Controller</a>. One of the issues that a reset could fix is that the battery does not appear to be charging properly. </p>
<p>To reset the controller, perform these steps (as documented on the Apple Support web site):</p>
<ol>
<li>Shut down your laptop completely. </li>
<li>Plug in the MagSafe power adapter to a power source, connecting it to the MacBook if its not already connected. </li>
<li>On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.&#160; [Wow, it’s awkward to do that! I pressed the S-C-O keys first and then the power button and it worked]</li>
<li>Release all the keys and the power button at the same time. </li>
<li>Press the power button to turn on the computer.&#160; <strong>       <br />Note</strong>: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC.</li>
</ol>
<p>A few moments after I performed the steps above, the mag safe LED light switched to an orange color (charging) and the battery indicator no longer blinked 5 times quickly.</p>
<p>Problem resolved, and much simpler than taking it to a local Apple “Genius” bar.</p>
<p><em>As this wasn’t an obvious fix, I’ve decided to put this on my blog in the hope that someone else might find it useful, and so when I have this happen again, I don’t need to go hunting for the solution! <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/wlEmoticon-smile6.png" /></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1499/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing digtstat.com</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1488</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1488#comments</comments>
		<pubDate>Sat, 14 Jan 2012 23:20:47 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1488</guid>
		<description><![CDATA[Last week Johnk suggested in a comment that someone in the user community should set up a forum for discussion of the Nest thermostat. I have done just that this afternoon. It’s brand new, and hasn’t had the tires kicked much yet (just the absolute basics), but I thought I’d put something out there as [...]]]></description>
			<content:encoded><![CDATA[<p>Last week Johnk suggested in a comment that someone in the user community should set up a forum for discussion of the Nest thermostat.</p>
<p>I have done just that this afternoon. <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/wlEmoticon-smile5.png" /></p>
<p>It’s brand new, and hasn’t had the tires kicked much yet (just the absolute basics), but I thought I’d put something out there as the comments and discussion have outgrown my installation of WordPress (and it’s ability to nicely manage a discussion effectively about multiple topics). I really enjoy the conversation and thought it might be best provided in a different forum (pun intended). </p>
<p>It’s here: <a href="http://digtstat.com">digtstat.com</a>. (It’s short for <strong>Dig</strong>ital <strong>T</strong>hermo<strong>stat</strong>)</p>
<p>If there’s enough traffic to warrant it, I’ll definitely promote some others as moderators, as it <strong>will</strong> be kept a civil location for discussions about digital thermostats.</p>
<p>Enjoy.</p>
<p><a href="http://digtstat.com"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image20.png" width="500" height="415" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1488/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nest Thermostat Review, Update #8</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1482</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1482#comments</comments>
		<pubDate>Sat, 14 Jan 2012 16:35:17 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Recommendations]]></category>
		<category><![CDATA[Experience]]></category>
		<category><![CDATA[Issue]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1482</guid>
		<description><![CDATA[Summary/Index A few new things have occurred since I last posted. January 11, 2012: Nest Labs updated the firmware of the thermostat to version 1.0.6. There isn’t any publically available information about what was updated however other than “bug fixes.” Thanks to GregN for pointing it out. Here’s a link to their current software releases [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wiredprairie.us/blog/index.php/nest-thermostat-reviews">Summary/Index</a></p>
<p>A few new things have occurred since I last posted.</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image19.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb15.png" width="240" height="74" /></a>January 11, 2012: Nest Labs updated the firmware of the thermostat to version 1.0.6. There isn’t any publically available information about what was updated however other than “bug fixes.” Thanks to <strong>GregN</strong> for pointing it out. Here’s a link to their current software releases and updates for anyone interested:</p>
<p><a href="http://support.nest.com/customer/portal/articles/246009-nest-learning-thermostat-nest-mobile-software-updates">http://support.nest.com/customer/portal/articles/246009-nest-learning-thermostat-nest-mobile-software-updates</a></p>
<p>This week, one of my thermostats in “learning” mode wiped out some of the set points I had specifically added for the weekend (this has happened before). I have no rational explanation for why it would do this as our weekend schedule on the floor where it happened is routine enough that it shouldn’t have made that choice. Nest Labs support suggests turning off “learning” mode when this has occurred to see if it’s related to learning mode. They apparently don’t have a way to track the causes or triggers unfortunately (a debug log would come in very handy now). I turned it off for the time being and have added the deleted set points to see if the problem occurs again.</p>
<p><font style="background-color: #ffff00">UPDATE: 1/25/2012:</font>&#160; One of our thermostats that still has “learning” turned off decided that our morning set points for our first floor weren’t important and deleted them. Apparently, we didn’t want the house to start warming before we got out of bed. </p>
<p>I found an interesting issue with the Away Temperature settings that you’ll want to watch out for until they fix it (as it could affect triggers for “auto away”).</p>
<p>Essentially, there are values that when you put them into the away temperature field, they won’t “stick.” You won’t necessarily notice this right away unless you click around:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/nestrounding.gif"><img style="display: inline" title="nestrounding" alt="nestrounding" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/nestrounding_thumb.gif" width="508" height="348" /></a></p>
<p>In the video (GIF) above, you’ll see how the “58” won’t stay 58F. It switches to 57 (it happens with 60F as well). I’ve sent a support request to Nest about the issue (they responded the following day and said they’d look into it). Since their web API deals with Celsius, I speculate it could be a rounding issue in their JavaScript code.</p>
<p><font style="background-color: #ffff00">Update: 1/24/2012</font> The bug appears appears to have been corrected in the few places I happened to check earlier today (as I’m not their QA team, I didn’t check around much <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/wlEmoticon-smile7.png" />).</p>
<p><strong>Randal</strong> pointed out that there was someone who’d done some <a href="http://davidwallen.net/2012/01/nest-learning-thermostat-initial-data/">analysis</a> of the temperature readings of a working Nest thermostat (compared to another thermostat). I’d concur that the readings do seem to be far more consistently accurate on the Nest thermostat on average and that our house is more comfortable. However, I’m certainly aware that this comfort will come at a cost. The house is more consistently warmer (now in the heating season). So, depending on your old thermostats and how you handled the temperature in the house, you may find your heating costs rise a bit. Simple way to compensate: you may be able to turn down the thermostat a few degrees! <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/wlEmoticon-smile4.png" /> The temperature may read lower, but the actual temperature may be closer to what you had grown accustomed to. We may do that.</p>
<p>I’m still trying to understand why “Auto Away” is sometimes triggered when I wouldn’t expect it. I believe that once it was because the “away” temperatures were one degree LESS than the typical set point. So, the house would not “see us” around, and compared the day time (at work for example) set point (60F) to the “away” temperature (59F) and activate the “away” mode. I found the issue with the away temperature above when I was trying to make everything match one evening this week.&#160; The problem with Auto-away activating is that your scheduled set points won’t be used until it is overridden via the remote interface or locally.</p>
<p><font style="background-color: #ffff00">Update: 1/25/2012</font>: Apparently, auto-away unfortunately can trigger even when the temperature settings match exactly. (Even when there’s nothing to do). I don’t understand what it’s “auto-awaying” from. </p>
<p>Here’s a few relevant tweets from <a href="https://twitter.com/#!/nest">@Nest</a>:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image27.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb17.png" width="515" height="366" /></a></p>
<p>Although I admit to not understanding the topmost tweet. My tweet had been:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image28.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb18.png" width="524" height="221" /></a></p>
<p>I honestly didn’t feel like trying to clarify again in 140 characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1482/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>.NET API for Nest Thermostat</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1449</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1449#comments</comments>
		<pubDate>Tue, 10 Jan 2012 02:50:22 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Thermostat]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1449</guid>
		<description><![CDATA[I just finished a preliminary read-only (think version 0.1) wrapper around the Nest Thermostat API that is used by their mobile phone and web applications. As Nest doesn’t have a formal API yet, the code could break at any time and may not be suitable for any use. However, it is working today. The project [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished a preliminary <strong>read-only</strong> (think version 0.1) wrapper around the Nest Thermostat API that is used by their mobile phone and web applications. As Nest doesn’t have a formal API yet, the code could break at any time and may not be suitable for any use. However, it is working today. <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/wlEmoticon-smile3.png" /></p>
<p>The project is hosted on <a href="https://github.com/wiredprairie/Nest-Thermostat-DotNET-API">GitHub</a>. It uses <a href="http://james.newtonking.com/pages/json-net.aspx">JSON.NET</a> for parsing the return values from the Nest servers.</p>
<p>There are three projects, with the lib containing the assembly that is used by the two test applications. One is a console app and the other a simple WPF application:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/SNAGHTML88bff0b3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTML88bff0b3" border="0" alt="SNAGHTML88bff0b3" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/SNAGHTML88bff0b3_thumb.png" width="424" height="332" /></a></p>
<p>(My thermostats are named Zero, One, and Two).</p>
<p>If there’s interest, I plan on adding some methods to the library which allow modification of data (such as the current temperature), and ideally, support for live updates from the devices if I can make sense of the data that is <a href="http://www.wiredprairie.us/blog/index.php/archives/1442">returned</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1449/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Nest Thermostat API/Protocol</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1442</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1442#comments</comments>
		<pubDate>Sun, 08 Jan 2012 17:21:05 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[Thermostat]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1442</guid>
		<description><![CDATA[While Nest Labs hasn’t released a formal (documented &#38; supported) API, I thought I’d do a bit of digging to see how they’re using the network and what might be achievable. A few things are going on, the majority as you’d probably expect. The web interface is using a long polling technique apparently to watch [...]]]></description>
			<content:encoded><![CDATA[<p>While Nest Labs hasn’t released a formal (documented &amp; supported) API, I thought I’d do a bit of digging to see how they’re using the network and what might be achievable.</p>
<p>A few things are going on, the majority as you’d probably expect.</p>
<p>The web interface is using a long polling technique apparently to watch for updates to the schedule, temperature, etc. </p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image7.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb7.png" width="381" height="225" /></a></p>
<p>I haven’t determined what the frequency is though, or the wait time. It’s very inconsistent, even when I wouldn’t expect much new “live” data to be available on the network, it frequently updates and polls again.</p>
<p>There are a few constants set in the HOME page script:</p>
<pre class="csharpcode">C.ABSENT_USER_THRESHOLD     = +(<span class="str">'300'</span>) || 0;  <span class="rem">// seconds</span>
C.DEAD_DEVICE_THRESHOLD     = +(<span class="str">'300'</span>) || 0;  <span class="rem">// seconds</span>
C.pollingInterval           = +(<span class="str">'2500'</span>) || 0;       <span class="rem">// ms</span>
C.WEATHER_POLLING_INTERVAL  = +(<span class="str">'120000'</span>) || 0; <span class="rem">// ms</span></pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>If the C.pollingInterval value were for the subscribe endpoint mentioned above, I’d see a LOT more calls than I do – so I’m still not clear how the polling interval is decided.</p>
<p>The API calls, for the most part are using JSONP syntax over an HTTPS connection.</p>
<p>The most frequent request is to “subscribe.” It sends as part of the GET request a large block of encoded JSON (using encodeURIComponent and then JSON.stringify). </p>
<p>I&#8217;m not familiar with the key/value system that they’re using (it may just be something they’ve constructed in-house – although given the number of <a href="http://www.wiredprairie.us/blog/index.php/archives/1397">open source JavaScript</a> libraries they’re using, I thought someone might recognize it):</p>
<p>“<strong>key</strong>”, “{<strong>actualkey</strong>}.{<strong>value</strong>}”</p>
<p>I don’t understand why they’ve redundantly specified “key” in a list of keys when it’s evident that the <em>actual key<strong> </strong></em>is contained within the value as a delimited string. It’s more data to send and more data to parse this way. So, again, maybe it’s based on some DB or model system I’m not familiar with. (Anyone recognize it?)</p>
<p>I’ve substituted the actual values (as they are serial numbers of my devices) with text representations of what the value represented below:</p>
<pre class="csharpcode">{<span class="str">&quot;keys&quot;</span>:
    [{<span class="str">&quot;key&quot;</span>:<span class="str">&quot;user.#USERID#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:209478897,<span class="str">&quot;timestamp&quot;</span>:1324159145000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;user_alert_dialog.#USERID#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:-1320296685,<span class="str">&quot;timestamp&quot;</span>:1325967612000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;structure.#STRUCTURE-GUID#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:656192675,<span class="str">&quot;timestamp&quot;</span>:1325967612000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;device.#DEVICE 1 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:1485027516,<span class="str">&quot;timestamp&quot;</span>:1326034984000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;shared.#DEVICE 1 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:588844038,<span class="str">&quot;timestamp&quot;</span>:1326034818000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;schedule.#DEVICE 1 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:1187107985,<span class="str">&quot;timestamp&quot;</span>:1326005677000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;track.#DEVICE 1 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;timestamp&quot;</span>:1326035650601,<span class="str">&quot;version&quot;</span>:1041047847},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;device.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:149169270,<span class="str">&quot;timestamp&quot;</span>:1326034820000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;shared.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:659841570,<span class="str">&quot;timestamp&quot;</span>:1326034820000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;schedule.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:-2016290692,<span class="str">&quot;timestamp&quot;</span>:1326005625000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;track.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;timestamp&quot;</span>:1326035650862,<span class="str">&quot;version&quot;</span>:528978433},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;device.#DEVICE 3 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:1637112547,<span class="str">&quot;timestamp&quot;</span>:1326035399000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;shared.#DEVICE 3 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:760504326,<span class="str">&quot;timestamp&quot;</span>:1326035397000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;schedule.#DEVICE 3 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:-314552357,<span class="str">&quot;timestamp&quot;</span>:1326003402000},
    {<span class="str">&quot;key&quot;</span>:<span class="str">&quot;track.#DEVICE 3 SERIAL NUMBER#&quot;</span>,
        <span class="str">&quot;version&quot;</span>:-645931164,<span class="str">&quot;timestamp&quot;</span>:1326035531802}]}&quot;</pre>
<p>We’ve got three thermostats, so there are always three sets of subscription requests for each call to <strong>subscribe.</strong> </p>
<p>Using my iPad, I adjusted the set point for our second story (#DEVICE 2#) down one degree Fahrenheit (to 67°).</p>
<p>Within approximately a second, the most recent pending <strong>subscribe</strong> request returned with a far more interesting payload:</p>
<pre class="csharpcode">
jQuery17108417355176061392_1326035646750(
    { <span class="str">&quot;status&quot;</span>: 200,
        <span class="str">&quot;headers&quot;</span>: {
            <span class="str">&quot;X-nl-skv-key&quot;</span>: <span class="str">&quot;shared.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
            <span class="str">&quot;X-nl-skv-version&quot;</span>: 869022424,
            <span class="str">&quot;X-nl-skv-timestamp&quot;</span>: 1326038279000,
            <span class="str">&quot;X-nl-service-timestamp&quot;</span>: 1326038279825
        },
        <span class="str">&quot;payload&quot;</span>: {
            <span class="str">&quot;current_temperature&quot;</span>: 19.98,
            <span class="str">&quot;hvac_fan_state&quot;</span>: <span class="kwrd">false</span>,
            <span class="str">&quot;name&quot;</span>: <span class="str">&quot;TWO&quot;</span>, <span class="str">&quot;hvac_heat_x2_state&quot;</span>: <span class="kwrd">false</span>,
            <span class="str">&quot;hvac_ac_state&quot;</span>: <span class="kwrd">false</span>,
            <span class="str">&quot;can_cool&quot;</span>: <span class="kwrd">true</span>,
            <span class="str">&quot;auto_away&quot;</span>: 0,
            <span class="str">&quot;compressor_lockout_enabled&quot;</span>: <span class="kwrd">false</span>,
            <span class="str">&quot;target_temperature_low&quot;</span>: 16.66667,
            <span class="str">&quot;target_temperature_high&quot;</span>: 26.66667,
            <span class="str">&quot;compressor_lockout_timeout&quot;</span>: 0,
            <span class="str">&quot;hvac_heater_state&quot;</span>: <span class="kwrd">false</span>,
            <span class="str">&quot;hvac_aux_heater_state&quot;</span>: <span class="kwrd">false</span>,
            <span class="str">&quot;target_temperature&quot;</span>: 19.44444,
            <span class="str">&quot;can_heat&quot;</span>: <span class="kwrd">true</span>,
            <span class="str">&quot;target_temperature_type&quot;</span>: <span class="str">&quot;heat&quot;</span>,
            <span class="str">&quot;target_change_pending&quot;</span>: <span class="kwrd">true</span>
        }
    });</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Everything above is needed to update the current state of the UI. As you can see, the current temperature (returned as Celsius apparently) is 19.98 (67.964°F). The current temperature as displayed on the thermostat and the web UI was 68.</p>
<p><em>Seeing these return values makes me think that they may be using Ruby and Rails (as the naming convention tends to follow Rails naming using underscores between words). I know for example, I wouldn’t name variables/columns that way when building a C#/JavaScript MVC project.</em></p>
<p><font color="#333333">Rather than just a delta payload of what’s changed, they’ve currently opted for a full update of all information related to the thermostat state. </font></p>
<p><font color="#333333">Several seconds later, a much larger payload was returned to a <strong>subscribe </strong>request:</font></p>
<pre class="csharpcode"><span class="str">&quot;status&quot;</span>: 200,
<span class="str">&quot;headers&quot;</span>: {
    <span class="str">&quot;X-nl-skv-key&quot;</span>: <span class="str">&quot;device.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
    <span class="str">&quot;X-nl-skv-version&quot;</span>: -2086438581,
    <span class="str">&quot;X-nl-skv-timestamp&quot;</span>: 1326038378000,
    <span class="str">&quot;X-nl-service-timestamp&quot;</span>: 1326038379023
},
<span class="str">&quot;payload&quot;</span>: {
    <span class="str">&quot;ob_orientation&quot;</span>: <span class="str">&quot;O&quot;</span>,
    <span class="str">&quot;upper_safety_temp&quot;</span>: 1000.0,
    <span class="str">&quot;forced_air&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;creation_time&quot;</span>: 1324142042019,
    <span class="str">&quot;switch_preconditioning_control&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;click_sound&quot;</span>: <span class="str">&quot;on&quot;</span>,
    <span class="str">&quot;leaf&quot;</span>: <span class="kwrd">false</span>, <span class="str">&quot;user_brightness&quot;</span>: <span class="str">&quot;auto&quot;</span>,
    <span class="str">&quot;learning_state&quot;</span>: <span class="str">&quot;steady&quot;</span>,
    <span class="str">&quot;heat_pump_comp_threshold&quot;</span>: -1000.0,
    <span class="str">&quot;local_ip&quot;</span>: <span class="str">&quot;10.0.0.205&quot;</span>,
    <span class="str">&quot;backplate_serial_number&quot;</span>: <span class="str">&quot;#SHOULD BE DEVICE 2 SERIAL NUMBER, BUT ISN'T?#&quot;</span>,
    <span class="str">&quot;capability_level&quot;</span>: 1.03,
    <span class="str">&quot;postal_code&quot;</span>: <span class="str">&quot;#POSTALCODE#&quot;</span>,
    <span class="str">&quot;upper_safety_temp_enabled&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;heat_pump_aux_threshold&quot;</span>: 10.0,
    <span class="str">&quot;lower_safety_temp_enabled&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;serial_number&quot;</span>: <span class="str">&quot;#DEVICE 2 SERIAL NUMBER#&quot;</span>,
    <span class="str">&quot;temperature_lock&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;learning_time&quot;</span>: 1002,
    <span class="str">&quot;current_version&quot;</span>: <span class="str">&quot;1.0.4&quot;</span>,
    <span class="str">&quot;model_version&quot;</span>: <span class="str">&quot;Diamond-1.10&quot;</span>,
    <span class="str">&quot;backplate_bsl_info&quot;</span>: <span class="str">&quot;BSL&quot;</span>,
    <span class="str">&quot;auto_away_enable&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;heat_pump_comp_threshold_enabled&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;fan_mode&quot;</span>: <span class="str">&quot;auto&quot;</span>,
    <span class="str">&quot;range_enable&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;temperature_scale&quot;</span>: <span class="str">&quot;F&quot;</span>,
    <span class="str">&quot;backplate_mono_info&quot;</span>: <span class="str">&quot;TFE (BP_DVT) 3.5.2 (ehs@ubuntu) 2011-11-05 12:00:00&quot;</span>,
    <span class="str">&quot;backplate_bsl_version&quot;</span>: <span class="str">&quot;1.1&quot;</span>,
    <span class="str">&quot;equipment_type&quot;</span>: <span class="str">&quot;gas&quot;</span>,
    <span class="str">&quot;range_mode&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;lower_safety_temp&quot;</span>: 7.0,
    <span class="str">&quot;has_fan&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;hvac_wires&quot;</span>: <span class="str">&quot;Heat,Cool,Fan,Common Wire,Rc&quot;</span>,
    <span class="str">&quot;learning_mode&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;away_temperature_high&quot;</span>: 32.0,
    <span class="str">&quot;switch_system_off&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;time_to_target&quot;</span>: 1326039444,
    <span class="str">&quot;away_temperature_low&quot;</span>: 14.444444444444445,
    <span class="str">&quot;current_humidity&quot;</span>: 45,
    <span class="str">&quot;mac_address&quot;</span>: <span class="str">&quot;#MACADDR#&quot;</span>,
    <span class="str">&quot;backplate_mono_version&quot;</span>: <span class="str">&quot;3.5.2&quot;</span>,
    <span class="str">&quot;has_aux_heat&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;TBD&quot;</span>,
    <span class="str">&quot;hvac_pins&quot;</span>: <span class="str">&quot;W1,Y1,C,Rc,G&quot;</span>,
    <span class="str">&quot;has_heat_pump&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;heat_pump_aux_threshold_enabled&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;battery_level&quot;</span>: 3.945,
    <span class="str">&quot;target_time_confidence&quot;</span>: 1.0
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>A few things to note:</p>
<li><strong>Upper_safety_temperature </strong>is just a bit beyond my comfort zone at 1832°F. I don’t know why it’s sending a value like that to the client, and why it’s stupidly high.</li>
<li>The backplate serial number doesn’t match with the thermostat according to the payload response. I don’t know why this might be as I confirmed that the numbers matched through visual inspection of the device just now.</li>
<li>The majority of these details are exposed in one way or another in the details area of the web UI.</li>
<li>Time to target (payload.time_to_target) is unusual in that it’s a JavaScript Date value, divided by 1000. So, in the example above, the time to target is: <strong>new Date(1326039444 * 1000).toString() = &gt;&quot;Sun Jan 08 2012 10:17:24 GMT-0600 (Central Standard Time)&quot;</strong></li>
<p>Next, a payload is returned with the new status:</p>
<pre class="csharpcode"><span class="str">&quot;status&quot;</span>: 200,
<span class="str">&quot;headers&quot;</span>: {
    <span class="str">&quot;X-nl-skv-key&quot;</span>: <span class="str">&quot;shared.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
    <span class="str">&quot;X-nl-skv-version&quot;</span>: 1689916148,
    <span class="str">&quot;X-nl-skv-timestamp&quot;</span>: 1326038378000,
    <span class="str">&quot;X-nl-service-timestamp&quot;</span>: 1326038379151
},
<span class="str">&quot;payload&quot;</span>: {
    <span class="str">&quot;hvac_fan_state&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;name&quot;</span>: <span class="str">&quot;TWO&quot;</span>,
    <span class="str">&quot;hvac_heat_x2_state&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;hvac_ac_state&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;can_cool&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;auto_away&quot;</span>: 0,
    <span class="str">&quot;compressor_lockout_enabled&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;target_temperature_low&quot;</span>: 16.66667,
    <span class="str">&quot;current_temperature&quot;</span>: 19.53,
    <span class="str">&quot;target_temperature_high&quot;</span>: 26.66667,
    <span class="str">&quot;compressor_lockout_timeout&quot;</span>: 0,
    <span class="str">&quot;target_change_pending&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;hvac_aux_heater_state&quot;</span>: <span class="kwrd">false</span>,
    <span class="str">&quot;target_temperature&quot;</span>: 20.55556,
    <span class="str">&quot;can_heat&quot;</span>: <span class="kwrd">true</span>,
    <span class="str">&quot;target_temperature_type&quot;</span>: <span class="str">&quot;heat&quot;</span>,
    <span class="str">&quot;hvac_heater_state&quot;</span>: <span class="kwrd">true</span>
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Here, the <strong>hvac_heater_state</strong> is set to <strong>true</strong>. The furnace is on.</p>
<p>A little while later, that value is set to <strong>false.</strong></p>
<p>Occasionally, the payload includes the complete schedule for the thermostat. I’m not going to reproduce the entire payload here as it’s too large, and quite boring. Here’s a snippet of what it returns:</p>
<pre class="csharpcode"><span class="str">&quot;schedule&quot;</span>: {
    <span class="str">&quot;#DEVICE 2 SERIAL NUMBER#&quot;</span>: {
        <span class="str">&quot;$version&quot;</span>: 1187107985,
        <span class="str">&quot;$timestamp&quot;</span>: 1326005677000,
        <span class="str">&quot;name&quot;</span>: <span class="str">&quot;One Current Schedule&quot;</span>,
        <span class="str">&quot;days&quot;</span>: {
            <span class="str">&quot;0&quot;</span>: {
                <span class="str">&quot;0&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 14.445,
                    <span class="str">&quot;time&quot;</span>: 0,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;continuation&quot;</span>
                },
                <span class="str">&quot;1&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 14.445,
                    <span class="str">&quot;time&quot;</span>: 27900,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;setpoint&quot;</span>
                },
                <span class="str">&quot;2&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 20.556,
                    <span class="str">&quot;time&quot;</span>: 63000,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;setpoint&quot;</span>
                },
                <span class="str">&quot;3&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 14.445,
                    <span class="str">&quot;time&quot;</span>: 70200,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;setpoint&quot;</span>
                }
            },
            <span class="str">&quot;1&quot;</span>: {
                <span class="str">&quot;0&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 14.445,
                    <span class="str">&quot;time&quot;</span>: 0,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;continuation&quot;</span>
                },
                <span class="str">&quot;1&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 18.889,
                    <span class="str">&quot;time&quot;</span>: 20700,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;setpoint&quot;</span>
                },</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>It’s a basic table structure. The first set point of the day is at 0, and is a “continuation.” These don’t show up in the UI. </p>
<p>Here’s what the day 1 looks like on the Nest thermostat UI:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image8.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb8.png" width="500" height="37" /></a></p>
<p>When changing a temperature setpoint, I’m a bit disappointed to see that the entire schedule is sent with every request apparently. I just wouldn’t have expected that given that the more setpoints that there are, the bigger the payload must be. The UI is often sluggish when rapidly making adjustments in the schedule, and this could be one of the factors.</p>
<p>In the example below (which I’ve snipped most of the payload sent again as a JSONP request), I’ve set the first set point to 57F. </p>
<pre class="csharpcode">    <span class="str">&quot;payload&quot;</span>: {
        <span class="str">&quot;days&quot;</span>: {
            <span class="str">&quot;0&quot;</span>: {
                <span class="str">&quot;0&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 14.685,
                    <span class="str">&quot;time&quot;</span>: 0,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;continuation&quot;</span>
                },
                <span class="str">&quot;1&quot;</span>: {
                    <span class="str">&quot;type&quot;</span>: <span class="str">&quot;HEAT&quot;</span>,
                    <span class="str">&quot;temp&quot;</span>: 15.000444444444444,
                    <span class="str">&quot;time&quot;</span>: 24300,
                    <span class="str">&quot;entry_type&quot;</span>: <span class="str">&quot;setpoint&quot;</span>
                },</pre>
<p>For the JSONP requests sent as “MAKE CHANGE” (easily could have been PUT), they each contained the following attributes as shown below. All JSONP requests are apparently routed on the web server using “headers” rather than a RESTful URL based system:</p>
<pre class="csharpcode">    },
    <span class="str">&quot;headers&quot;</span>: {
        <span class="str">&quot;X-nl-client-timestamp&quot;</span>: 1326041210566,
        <span class="str">&quot;X-nl-session-id&quot;</span>: <span class="str">&quot;#SESSION ID#&quot;</span>,
        <span class="str">&quot;X-nl-protocol-version&quot;</span>: 1,
        <span class="str">&quot;Authorization&quot;</span>: <span class="str">&quot;Basic #BASIC AUTH#&quot;</span>
    },
    <span class="str">&quot;path&quot;</span>: <span class="str">&quot;/v1/put/schedule.#DEVICE 2 SERIAL NUMBER#&quot;</span>,
    <span class="str">&quot;redir&quot;</span>: <span class="str">&quot;https://home.nest.com/post_jsonp&quot;</span>,
    <span class="str">&quot;jsonp&quot;</span>: <span class="str">&quot;4_&quot;</span>
}</pre>
<p>It’s RESTful in spirit as there is a route (“path”), but it’s managed by some internal routing engine. (Now, I think that they’re not using Ruby and Rails). </p>
<p>For something simple, like changing the current temperature of a thermostat, the request is thankfully simple:</p>
<pre class="csharpcode">{
    <span class="str">&quot;payload&quot;</span>: {
        <span class="str">&quot;shared&quot;</span>: {
            <span class="str">&quot;#DEVICE 2 SERIAL NUMBER#&quot;</span>: {
                <span class="str">&quot;target_temperature&quot;</span>: 18.333333333333336
            }
        }
    },
    <span class="str">&quot;headers&quot;</span>: {
        <span class="str">&quot;X-nl-client-timestamp&quot;</span>: 1326041744556,
        <span class="str">&quot;X-nl-session-id&quot;</span>: <span class="str">&quot;#SESSION ID#&quot;</span>,
        <span class="str">&quot;X-nl-protocol-version&quot;</span>: 1,
        <span class="str">&quot;Authorization&quot;</span>: <span class="str">&quot;Basic #BASIC AUTH#&quot;</span>
    },
    <span class="str">&quot;path&quot;</span>: <span class="str">&quot;/v1/put&quot;</span>,
    <span class="str">&quot;redir&quot;</span>: <span class="str">&quot;https://home.nest.com/post_jsonp&quot;</span>,
    <span class="str">&quot;jsonp&quot;</span>: <span class="str">&quot;14_&quot;</span>
}</pre>
<p>While, I haven’t taken the time to try to write a custom UI for this undocumented API yet, it looks like it should be relatively easy to do, especially as it relates to the schedule and current temperature settings. I know there’s been some Siri proxy stuff that’s been written – but I don’t have any interest in trying to get that to work.</p>
<p>As with most APIs like this, the trick is often getting authorization correct. For Nest, it appears that making a POST request to <strong>https://home.nest.com/accounts/login/</strong> with <strong>username</strong> and <strong>password</strong> as form data, that the server responds with 2 cookies:</p>
<ol>
<li>sessionid == used in X-nl-session-id in headers</li>
<li>cztoken == used as the Authorization in headers (prepended with the text “Basic “</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1442/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Nest Thermostat Review, Update #7</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1432</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1432#comments</comments>
		<pubDate>Sat, 07 Jan 2012 22:08:31 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Recommendations]]></category>
		<category><![CDATA[Experience]]></category>
		<category><![CDATA[Issue]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1432</guid>
		<description><![CDATA[Update #6, Update #5, Update #4, Update #3, Update #2, Update #1, Install I received a replacement thermostat earlier this week as promised by Nest Labs. I had time this afternoon to do a swap and reinstall. Nest had asked me to swap the thermostats between two floors experimentally to determine whether a temperature reading [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wiredprairie.us/blog/index.php/archives/1420">Update #6</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1404">Update #5</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1382">Update #4</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1360">Update #3</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1358">Update #2</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1340">Update #1</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1329">Install</a></p>
<p>I received a <a href="http://www.wiredprairie.us/blog/index.php/archives/1360">replacement thermostat</a> earlier this week as promised by Nest Labs. I had time this afternoon to do a swap and reinstall. Nest had asked me to swap the thermostats between two floors experimentally to determine whether a temperature reading issue was related to the location or the thermostat. It was the thermostat. </p>
<p>As part of the swap, I had to reprogram the two thermostats.</p>
<p>I’d swapped the defective thermostat with one from the basement. Apparently, the base has the S/N on it of the thermostat and they’re intended to be “paired” so I decided to return the thermostat to the basement and install the new thermostat on the first floor (replacing the original defective unit).</p>
<p>I removed the old unit and replaced the wires. Depending on the type of wires you’re using, you may find that it’s far more difficult to do than you would expect. I ‘d forgotten how much I hated trying to stick the very stiff HVAC wires into the thermostat’s base! </p>
<p>I replaced everything and activated the unit. You can look at the <a href="http://www.wiredprairie.us/blog/index.php/archives/1329">installation experience post</a> for more information about the general setup. </p>
<p>Past the wifi connection, rebooting, waiting, waiting, waiting, then “ERROR.” “No Rc or Rh” connection.</p>
<p><img alt="20111218-IMG_0138" src="http://www.wiredprairie.us/blog/wp-content/uploads/2011/12/20111218-IMG_0138_thumb.jpg" /></p>
<p><strong>Crud</strong>. So, I popped the thermostat off the base and looked at the wires. They all appeared to be fine. So, I reseated the Rc connection and replaced the thermostat. Success! I find that a tiny tug on the wire after you believe it has been seated does the trick. The rest of the <em>install</em> went without issue. </p>
<p>The thermostat switched to the normal temperature display after a few more alerts. The only thing was – the temperature read 76F. Whaaaa? Given the reboot cycles, etc., I really hadn’t handled it much, not enough to cause the temperature to be that high. I waited about 5 minutes for it to start dropping and when it did not, I called Nest to speak with the person who’d handled the replacement, Mark. He was out apparently, so I ended up speaking with someone who went by “DK” for about 30 minutes about a few topics. </p>
<p>We decided the best course of action was to wait and see. </p>
<p>Thankfully, the new thermostat is now reading a temperature that I would expect, so for some reason, this new thermostat took quite a while to acclimate to the room temperature (much longer than the original three thermostats – around 45 minutes).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1432/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Ember.JS and EZdata, and Rails</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1430</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1430#comments</comments>
		<pubDate>Sat, 07 Jan 2012 19:39:24 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Ember.JS]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SproutCore]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1430</guid>
		<description><![CDATA[I’ve been trying to do some additional work on my ember.js extension for data management. At the same time though, I’ve been trying (to learn and) build a simple Ruby on Rails web demo application using the new JavaScript library. There have been more than a few things that have mystified me about the framework [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been trying to do some additional work on my <a href="http://www.wiredprairie.us/blog/index.php/archives/1377">ember.js extension for data</a> management. At the same time though, I’ve been trying (to learn and) build a simple <a href="http://rubyonrails.org/">Ruby on Rails</a> web demo application using the new JavaScript library. There have been more than a few things that have mystified me about the framework and the structuring of an application. One aspect in particular was how to best manage foreign keys and join tables with the ActiveRecord class (and the corresponding SQL tables). So many tutorials have the same lame example of: a CART, an ORDER, a CUSTOMER …, that it’s often difficult to apply the same patterns to a more interesting system. </p>
<p>I started simple this time. </p>
<p>I wanted a PERSON class and a GIFT class.</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb6.png" width="399" height="159" /></a></p>
<p>A Person has been given gifts and may give gifts (and a few other common attributes). </p>
<pre class="csharpcode"><span class="kwrd">class</span> CreatePeople &lt; ActiveRecord::Migration
  def change
    create_table :people do |t|
      t.string :first_name
      t.string :last_name
      t.<span class="kwrd">date</span> :date_of_birth
      t.string :email_address

      t.timestamps
    <span class="kwrd">end</span>
  <span class="kwrd">end</span>
<span class="kwrd">end</span></pre>
<p>One of the things that I can’t decide if I like is the automatic pluralization of words, especially People/Person. I would have been content with a Persons table, but when creating a model, by default (as I’m aware it can be overridden), a Person is mapped to a table called “People.” </p>
<p>The second table, Gifts is very simple:</p>
<pre class="csharpcode"><span class="kwrd">class</span> CreateGifts &lt; ActiveRecord::Migration
  def change
    create_table :gifts do |t|
      t.string :description
      t.<span class="kwrd">integer</span> :from_person_id
      t.<span class="kwrd">integer</span> :to_person_id
      t.timestamps
    <span class="kwrd">end</span>
  <span class="kwrd">end</span>
end</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>As I thought I might want a richer structure for the Gift class in the future, I did not use the more standard “person_id” name for the foreign key column that maps a gift to a Person. I wanted the column name to be more obvious what it was. Additionally, I needed two columns that both mapped to a “Person&quot;, so I couldn’t have both be called “person_id” anyway.</p>
<p>By deviating from the normal pattern, there are a few expectations when defining the ActiveRecord class. It was these expectations that weren’t clear to me (especially with examples).</p>
<p>The Ruby class for Gift is defined like so:</p>
<pre class="csharpcode"><span class="kwrd">class</span> Gift &lt; ActiveRecord::Base
  belongs_to :from_person, :class_name =&gt; &quot;Person&quot;, :foreign_key =&gt; &quot;from_person_id&quot;
  belongs_to :to_person, :class_name =&gt; &quot;Person&quot;, :foreign_key =&gt; &quot;to_person_id&quot;
<span class="kwrd">end</span></pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>and the Person:</p>
<pre class="csharpcode"><span class="kwrd">class</span> Person &lt; ActiveRecord::Base
  has_many  :gifts_given , :class_name =&gt; &quot;Gift&quot;, :foreign_key =&gt; &quot;from_person_id&quot;
  has_many  :gifts, :foreign_key =&gt; &quot;to_person_id&quot;
<span class="kwrd">end</span></pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>The key (and the ‘ah ha’ moment for me) was the use of the foreign_key parameter to the on the has_many and belongs_to associations. </p>
<p>In the Gift class, I included the <strong>belongs_to</strong> association macro. In this case, <strong>:from_person</strong> is the name of the rich accessor method (which looks like a property in other languages) that will be added to the Gift class. Using the symbol <strong>:class_name</strong> is like a class finding assistant. Without it, the Rails framework assumes that there would be a class named “FromPerson.” Of course, that would fail. By specifying “Person,” I’ve indicated to Rails that the class it should map to is called “Person” which I defined earlier. The <strong>:foreign_key</strong> symbol and value indicates which column in the backing table has the value which will map to an instance of a Person. In the SQL table, I added a “<strong>from_person_id</strong>” column and this points at that as the “from_person_id” column is the foreign key to the People table. (The same is true for <strong>:to_person</strong>.) </p>
<p>Looking at the Person class, it is using another common association macro, <strong>:has_many</strong>. <strong>:Has_many</strong> when used here, is indicating that a Person may have zero or more “gifts.” The new accessor method is named <strong>gifts </strong>(by using <strong>:gifts</strong>). Here, too, you’ll specify the name of the foreign_key. Again, repeat this for the <strong>:gifts_given</strong> automatically added accessor method. One interesting thing is that only :<strong>gifts_given </strong>requires the :<strong>class_name</strong> to be specified. The reason is that Rails automatically maps <strong>:gifts </strong>to the Gifts class (by way of naming). The :gifts_given cannot be automatically mapped, so you need to give (sigh) it a little help.</p>
<p>Here’s a little test:</p>
<pre class="csharpcode">&gt;&gt; jason = Person.find(1)
  Person Load (18.0ms)  SELECT <span class="str">&quot;people&quot;</span>.* FROM <span class="str">&quot;people&quot;</span> WHERE <span class="str">&quot;people&quot;</span>.<span class="str">&quot;id&quot;</span> = ? LIMIT 1  [[<span class="str">&quot;id&quot;</span>, 1]]
#&lt;Person id: 1, first_name: <span class="str">&quot;Jason&quot;</span>, last_name: <span class="str">&quot;Bourne&quot;</span>, date_of_birth: nil, email_address: nil, created_at: <span class="str">&quot;2012-01-06 13:47:40&quot;</span>, updated_at: <span class="str">&quot;2012-01-07 03:10:29&quot;</span>&gt;
&gt;&gt; jason.gifts_given
  Gift Load (0.0ms)  SELECT <span class="str">&quot;gifts&quot;</span>.* FROM <span class="str">&quot;gifts&quot;</span> WHERE <span class="str">&quot;gifts&quot;</span>.<span class="str">&quot;from_person_id&quot;</span> = 1
[#&lt;Gift id: 1, description: <span class="str">&quot;Machine Gun&quot;</span>, from_person_id: 1, to_person_id: 4, created_at: <span class="str">&quot;2012-01-07 14:39:17&quot;</span>, updated_at: <span class="str">&quot;2012-01-07 14:39:17&quot;</span>&gt;]
&gt;&gt; jason.gifts_given[0].to_person.first_name
<span class="str">&quot;Magnum&quot;</span>
  Person Load (0.0ms)  SELECT <span class="str">&quot;people&quot;</span>.* FROM <span class="str">&quot;people&quot;</span> WHERE <span class="str">&quot;people&quot;</span>.<span class="str">&quot;id&quot;</span> = 4 LIMIT 1
&gt;&gt; jason.gifts_given[0].to_person.gifts
  [#&lt;Gift id: Gift Load (1.0ms)1  SELECT <span class="str">&quot;gifts&quot;</span>.* FROM <span class="str">&quot;gifts&quot;</span> WHERE <span class="str">&quot;gifts&quot;</span>.<span class="str">&quot;to_person_id&quot;</span> = 4
, description: <span class="str">&quot;Machine Gun&quot;</span>, from_person_id: 1, to_person_id: 4, created_at: <span class="str">&quot;2012-01-07 14:39:17&quot;</span>, updated_at: <span class="str">&quot;2012-01-07 14:39:17&quot;</span>&gt;]
&gt;&gt; jason.gifts_given[0].to_person.gifts[0].from_person.first_name
  Person Load (0.0ms)  SELECT <span class="str">&quot;people&quot;</span>.* FROM <span class="str">&quot;people&quot;</span> WHERE <span class="str">&quot;people&quot;</span>.<span class="str">&quot;id&quot;</span> = 1 LIMIT 1
<span class="str">&quot;Jason&quot;</span></pre>
<p>I added two people: Jason, and Magnum, and one gift before executing the code above. Jason, as you should be able to follow, gave a wonderful gift to Magnum. As you can see, by using the automatically added accessor methods by way of the association macros described above, I was able to traverse the database structure very easily when mapped to a few simple objects. </p>
<p>One plus of experimenting and testing with the console while using Rails/Ruby in this case is that the output includes the SQL commands that are executed when the various method calls are made. Here’s an example where I rolled multiple calls into one chained call:</p>
<pre class="csharpcode">&gt;&gt; jason = Person.find(1).gifts_given[0].to_person.first_name
  Person Load (19.0ms)  SELECT <span class="str">&quot;people&quot;</span>.* FROM <span class="str">&quot;people&quot;</span> WHERE <span class="str">&quot;people&quot;</span>.<span class="str">&quot;id&quot;</span> = ? LIMIT 1  [[<span class="str">&quot;id&quot;</span>, 1]]
  Gift Load (0.0ms)  SELECT <span class="str">&quot;gifts&quot;</span>.* FROM <span class="str">&quot;gifts&quot;</span> WHERE <span class="str">&quot;gifts&quot;</span>.<span class="str">&quot;from_person_id&quot;</span> = 1
<span class="str">&quot;Magnum&quot;</span>
  Person Load (0.0ms)  SELECT <span class="str">&quot;people&quot;</span>.* FROM <span class="str">&quot;people&quot;</span> WHERE <span class="str">&quot;people&quot;</span>.<span class="str">&quot;id&quot;</span> = 4 LIMIT 1</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1430/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nest Thermostat Review, Update #6</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1420</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1420#comments</comments>
		<pubDate>Thu, 05 Jan 2012 03:21:36 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Recommendations]]></category>
		<category><![CDATA[Experience]]></category>
		<category><![CDATA[Issue]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1420</guid>
		<description><![CDATA[Update #5, Update #4, Update #3, Update #2, Update #1, Install I didn’t expect to have another post so soon. But, the Nest experience continues to frustrate and baffle. On the 3rd of January, I took the following screen shot of our basement schedule for heating: Tonight (one day later on the 4th), we headed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wiredprairie.us/blog/index.php/archives/1404">Update #5</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1382">Update #4</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1360">Update #3</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1358">Update #2</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1340">Update #1</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1329">Install</a></p>
<p>I didn’t expect to have another post so soon. But, the Nest experience continues to frustrate and baffle.</p>
<p>On the 3rd of January, I took the following screen shot of our basement schedule for heating:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb4.png" alt="image" width="285" height="313" border="0" /></a></p>
<p>Tonight (one day later on the 4th), we headed down to the basement to watch a recorded episode of AMCs Hell on Wheels and it was cold. Frak! What the…</p>
<p>The thermostat reported the temperature in the room was 62F. Seriously? It should have been about 66F at the time I looked.</p>
<p>I brought up the schedule and was disappointed (yet, not shocked given the other problems) to see:</p>
<p><a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb5.png" alt="image" width="271" height="314" border="0" /></a></p>
<p>All of the evening settings (except Monday?) had disappeared completely. I had not made the change. I don’t understand. I’m no artificial intelligence expert (my wife though has a CS Master’s degree with a specialty in it <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/wlEmoticon-smile2.png" alt="Smile" />), but I’m confident any learning algorithm I would write wouldn’t be this stupid and this broken.</p>
<p>If I were a competitor reading this, I’d be laughing just a little. Understand though – Nest still can make this work – don’t rest or expect them to just disappear so easily.</p>
<p><strong>As Nest continues to be silent on these matters, <span style="background-color: #ffff00;">I strongly recommend you not buy a Nest thermostat</span>. It’s an undone expensive piece of hardware, that while shiny and new, isn’t ready for the duties it claims to have mastered.</strong></p>
<blockquote><p><strong>Update: Janurary 13, 2012 &#8211; This happened again</strong>. The schedule for Saturday and Sunday was modified to entirely remove the evening set points.  Nest support recommended that I turn off the &#8220;learning&#8221; feature of the thermostat yesterday and I hadn&#8217;t done that yet. But now I will and see if it happens regardless.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1420/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Nest Thermostat Review, Update #5</title>
		<link>http://www.wiredprairie.us/blog/index.php/archives/1404</link>
		<comments>http://www.wiredprairie.us/blog/index.php/archives/1404#comments</comments>
		<pubDate>Thu, 05 Jan 2012 01:55:42 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Recommendations]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Experience]]></category>
		<category><![CDATA[Issue]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.wiredprairie.us/blog/?p=1404</guid>
		<description><![CDATA[Update #6, Update #5, Update #4, Update #3, Update #2, Update #1, Install I got my replacement Nest thermostat today via FedEx. I was surprised to open the box and find a complete sealed package. Honestly, I expected they’d ship just the display and the base (as the support engineer hadn’t set any expectations, I [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Nest Thermostat Review, Update #6" href="http://www.wiredprairie.us/blog/index.php/archives/1420">Update #6</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1404">Update #5</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1382">Update #4</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1360">Update #3</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1358">Update #2</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1340">Update #1</a>, <a href="http://www.wiredprairie.us/blog/index.php/archives/1329">Install</a></p>
<p>I got my <a href="http://www.wiredprairie.us/blog/index.php/archives/1360">replacement</a> Nest thermostat today via FedEx.</p>
<p>I was surprised to open the box and find a complete sealed package. Honestly, I expected they’d ship just the display and the base (as the support engineer hadn’t set any expectations, I apparently just made up my own!). But, I suppose at this point in the company, they just aren’t setup to ship just the two pieces. It has the unfortunate side effect of producing extra waste (as I can’t imagine that extra wall plates are going to come in handy anywhere). The little screw driver could be given away but the rest likely will end up in a landfill. I’ll ship them all of the unused parts back as I don’t want them – hopefully they don’t just trash them.</p>
<p>There’ve been some really <strong>awesome commenters </strong>in the past few days and I wanted to take a moment to highlight a few key comments.</p>
<p>From Curt:</p>
<blockquote><p>I finally called Nest and spoke to a pleasant fellow. First off, it turns out the Nest does NOT anticipate a temperature set point. It will not turn on the furnace ahead of time. If you train it to go from the night setting of 60 to the daytime setting of 68 by turning it to 68 when you get up, it will always be 60 when you get up.</p>
</blockquote>
<p>Wow, that’s a super disappointment. Honestly, I really thought it could do that.</p>
<p>Another from Curt:</p>
<blockquote><p>It does not keep as steady a temperature as the primitive Honeywell round thermostat it replaced.</p>
</blockquote>
<p>From Mark:</p>
<blockquote><p>I’ve had my Nest for about 10 days. I would recommend waiting before buying one.</p>
</blockquote>
<p>Kevin:</p>
<blockquote><p>I’ve been considering replacing my Honeywell programmable t’stat with a Nest…but now I’m not so sure</p>
</blockquote>
<p>David shares my disappointment regarding Nest Labs:</p>
<blockquote><p>I would love to hear what NEST has to say about the variances…I would think they are monitoring these blogs…..If they are not…shame on them.</p>
</blockquote>
<p>They seem to be way too quiet. They don’t seem to “get” social media.</p>
<p>And Matt provided a link to a very complete tear-down of the device:</p>
<blockquote><p>Here is a good site that did a tear-down,lots of comments and people look like they really know what there talking about!</p>
<p><a href="http://www.sparkfun.com/tutorials/334">http://www.sparkfun.com/tutorials/334</a></p>
</blockquote>
<p>GregN is still enthused about his Nest thermostat:</p>
<blockquote><p>You guys are right in all the above posts. But to be honest, I’m happy with setting a schedule that warms the house before I get up in the morning, and saves energy overnight. Yes, I had that functionality at a lower price point before the Nest. But I didn’t have remote adjustments or the great looking hockey puck on my wall before.</p>
</blockquote>
<p>Thanks again for all the comments! Keep them coming!<a href="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image3.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 10px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://www.wiredprairie.us/blog/wp-content/uploads/2012/01/image_thumb3.png" width="180" height="185" /></a></p>
<p>I won’t replace the poorly functioning Nest thermostat for a few days with the new unit (as it’s a nuisance to adjust all of the schedules, move the units around, etc.).</p>
<p>Today, the system had again auto activated the “away” mode apparently, and then did not activate the normal evening schedule. So, our house was cold when we returned from work, even though it should have been warming for about a half hour. I just don’t understand this feature. I don’t understand why “away” isn’t triggered at night.</p>
<p>I could turn off learning, auto-away … leaving me with remote scheduling.</p>
<p><font style="background-color: #ffff00">Update: January 11, 2012 </font>=&gt; Something triggered the “auto-away” feature two days in a row now. I don’t understand why it happens. The part that’s annoying is that the schedule doesn’t run when this happens apparently, so we came home to a cold house (and tonight I thought to check before leaving from work to see if it had happened again).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wiredprairie.us/blog/index.php/archives/1404/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

