<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>API &#8211; WiredPrairie</title>
	<atom:link href="blog/archives/tag/api/feed" rel="self" type="application/rss+xml" />
	<link>/blog</link>
	<description>Yet another tech blog.</description>
	<lastBuildDate>Wed, 29 Jun 2022 16:00:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0</generator>
<site xmlns="com-wordpress:feed-additions:1">193486638</site>	<item>
		<title>Added Away/Home to unofficial-nest-api</title>
		<link>/blog/index.php/archives/1788</link>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Sun, 30 Dec 2012 23:13:00 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[npm]]></category>
		<category><![CDATA[Thermostat]]></category>
		<guid isPermaLink="false">/blog/?p=1788</guid>

					<description><![CDATA[I just finished adding a new simple feature to control the away status for a structure to my unofficial-nest-api published on GitHub and available as a node package (npm). Usage is simple as calling setAway or setHome on the nest instance after authentication and a successful status has been returned (see commented calls below). [javascript] [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I just finished adding a new simple feature to control the away status for a structure to my unofficial-nest-api published on <a href="https://github.com/wiredprairie/unofficial_nodejs_nest">GitHub</a> and available as a node package (<a href="https://npmjs.org/package/unofficial-nest-api">npm</a>).</p>
<p>Usage is simple as calling <strong>setAway </strong>or <strong>setHome</strong> on the nest instance after authentication and a successful status has been returned (see commented calls below).</p>
<p>[javascript]<br />
if (username &amp;&amp; password) {<br />
    username = trimQuotes(username);<br />
    password = trimQuotes(password);<br />
    nest.login(username, password, function (data) {<br />
        if (!data) {<br />
            console.log(&#8216;Login failed.&#8217;);<br />
            process.exit(1);<br />
            return;<br />
        }<br />
        console.log(&#8216;Logged in.&#8217;);<br />
        nest.fetchStatus(function (data) {<br />
            for (var deviceId in data.device) {<br />
                if (data.device.hasOwnProperty(deviceId)) {<br />
                    var device = data.shared[deviceId];<br />
                    console.log(util.format(&quot;%s [%s], Current temperature = %d F target=%d&quot;,<br />
                        device.name, deviceId,<br />
                        nest.ctof(device.current_temperature),<br />
                        nest.ctof(device.target_temperature)));<br />
                }<br />
            }<br />
            subscribe();<br />
            //nest.setAway();<br />
            //nest.setHome();<br />
        });<br />
    });<br />
}<br />
[/javascript]</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1788</post-id>	</item>
		<item>
		<title>Nest Thermostat API using Node JS and Nest API Update</title>
		<link>/blog/index.php/archives/1754</link>
					<comments>/blog/index.php/archives/1754#comments</comments>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Wed, 10 Oct 2012 01:28:38 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Nest]]></category>
		<category><![CDATA[Node]]></category>
		<guid isPermaLink="false">/blog/?p=1754</guid>

					<description><![CDATA[I’ve been asked by a few people for more details on the API Nest Labs uses for their thermostats, especially regarding setting data (and not just polling). The API uses mostly JSON formatted data POSTed to their web servers. Authentication To authenticate, POST the username and password, encoded as form url-encoded: POST https://home.nest.com/user/login HTTP/1.1 Host: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I’ve been asked by a few people for more details on the API Nest Labs uses for their thermostats, especially regarding setting data (and not just polling).</p>
<p>The API uses mostly JSON formatted data POSTed to their web servers.</p>
<h2>Authentication</h2>
<p>To authenticate, POST the username and password, encoded as form url-encoded:</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">POST https:<span style="color: #008000">//home.nest.com/user/login HTTP/1.1</span>
Host: home.nest.com
Proxy-Connection: keep-alive
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept-Language: en-us
Content-Length: {Length}
Accept: */*
Connection: keep-alive
User-Agent: Nest/3.0.1.15 (iOS) os=6.0 platform=iPad3,1

username={email}&amp;password={password}</pre>
</div>
<p>Adjust the email and password, and the content length to fit. You may need to remove the Accept-Encoding header value if your client cannot accept gzip or deflated responses.</p>
<p>The server responds with a healthy set of basic information (in JSON format):</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">{
    <span style="color: #006080">&quot;is_superuser&quot;</span>: <span style="color: #0000ff">false</span>,
    <span style="color: #006080">&quot;is_staff&quot;</span>: <span style="color: #0000ff">false</span>,
    <span style="color: #006080">&quot;urls&quot;</span>: {
        <span style="color: #006080">&quot;transport_url&quot;</span>: <span style="color: #006080">&quot;</span>,
        <span style="color: #006080">&quot;rubyapi_url&quot;</span>: <span style="color: #006080">&quot;https://home.nest.com/&quot;</span>,
        <span style="color: #006080">&quot;weather_url&quot;</span>: <span style="color: #006080">&quot;http://www.wunderground.com/auto/nestlabs/geo/current/i?query=&quot;</span>,
        <span style="color: #006080">&quot;support_url&quot;</span>: <span style="color: #006080">&quot;https://nest.secure.force.com/support/webapp?&quot;</span>
    },
    <span style="color: #006080">&quot;limits&quot;</span>: {
        <span style="color: #006080">&quot;thermostats_per_structure&quot;</span>: 10,
        <span style="color: #006080">&quot;structures&quot;</span>: 2,
        <span style="color: #006080">&quot;thermostats&quot;</span>: 10
    },
    <span style="color: #006080">&quot;access_token&quot;</span>: <span style="color: #006080">&quot;GIANT TOKEN STRING==&quot;</span>,
    <span style="color: #006080">&quot;userid&quot;</span>: <span style="color: #006080">&quot;1234&quot;</span>,
    <span style="color: #006080">&quot;expires_in&quot;</span>: <span style="color: #006080">&quot;Wed, 07-Oct-2012 12:08:00 GMT&quot;</span>,
    <span style="color: #006080">&quot;email&quot;</span>: <span style="color: #006080">&quot;user@example.com&quot;</span>,
    <span style="color: #006080">&quot;user&quot;</span>: <span style="color: #006080">&quot;user.1234&quot;</span>
}</pre>
</div>
<p>There are a few things you’ll need from the response:</p>
<ul>
<li><strong>transport_url</strong> : this is the address for all of the later request that are made. I’d speculate it’s just a specific server in a server farm (likely with server affinity/session) </li>
<li><strong>access_token</strong> : this is the key for all later requests and grants access to the API </li>
<li><strong>userid/user </strong>: a unique user ID </li>
<li><strong>expires_in</strong> : this is the timestamp for when the access token expires </li>
</ul>
<p>I’m not sure why the “limits” are being sent back to the client.</p>
<p>You can obtain the service URLs at any time:</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">POST https:<span style="color: #008000">//home.nest.com/user/service_urls HTTP/1.1</span>
Host: home.nest.com
Authorization: Basic GIANT TOKEN STRING==
Accept-Encoding: gzip, deflate
Accept: */*
Content-Length: 0
Accept-Language: en-us
Connection: keep-alive
Proxy-Connection: keep-alive
User-Agent: Nest/3.0.1.15 (iOS) os=6.0 platform=iPad3,1</pre>
</div>
<p>Just insert an Authorization header with the <strong>access_token</strong> value.</p>
<p>The response:</p>
<pre class="code"><span style="background: white; color: black">{ </span><span style="background: white; color: #a31515">&quot;urls&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;transport_url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;rubyapi_url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://home.nest.com/&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;weather_url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;http://www.wunderground.com/auto/nestlabs/geo/current/i?query=&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;support_url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://nest.secure.force.com/support/webapp?&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;limits&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;thermostats_per_structure&quot;</span><span style="background: white; color: black">: 10, </span><span style="background: white; color: #a31515">&quot;structures&quot;</span><span style="background: white; color: black">: 2, </span><span style="background: white; color: #a31515">&quot;thermostats&quot;</span><span style="background: white; color: black">: 10 } }</span></pre>
<p>Nest labs has a special URL at wunderground.com to access the weather.</p>
<p>One of the first requests you might want to send is to get a <strong>complete</strong> picture of the system:</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">GET https:<span style="color: #008000">//{subdomain}.transport.nest.com:443/v2/mobile/#USER.ID# HTTP/1.1</span>
Host: {subdomain}.transport.nest.com:443
Authorization: Basic GIANT TOKEN STRING==
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Connection: keep-alive
X-nl-protocol-version: 1
X-nl-user-id: #USERID#
Proxy-Connection: keep-alive
User-Agent: Nest/3.0.1.15 (iOS) os=6.0 platform=iPad3,1</pre>
</div>
<p>You’ll make the request to the <strong>transport_url</strong> and make sure that the Host, Authorization, and X-nl-user-id header values are set appropriately. The Url now must include though:</p>
<ul>
<li>version </li>
<li>mobile </li>
<li>and the full user id (like user.1234) </li>
</ul>
<p>So, it will look something like: <strong>/v2/mobile/user.1234</strong></p>
<p>It will respond with the mother-load of all JSON payloads. I’ve trimmed the response for my house as I have three thermostats. But the pattern repeats exactly, so it’s easy to extrapolate how the pattern works:</p>
<pre class="code" style="max-height: 800px"><span style="background: white; color: black">{ </span><span style="background: white; color: #a31515">&quot;metadata&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1262653277, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349697004000, </span><span style="background: white; color: #a31515">&quot;last_connection&quot;</span><span style="background: white; color: black">: 1349697004683, </span><span style="background: white; color: #a31515">&quot;last_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LAST.IP.ADDRESS&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1868790132, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696678000, </span><span style="background: white; color: #a31515">&quot;last_connection&quot;</span><span style="background: white; color: black">: 1349696678701, </span><span style="background: white; color: #a31515">&quot;last_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LAST.IP.ADDRESS&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1581663504, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696680000, </span><span style="background: white; color: #a31515">&quot;last_connection&quot;</span><span style="background: white; color: black">: 1349696680647, </span><span style="background: white; color: #a31515">&quot;last_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LAST.IP.ADDRESS&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;track&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;SERIALNUM2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 1065037529, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696725390, </span><span style="background: white; color: #a31515">&quot;online&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;last_connection&quot;</span><span style="background: white; color: black">: 1349696725390, </span><span style="background: white; color: #a31515">&quot;last_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LAST.IP.ADDRESS&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 981680556, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696726266, </span><span style="background: white; color: #a31515">&quot;online&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;last_connection&quot;</span><span style="background: white; color: black">: 1349696726266, </span><span style="background: white; color: #a31515">&quot;last_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LAST.IP.ADDRESS&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 1421919505, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349697004728, </span><span style="background: white; color: #a31515">&quot;online&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;last_connection&quot;</span><span style="background: white; color: black">: 1349697004728, </span><span style="background: white; color: #a31515">&quot;last_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LAST.IP.ADDRESS&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;user_settings&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;#USERID#&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 370836640, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1337481029003, </span><span style="background: white; color: #a31515">&quot;email_verified&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;tos_accepted_version&quot;</span><span style="background: white; color: black">: 1319500800000, </span><span style="background: white; color: #a31515">&quot;receive_marketing_emails&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;receive_nest_emails&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;receive_support_emails&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;max_structures&quot;</span><span style="background: white; color: black">: 2, </span><span style="background: white; color: #a31515">&quot;max_thermostats&quot;</span><span style="background: white; color: black">: 10, </span><span style="background: white; color: #a31515">&quot;max_thermostats_per_structure&quot;</span><span style="background: white; color: black">: 10, </span><span style="background: white; color: #a31515">&quot;tos_minimum_version&quot;</span><span style="background: white; color: black">: 1319500800000, </span><span style="background: white; color: #a31515">&quot;tos_current_version&quot;</span><span style="background: white; color: black">: 1319500800000, </span><span style="background: white; color: #a31515">&quot;lang&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;en_US&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;structure&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;#STRUCTURE-UUID#&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 1797929878, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349689810000, </span><span style="background: white; color: #a31515">&quot;location&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Mount Horeb, WI&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;renovation_date&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;2000&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;country_code&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;US&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;away_timestamp&quot;</span><span style="background: white; color: black">: 1349302501, </span><span style="background: white; color: #a31515">&quot;away&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;house_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;family&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Home&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;postal_code&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;#POSTALCODE#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;creation_time&quot;</span><span style="background: white; color: black">: 1324159145719, </span><span style="background: white; color: #a31515">&quot;num_thermostats&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;devices&quot;</span><span style="background: white; color: black">: [</span><span style="background: white; color: #a31515">&quot;device.SERIALNUM3&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;device.SERIALNUM1&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;device.SERIALNUM2&quot;</span><span style="background: white; color: black">], </span><span style="background: white; color: #a31515">&quot;user&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;user.#USERID#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;away_setter&quot;</span><span style="background: white; color: black">: 1 } }, </span><span style="background: white; color: #a31515">&quot;link&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;SERIALNUM3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 2122853931, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1327246591000, </span><span style="background: white; color: #a31515">&quot;structure&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;structure.#STRUCTURE-UUID#&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1703839727, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1324159215000, </span><span style="background: white; color: #a31515">&quot;structure&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;structure.#STRUCTURE-UUID#&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -459415854, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1325967612000, </span><span style="background: white; color: #a31515">&quot;structure&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;structure.#STRUCTURE-UUID#&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;device&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -81037153, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696605000, </span><span style="background: white; color: #a31515">&quot;heatpump_setback_active&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;emer_heat_enable&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;local_ip&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;LOCAL.IP.ADDRESS&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;switch_system_off&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;away_temperature_high&quot;</span><span style="background: white; color: black">: 27.778, </span><span style="background: white; color: #a31515">&quot;temperature_lock_high_temp&quot;</span><span style="background: white; color: black">: 22.222, </span><span style="background: white; color: #a31515">&quot;cooling_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;electric&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf_threshold_cool&quot;</span><span style="background: white; color: black">: 0.0, </span><span style="background: white; color: #a31515">&quot;fan_cooling_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;note_codes&quot;</span><span style="background: white; color: black">: [], </span><span style="background: white; color: #a31515">&quot;heater_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;gas&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;compressor_lockout_leaf&quot;</span><span style="background: white; color: black">: -17.8, </span><span style="background: white; color: #a31515">&quot;has_x3_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_humidity_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_x3_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;gas&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;alt_heat_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;fan_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;auto&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_x2_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;rssi&quot;</span><span style="background: white; color: black">: 67.0, </span><span style="background: white; color: #a31515">&quot;emer_heat_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heatpump_savings&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;off&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_y2_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;none&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;filter_reminder_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;capability_level&quot;</span><span style="background: white; color: black">: 3.0, </span><span style="background: white; color: #a31515">&quot;schedule_learning_reset&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_x2_cool&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_pins&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;W1,Y1,C,Rc,G&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;ob_orientation&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;O&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;range_enable&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;auto_away_enable&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;dual_fuel_breakpoint_override&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;none&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;lower_safety_temp_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_fan&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;dehumidifier_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;range_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;nlclient_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;emer_heat_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;electric&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heatpump_ready&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;available_locales&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;en_US,fr_CA,es_US&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;current_version&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;3.0.1&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;learning_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;slow&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_ob_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;none&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_rh_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;none&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_alt_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_y1_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;cool&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;humidifier_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;backplate_serial_number&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;#BACKPLATE-SERIALNUMBER1#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_x2_alt_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_x3_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf_threshold_heat&quot;</span><span style="background: white; color: black">: 19.336, </span><span style="background: white; color: #a31515">&quot;has_emer_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;learning_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf_learning&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;ready&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_aux_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;aux_heat_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;electric&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;backplate_bsl_info&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;BSL&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;alt_heat_x2_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;gas&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_c_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;power&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;humidifier_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;unknown&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_w2aux_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;none&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;country_code&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;US&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_humidity&quot;</span><span style="background: white; color: black">: 35.0, </span><span style="background: white; color: #a31515">&quot;heat_x2_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;lower_safety_temp&quot;</span><span style="background: white; color: black">: 4.444, </span><span style="background: white; color: #a31515">&quot;cooling_x2_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;electric&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;equipment_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;gas&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_pump_aux_threshold&quot;</span><span style="background: white; color: black">: 10.0, </span><span style="background: white; color: #a31515">&quot;alt_heat_x2_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_pump_comp_threshold&quot;</span><span style="background: white; color: black">: -31.5, </span><span style="background: white; color: #a31515">&quot;learning_days_completed_cool&quot;</span><span style="background: white; color: black">: 116, </span><span style="background: white; color: #a31515">&quot;backplate_bsl_version&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;1.1&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;current_schedule_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_wires&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Heat,Cool,Fan,Common Wire,Rc&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;TBD&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;pin_g_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;fan&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;switch_preconditioning_control&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;click_sound&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;on&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;aux_heat_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;away_temperature_low_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_pump_comp_threshold_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;preconditioning_ready&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_dehumidifier&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;fan_cooling_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf_away_high&quot;</span><span style="background: white; color: black">: 28.88, </span><span style="background: white; color: #a31515">&quot;fan_cooling_readiness&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;ready&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;device_locale&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;en_US&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temperature_scale&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;F&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;error_code&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;preconditioning_active&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;battery_level&quot;</span><span style="background: white; color: black">: 3.93, </span><span style="background: white; color: #a31515">&quot;away_temperature_high_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;learning_days_completed_heat&quot;</span><span style="background: white; color: black">: 149, </span><span style="background: white; color: #a31515">&quot;pin_star_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;none&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;upper_safety_temp_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;preconditioning_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;current_humidity&quot;</span><span style="background: white; color: black">: 45, </span><span style="background: white; color: #a31515">&quot;dual_fuel_breakpoint&quot;</span><span style="background: white; color: black">: -1.0, </span><span style="background: white; color: #a31515">&quot;postal_code&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;#POSTALCODE#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;backplate_mono_version&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;4.0.5&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;alt_heat_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;gas&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;aux_lockout_leaf&quot;</span><span style="background: white; color: black">: 10.0, </span><span style="background: white; color: #a31515">&quot;has_heat_pump&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heater_delivery&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;forced-air&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;auto_away_reset&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;away_temperature_low&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;radiant_control_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temperature_lock&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;upper_safety_temp&quot;</span><span style="background: white; color: black">: 35.0, </span><span style="background: white; color: #a31515">&quot;time_to_target_training&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;ready&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;dehumidifier_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;unknown&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_time_confidence&quot;</span><span style="background: white; color: black">: 1.0, </span><span style="background: white; color: #a31515">&quot;temperature_lock_low_temp&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;pin_w1_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;heat&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;forced_air&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temperature_lock_pin_hash&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf_type&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;backplate_mono_info&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;TFE (BP_DVT) 4.0.5 (root@bamboo) 2012-09-18 18:18:23&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;has_dual_fuel&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;learning_time&quot;</span><span style="background: white; color: black">: 2113, </span><span style="background: white; color: #a31515">&quot;creation_time&quot;</span><span style="background: white; color: black">: 1325966794212, </span><span style="background: white; color: #a31515">&quot;has_humidifier&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;learning_days_completed_range&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;leaf_schedule_delta&quot;</span><span style="background: white; color: black">: 1.11, </span><span style="background: white; color: #a31515">&quot;user_brightness&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;auto&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;leaf_away_low&quot;</span><span style="background: white; color: black">: 13.92, </span><span style="background: white; color: #a31515">&quot;pin_rc_description&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;power&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;serial_number&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;mac_address&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;18b43004f391&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_x2_source&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;gas&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;time_to_target&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;backplate_model&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Backplate-1.9&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;model_version&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Diamond-1.10&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_pump_aux_threshold_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 2134103145, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349695665000, </span><span style="background: white; color: green">/* same as previous */ </span><span style="background: white; color: #a31515">&quot;backplate_model&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Backplate-1.9&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;model_version&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Diamond-1.10&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_pump_aux_threshold_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1340728480, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349692217000, </span><span style="background: white; color: green">/* same as previous */ </span><span style="background: white; color: #a31515">&quot;backplate_model&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Backplate-1.9&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;model_version&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Diamond-1.10&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;heat_pump_aux_threshold_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;schedule&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;SERIALNUM3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1130522241, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349692663000, </span><span style="background: white; color: #a31515">&quot;days&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 74700, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 23400, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 19800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 78300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 74700, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 23400, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 19800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 78300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 74700, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 23400, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 19800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 78300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 74700, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 23400, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 19800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 78300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;6&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 67500, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 18.333, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 28800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 24300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 75600, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;5&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 67500, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 18.333, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 28800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 24300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 75600, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 74700, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 23400, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 19800, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 17.222, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;touched_by&quot;</span><span style="background: white; color: black">: 1, </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;touched_tzo&quot;</span><span style="background: white; color: black">: -18000, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;continuation&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;touched_at&quot;</span><span style="background: white; color: black">: 1349285499 }, </span><span style="background: white; color: #a31515">&quot;4&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 78300, </span><span style="background: white; color: #a31515">&quot;entry_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;setpoint&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;temp&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot; </span><span style="background: white; color: black">} } }, </span><span style="background: white; color: #a31515">&quot;schedule_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Basement Current Schedule&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;ver&quot;</span><span style="background: white; color: black">: 2 }, </span><span style="background: white; color: #a31515">&quot;SERIALNUM2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -462155699, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349674697000, </span><span style="background: white; color: #a31515">&quot;days&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: green">/* SAME AS ABOVE */ </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;schedule_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Second Floor Current Schedule&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;ver&quot;</span><span style="background: white; color: black">: 2 }, </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 2014520777, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349695806000, </span><span style="background: white; color: #a31515">&quot;days&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: green">/* SAME AS ABOVE */ </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;schedule_mode&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;HEAT&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;First Floor Current Schedule&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;ver&quot;</span><span style="background: white; color: black">: 2 } }, </span><span style="background: white; color: #a31515">&quot;shared&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;SERIALNUM3&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -493517056, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696367000, </span><span style="background: white; color: #a31515">&quot;auto_away&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;auto_away_learning&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;training&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_heat_x3_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_alt_heat_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;compressor_lockout_enabled&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_temperature_type&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;heat&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_heater_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_emer_heat_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;can_heat&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;compressor_lockout_timeout&quot;</span><span style="background: white; color: black">: 0, </span><span style="background: white; color: #a31515">&quot;hvac_cool_x2_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_temperature_high&quot;</span><span style="background: white; color: black">: 24.0, </span><span style="background: white; color: #a31515">&quot;hvac_aux_heater_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_heat_x2_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_temperature_low&quot;</span><span style="background: white; color: black">: 20.0, </span><span style="background: white; color: #a31515">&quot;target_temperature&quot;</span><span style="background: white; color: black">: 14.444, </span><span style="background: white; color: #a31515">&quot;hvac_ac_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;hvac_fan_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;target_change_pending&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Basement&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;current_temperature&quot;</span><span style="background: white; color: black">: 18.11, </span><span style="background: white; color: #a31515">&quot;hvac_alt_heat_x2_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;can_cool&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">true </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM1&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1432433268, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696363000 </span><span style="background: white; color: green">/* SAME AS ABOVE */ </span><span style="background: white; color: black">}, </span><span style="background: white; color: #a31515">&quot;SERIALNUM2&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 2060664119, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1349696709000 </span><span style="background: white; color: green">/* SAME AS ABOVE */ </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;user_alert_dialog&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;#USERID#&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: -1852987123, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1327246591000, </span><span style="background: white; color: #a31515">&quot;dialog_data&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;dialog_id&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;confirm-pairing&quot; </span><span style="background: white; color: black">} }, </span><span style="background: white; color: #a31515">&quot;user&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;#USERID#&quot;</span><span style="background: white; color: black">: { </span><span style="background: white; color: #a31515">&quot;$version&quot;</span><span style="background: white; color: black">: 209478897, </span><span style="background: white; color: #a31515">&quot;$timestamp&quot;</span><span style="background: white; color: black">: 1324159145000, </span><span style="background: white; color: #a31515">&quot;name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;EMAILADDRESS&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;structures&quot;</span><span style="background: white; color: black">: [</span><span style="background: white; color: #a31515">&quot;structure.#STRUCTURE-UUID#&quot;</span><span style="background: white; color: black">] } } }</span></pre>
<h2>Setting a Temperature</h2>
<p>Changing a thermostat’s current set point is easy.</p>
<p>You’ll need the Serial Number (shown as SERIALNUM1 in the JSON above) of the thermostat.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">POST https:<span style="color: #008000">//275be85a.transport.nest.com:443/v2/put/shared.01AA01AB4611009P HTTP/1.1</span>
Host: 275be85a.transport.nest.com:443
Accept-Language: en-us
User-Agent: Nest/3.0.1.15 (iOS) os=6.0 platform=iPad3,1
X-nl-<span style="color: #0000ff">base</span>-version: 2060664119
Accept: */*
Content-Type: application/json
X-nl-protocol-version: 1
X-nl-user-id: 7236
X-nl-session-id: ios-7236-371385438.528577
Connection: keep-alive
X-nl-merge-payload: <span style="color: #0000ff">true</span>
Authorization: Basic GIANT TOKEN STRING==
Content-Length: 60
Proxy-Connection: keep-alive
Accept-Encoding: gzip, deflate

{<span style="color: #006080">&quot;target_change_pending&quot;</span>:<span style="color: #0000ff">true</span>,<span style="color: #006080">&quot;target_temperature&quot;</span>:16.11111}</pre>
</div>
<p>Set the temperature in Celsius.</p>
<p>There’s also a polling subscription that happens. It’s extremely chatty and from the amount of polling it does, you’d think that the UI was doing live graphing of micro-temperature changes.</p>
<p>Essentially, the polling sends a series of keys, with timestamps, representing the various types of data being requested.</p>
<p>It looks something like this:</p>
<pre class="code"><span style="background: white; color: black">{ </span><span style="background: white; color: #a31515">&quot;keys&quot;</span><span style="background: white; color: black">: [{ </span><span style="background: white; color: #a31515">&quot;key&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;user.#USERID#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;version&quot;</span><span style="background: white; color: black">: 209478897, </span><span style="background: white; color: #a31515">&quot;timestamp&quot;</span><span style="background: white; color: black">: 1324159145000 }, { </span><span style="background: white; color: #a31515">&quot;key&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;user_settings.#USERID#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;version&quot;</span><span style="background: white; color: black">: 370836640, </span><span style="background: white; color: #a31515">&quot;timestamp&quot;</span><span style="background: white; color: black">: 1337481029003 }, { </span><span style="background: white; color: #a31515">&quot;key&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;user_alert_dialog.#USERID#&quot;</span><span style="background: white; color: black">, </span><span style="background: white; color: #a31515">&quot;version&quot;</span><span style="background: white; color: black">: -1852987123, </span><span style="background: white; color: #a31515">&quot;timestamp&quot;</span><span style="background: white; color: black">: 1327246591000 }, { </span></pre>
<p>It repeats for sections such as “shared”, “message”, “device”, “track”, and more. For my purposes, shared is the winner as it contains the current temperature.</p>
<p>&#160;</p>
<p>Node API</p>
<p>I decided to write a new demonstration application and polish it up a bit, this time using Node.</p>
<p>I’m not going to document the API that I created here (not right now), but here’s a sample of how it can be used:</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; height: 611px; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 600px; width: 97.5%; background-color: #f4f4f4">
<pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">var username = process.argv[2];
var password = process.argv[3];

<span style="color: #0000ff">if</span> (username &amp;&amp; password) {
    username = trimQuotes(username);
    password = trimQuotes(password);
    nest.login(username, password, function (data) {
        <span style="color: #0000ff">if</span> (!data) {
            console.log(<span style="color: #006080">'Login failed.'</span>);
            process.exit(1);
            <span style="color: #0000ff">return</span>;
        }
        console.log(<span style="color: #006080">'Logged in.'</span>);
        nest.fetchStatus(function (data) {
            <span style="color: #0000ff">for</span> (var deviceId <span style="color: #0000ff">in</span> data.device) {
                <span style="color: #0000ff">if</span> (data.device.hasOwnProperty(deviceId)) {
                    var device = data.shared[deviceId];

                    console.log(util.format(<span style="color: #006080">&quot;%s [%s], Current temperature = %d F target=%d&quot;</span>,
                        device.name, deviceId,
                        nest.ctof(device.current_temperature),
                        nest.ctof(device.target_temperature)));
                }
            }
            subscribe();
        });
    });
}

function subscribe() {
    nest.subscribe(subscribeDone);
}

function subscribeDone(deviceId, data) {
    <span style="color: #0000ff">if</span> (deviceId) {
        console.log(<span style="color: #006080">'Device: '</span> + deviceId)
        console.log(JSON.stringify(data));
    }
    setTimeout(subscribe, 2000);
}</pre>
</div>
<p>The example code runs forever. <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="blog/wpcontent/uploads/2012/10/wlEmoticon-smile1.png" /></p>
<p>I’ve included two methods in the API, “get” and “post” which make it simple to call additional web services that I haven’t yet provided.</p>
<p>Find the code here: <a title="https://github.com/wiredprairie/unofficial_nodejs_nest" href="https://github.com/wiredprairie/unofficial_nodejs_nest">https://github.com/wiredprairie/unofficial_nodejs_nest</a>.</p>
<p>Update: there’s a npm as well now (Dec 20, 2012)</p>
]]></content:encoded>
					
					<wfw:commentRss>/blog/index.php/archives/1754/feed</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1754</post-id>	</item>
		<item>
		<title>.NET API for Nest Thermostat</title>
		<link>/blog/index.php/archives/1449</link>
					<comments>/blog/index.php/archives/1449#comments</comments>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Tue, 10 Jan 2012 02:50:22 +0000</pubDate>
				<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">/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 [&#8230;]]]></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="blog/wpcontent/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="blog/wpcontent/uploads/2012/01/SNAGHTML88bff0b3.png"><img loading="lazy" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML88bff0b3" border="0" alt="SNAGHTML88bff0b3" src="blog/wpcontent/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="blog/archives/1442">returned</a>.</p>
<p>FYI: I’ve now written a Node version of the API, detailed <a href="blog/archives/1754" target="_blank">here</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/blog/index.php/archives/1449/feed</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1449</post-id>	</item>
		<item>
		<title>Nest Thermostat API/Protocol</title>
		<link>/blog/index.php/archives/1442</link>
					<comments>/blog/index.php/archives/1442#comments</comments>
		
		<dc:creator><![CDATA[Aaron]]></dc:creator>
		<pubDate>Sun, 08 Jan 2012 17:21:05 +0000</pubDate>
				<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">/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 [&#8230;]]]></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="blog/wpcontent/uploads/2012/01/image7.png"><img loading="lazy" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border-width: 0px;" title="image" src="blog/wpcontent/uploads/2012/01/image_thumb7.png" alt="image" width="381" height="225" border="0"/></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>
<p>&nbsp;</p>
<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="blog/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 </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">"keys"</span>:
    [{<span class="str">"key"</span>:<span class="str">"user.#USERID#"</span>,
        <span class="str">"version"</span>:209478897,<span class="str">"timestamp"</span>:1324159145000},
    {<span class="str">"key"</span>:<span class="str">"user_alert_dialog.#USERID#"</span>,
        <span class="str">"version"</span>:-1320296685,<span class="str">"timestamp"</span>:1325967612000},
    {<span class="str">"key"</span>:<span class="str">"structure.#STRUCTURE-GUID#"</span>,
        <span class="str">"version"</span>:656192675,<span class="str">"timestamp"</span>:1325967612000},
    {<span class="str">"key"</span>:<span class="str">"device.#DEVICE 1 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:1485027516,<span class="str">"timestamp"</span>:1326034984000},
    {<span class="str">"key"</span>:<span class="str">"shared.#DEVICE 1 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:588844038,<span class="str">"timestamp"</span>:1326034818000},
    {<span class="str">"key"</span>:<span class="str">"schedule.#DEVICE 1 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:1187107985,<span class="str">"timestamp"</span>:1326005677000},
    {<span class="str">"key"</span>:<span class="str">"track.#DEVICE 1 SERIAL NUMBER#"</span>,
        <span class="str">"timestamp"</span>:1326035650601,<span class="str">"version"</span>:1041047847},
    {<span class="str">"key"</span>:<span class="str">"device.#DEVICE 2 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:149169270,<span class="str">"timestamp"</span>:1326034820000},
    {<span class="str">"key"</span>:<span class="str">"shared.#DEVICE 2 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:659841570,<span class="str">"timestamp"</span>:1326034820000},
    {<span class="str">"key"</span>:<span class="str">"schedule.#DEVICE 2 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:-2016290692,<span class="str">"timestamp"</span>:1326005625000},
    {<span class="str">"key"</span>:<span class="str">"track.#DEVICE 2 SERIAL NUMBER#"</span>,
        <span class="str">"timestamp"</span>:1326035650862,<span class="str">"version"</span>:528978433},
    {<span class="str">"key"</span>:<span class="str">"device.#DEVICE 3 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:1637112547,<span class="str">"timestamp"</span>:1326035399000},
    {<span class="str">"key"</span>:<span class="str">"shared.#DEVICE 3 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:760504326,<span class="str">"timestamp"</span>:1326035397000},
    {<span class="str">"key"</span>:<span class="str">"schedule.#DEVICE 3 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:-314552357,<span class="str">"timestamp"</span>:1326003402000},
    {<span class="str">"key"</span>:<span class="str">"track.#DEVICE 3 SERIAL NUMBER#"</span>,
        <span class="str">"version"</span>:-645931164,<span class="str">"timestamp"</span>:1326035531802}]}"</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">"status"</span>: 200,
        <span class="str">"headers"</span>: {
            <span class="str">"X-nl-skv-key"</span>: <span class="str">"shared.#DEVICE 2 SERIAL NUMBER#"</span>,
            <span class="str">"X-nl-skv-version"</span>: 869022424,
            <span class="str">"X-nl-skv-timestamp"</span>: 1326038279000,
            <span class="str">"X-nl-service-timestamp"</span>: 1326038279825
        },
        <span class="str">"payload"</span>: {
            <span class="str">"current_temperature"</span>: 19.98,
            <span class="str">"hvac_fan_state"</span>: <span class="kwrd">false</span>,
            <span class="str">"name"</span>: <span class="str">"TWO"</span>, <span class="str">"hvac_heat_x2_state"</span>: <span class="kwrd">false</span>,
            <span class="str">"hvac_ac_state"</span>: <span class="kwrd">false</span>,
            <span class="str">"can_cool"</span>: <span class="kwrd">true</span>,
            <span class="str">"auto_away"</span>: 0,
            <span class="str">"compressor_lockout_enabled"</span>: <span class="kwrd">false</span>,
            <span class="str">"target_temperature_low"</span>: 16.66667,
            <span class="str">"target_temperature_high"</span>: 26.66667,
            <span class="str">"compressor_lockout_timeout"</span>: 0,
            <span class="str">"hvac_heater_state"</span>: <span class="kwrd">false</span>,
            <span class="str">"hvac_aux_heater_state"</span>: <span class="kwrd">false</span>,
            <span class="str">"target_temperature"</span>: 19.44444,
            <span class="str">"can_heat"</span>: <span class="kwrd">true</span>,
            <span class="str">"target_temperature_type"</span>: <span class="str">"heat"</span>,
            <span class="str">"target_change_pending"</span>: <span class="kwrd">true</span>
        }
    });</pre>
<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><span style="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. </span></p>
<p><span style="color: #333333;">Several seconds later, a much larger payload was returned to a <strong>subscribe </strong>request:</span></p>
<pre class="csharpcode"><span class="str">"status"</span>: 200,
<span class="str">"headers"</span>: {
    <span class="str">"X-nl-skv-key"</span>: <span class="str">"device.#DEVICE 2 SERIAL NUMBER#"</span>,
    <span class="str">"X-nl-skv-version"</span>: -2086438581,
    <span class="str">"X-nl-skv-timestamp"</span>: 1326038378000,
    <span class="str">"X-nl-service-timestamp"</span>: 1326038379023
},
<span class="str">"payload"</span>: {
    <span class="str">"ob_orientation"</span>: <span class="str">"O"</span>,
    <span class="str">"upper_safety_temp"</span>: 1000.0,
    <span class="str">"forced_air"</span>: <span class="kwrd">true</span>,
    <span class="str">"creation_time"</span>: 1324142042019,
    <span class="str">"switch_preconditioning_control"</span>: <span class="kwrd">false</span>,
    <span class="str">"click_sound"</span>: <span class="str">"on"</span>,
    <span class="str">"leaf"</span>: <span class="kwrd">false</span>, <span class="str">"user_brightness"</span>: <span class="str">"auto"</span>,
    <span class="str">"learning_state"</span>: <span class="str">"steady"</span>,
    <span class="str">"heat_pump_comp_threshold"</span>: -1000.0,
    <span class="str">"local_ip"</span>: <span class="str">"10.0.0.205"</span>,
    <span class="str">"backplate_serial_number"</span>: <span class="str">"#SHOULD BE DEVICE 2 SERIAL NUMBER, BUT ISN'T?#"</span>,
    <span class="str">"capability_level"</span>: 1.03,
    <span class="str">"postal_code"</span>: <span class="str">"#POSTALCODE#"</span>,
    <span class="str">"upper_safety_temp_enabled"</span>: <span class="kwrd">false</span>,
    <span class="str">"heat_pump_aux_threshold"</span>: 10.0,
    <span class="str">"lower_safety_temp_enabled"</span>: <span class="kwrd">true</span>,
    <span class="str">"serial_number"</span>: <span class="str">"#DEVICE 2 SERIAL NUMBER#"</span>,
    <span class="str">"temperature_lock"</span>: <span class="kwrd">false</span>,
    <span class="str">"learning_time"</span>: 1002,
    <span class="str">"current_version"</span>: <span class="str">"1.0.4"</span>,
    <span class="str">"model_version"</span>: <span class="str">"Diamond-1.10"</span>,
    <span class="str">"backplate_bsl_info"</span>: <span class="str">"BSL"</span>,
    <span class="str">"auto_away_enable"</span>: <span class="kwrd">true</span>,
    <span class="str">"heat_pump_comp_threshold_enabled"</span>: <span class="kwrd">false</span>,
    <span class="str">"fan_mode"</span>: <span class="str">"auto"</span>,
    <span class="str">"range_enable"</span>: <span class="kwrd">false</span>,
    <span class="str">"temperature_scale"</span>: <span class="str">"F"</span>,
    <span class="str">"backplate_mono_info"</span>: <span class="str">"TFE (BP_DVT) 3.5.2 (ehs@ubuntu) 2011-11-05 12:00:00"</span>,
    <span class="str">"backplate_bsl_version"</span>: <span class="str">"1.1"</span>,
    <span class="str">"equipment_type"</span>: <span class="str">"gas"</span>,
    <span class="str">"range_mode"</span>: <span class="kwrd">false</span>,
    <span class="str">"lower_safety_temp"</span>: 7.0,
    <span class="str">"has_fan"</span>: <span class="kwrd">true</span>,
    <span class="str">"hvac_wires"</span>: <span class="str">"Heat,Cool,Fan,Common Wire,Rc"</span>,
    <span class="str">"learning_mode"</span>: <span class="kwrd">true</span>,
    <span class="str">"away_temperature_high"</span>: 32.0,
    <span class="str">"switch_system_off"</span>: <span class="kwrd">false</span>,
    <span class="str">"time_to_target"</span>: 1326039444,
    <span class="str">"away_temperature_low"</span>: 14.444444444444445,
    <span class="str">"current_humidity"</span>: 45,
    <span class="str">"mac_address"</span>: <span class="str">"#MACADDR#"</span>,
    <span class="str">"backplate_mono_version"</span>: <span class="str">"3.5.2"</span>,
    <span class="str">"has_aux_heat"</span>: <span class="kwrd">false</span>,
    <span class="str">"type"</span>: <span class="str">"TBD"</span>,
    <span class="str">"hvac_pins"</span>: <span class="str">"W1,Y1,C,Rc,G"</span>,
    <span class="str">"has_heat_pump"</span>: <span class="kwrd">false</span>,
    <span class="str">"heat_pump_aux_threshold_enabled"</span>: <span class="kwrd">true</span>,
    <span class="str">"battery_level"</span>: 3.945,
    <span class="str">"target_time_confidence"</span>: 1.0
}</pre>
<p>&nbsp;</p>
<p>A few things to note:</p>
<ul>
<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;&#8221;Sun Jan 08 2012 10:17:24 GMT-0600 (Central Standard Time)&#8221;</strong>Next, a payload is returned with the new status:
<pre class="csharpcode"><span class="str">"status"</span>: 200,
<span class="str">"headers"</span>: {
    <span class="str">"X-nl-skv-key"</span>: <span class="str">"shared.#DEVICE 2 SERIAL NUMBER#"</span>,
    <span class="str">"X-nl-skv-version"</span>: 1689916148,
    <span class="str">"X-nl-skv-timestamp"</span>: 1326038378000,
    <span class="str">"X-nl-service-timestamp"</span>: 1326038379151
},
<span class="str">"payload"</span>: {
    <span class="str">"hvac_fan_state"</span>: <span class="kwrd">false</span>,
    <span class="str">"name"</span>: <span class="str">"TWO"</span>,
    <span class="str">"hvac_heat_x2_state"</span>: <span class="kwrd">false</span>,
    <span class="str">"hvac_ac_state"</span>: <span class="kwrd">false</span>,
    <span class="str">"can_cool"</span>: <span class="kwrd">true</span>,
    <span class="str">"auto_away"</span>: 0,
    <span class="str">"compressor_lockout_enabled"</span>: <span class="kwrd">false</span>,
    <span class="str">"target_temperature_low"</span>: 16.66667,
    <span class="str">"current_temperature"</span>: 19.53,
    <span class="str">"target_temperature_high"</span>: 26.66667,
    <span class="str">"compressor_lockout_timeout"</span>: 0,
    <span class="str">"target_change_pending"</span>: <span class="kwrd">false</span>,
    <span class="str">"hvac_aux_heater_state"</span>: <span class="kwrd">false</span>,
    <span class="str">"target_temperature"</span>: 20.55556,
    <span class="str">"can_heat"</span>: <span class="kwrd">true</span>,
    <span class="str">"target_temperature_type"</span>: <span class="str">"heat"</span>,
    <span class="str">"hvac_heater_state"</span>: <span class="kwrd">true</span>
}</pre>
<p>&nbsp;</p>
<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">"schedule"</span>: {
    <span class="str">"#DEVICE 2 SERIAL NUMBER#"</span>: {
        <span class="str">"$version"</span>: 1187107985,
        <span class="str">"$timestamp"</span>: 1326005677000,
        <span class="str">"name"</span>: <span class="str">"One Current Schedule"</span>,
        <span class="str">"days"</span>: {
            <span class="str">"0"</span>: {
                <span class="str">"0"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 14.445,
                    <span class="str">"time"</span>: 0,
                    <span class="str">"entry_type"</span>: <span class="str">"continuation"</span>
                },
                <span class="str">"1"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 14.445,
                    <span class="str">"time"</span>: 27900,
                    <span class="str">"entry_type"</span>: <span class="str">"setpoint"</span>
                },
                <span class="str">"2"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 20.556,
                    <span class="str">"time"</span>: 63000,
                    <span class="str">"entry_type"</span>: <span class="str">"setpoint"</span>
                },
                <span class="str">"3"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 14.445,
                    <span class="str">"time"</span>: 70200,
                    <span class="str">"entry_type"</span>: <span class="str">"setpoint"</span>
                }
            },
            <span class="str">"1"</span>: {
                <span class="str">"0"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 14.445,
                    <span class="str">"time"</span>: 0,
                    <span class="str">"entry_type"</span>: <span class="str">"continuation"</span>
                },
                <span class="str">"1"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 18.889,
                    <span class="str">"time"</span>: 20700,
                    <span class="str">"entry_type"</span>: <span class="str">"setpoint"</span>
                },</pre>
<p>&nbsp;</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="blog/wpcontent/uploads/2012/01/image8.png"><img loading="lazy" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border-width: 0px;" title="image" src="blog/wpcontent/uploads/2012/01/image_thumb8.png" alt="image" width="500" height="37" border="0"/></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">"payload"</span>: {
        <span class="str">"days"</span>: {
            <span class="str">"0"</span>: {
                <span class="str">"0"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 14.685,
                    <span class="str">"time"</span>: 0,
                    <span class="str">"entry_type"</span>: <span class="str">"continuation"</span>
                },
                <span class="str">"1"</span>: {
                    <span class="str">"type"</span>: <span class="str">"HEAT"</span>,
                    <span class="str">"temp"</span>: 15.000444444444444,
                    <span class="str">"time"</span>: 24300,
                    <span class="str">"entry_type"</span>: <span class="str">"setpoint"</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">"headers"</span>: {
        <span class="str">"X-nl-client-timestamp"</span>: 1326041210566,
        <span class="str">"X-nl-session-id"</span>: <span class="str">"#SESSION ID#"</span>,
        <span class="str">"X-nl-protocol-version"</span>: 1,
        <span class="str">"Authorization"</span>: <span class="str">"Basic #BASIC AUTH#"</span>
    },
    <span class="str">"path"</span>: <span class="str">"/v1/put/schedule.#DEVICE 2 SERIAL NUMBER#"</span>,
    <span class="str">"redir"</span>: <span class="str">"https://home.nest.com/post_jsonp"</span>,
    <span class="str">"jsonp"</span>: <span class="str">"4_"</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">"payload"</span>: {
        <span class="str">"shared"</span>: {
            <span class="str">"#DEVICE 2 SERIAL NUMBER#"</span>: {
                <span class="str">"target_temperature"</span>: 18.333333333333336
            }
        }
    },
    <span class="str">"headers"</span>: {
        <span class="str">"X-nl-client-timestamp"</span>: 1326041744556,
        <span class="str">"X-nl-session-id"</span>: <span class="str">"#SESSION ID#"</span>,
        <span class="str">"X-nl-protocol-version"</span>: 1,
        <span class="str">"Authorization"</span>: <span class="str">"Basic #BASIC AUTH#"</span>
    },
    <span class="str">"path"</span>: <span class="str">"/v1/put"</span>,
    <span class="str">"redir"</span>: <span class="str">"https://home.nest.com/post_jsonp"</span>,
    <span class="str">"jsonp"</span>: <span class="str">"14_"</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>
<p>FYI: I also have a <a href="blog/archives/1754">Node</a> version of the API that is more up to date than this.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>/blog/index.php/archives/1442/feed</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1442</post-id>	</item>
	</channel>
</rss>
