{"id":416,"date":"2008-01-03T00:57:12","date_gmt":"2008-01-03T05:57:12","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/03\/geekostat\/"},"modified":"2008-01-03T00:57:12","modified_gmt":"2008-01-03T05:57:12","slug":"geekostat","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/03\/geekostat\/","title":{"rendered":"Geekostat"},"content":{"rendered":"<p><em>Disclaimer: I can tell right now that this is one of those late-night posts where I should be sleeping, not posting about a technical topic. But these not-entirely-lucid ones are sometimes the most fun to read.<\/em><\/p>\n<p>I consider myself extremely tech-savvy. I can build a computer from parts, make my own Ethernet cables, run some performance tuning on interactive websites, write applications in numerous programming languages (as well as SQL and HTML), and much more.<\/p>\n<p>But I still don&#8217;t get our digital thermostat. They&#8217;re programmed to go down to 58 at night, come up to 67 on weekends and from something like 6 to 9 a.m., and 3 to 9 p.m. on weekdays. In other words, when people are home.<\/p>\n<p>Of course, me being home on vacation isn&#8217;t quite compatible with this. There&#8217;s a simple override, where you can hit the up or down arrows to set it to a temperature. While I use (and appreciate!) this, it&#8217;s also a pain. It&#8217;s really no fun waking up and having it be 58. I&#8217;d really like to reprogram it to automatically come up to 63 or so around 10:30.<\/p>\n<p>I still don&#8217;t get why the whole thing isn&#8217;t on the LAN. This would have two obvious benefits right out of the gate&#8211;it&#8217;d be much easier to configure (even if you let someone with no clue about usability design the GUI, it&#8217;ll be better than the myriad knobs, switches, and buttons on our thermostat!), and it&#8217;d be more convenient in many cases to pull up a new tab in your web browser than to walk down the hall to the thermostat. (Plus, the thermostat is in my parents&#8217; bedroom. I&#8217;d have loved to have turned the heat up a few degrees around 11 tonight, since it&#8217;s 9 outside and almost as cold inside. But something tells me they really wouldn&#8217;t have appreciated it.)<\/p>\n<p>I&#8217;m also not sure that the &#8216;simple&#8217; thermostat algorithm is that efficient. You figure it works something like:<\/p>\n<pre>\n<blockquote>while(1) {\n$temp = getTemperature();\n$desired = readDial();\nif($temp<$desired) furnace.enable;\nif($temp>$desired) furnace.disable;\n}<\/blockquote><\/pre>\n<p>When we view it at &#8216;computer speed,&#8217; I think we can see one of the basic problems: in theory, the furnace could start <a href=\"http:\/\/en.wikipedia.org\/wiki\/Route_flapping\">flapping<\/a>, where on one loop iteration it turns the furnace on, and just a fraction of a second later, it turns it off. I don&#8217;t profess to know a lot about the overhead in starting a furnace, but I&#8217;d imagine that it&#8217;s most efficient to let it run for a few minutes.<\/p>\n<p>I think a much better system would be to have a programmed minimum run time: if the furnace is turned on, we should run it for at least 5 minutes. After 5 minutes, we again evaluate the temperature: if it&#8217;s at the target, we turn it off. If not, we drop into a quicker polling, maybe once every minute. Incidentally, this is much better for the thermostat&#8217;s processor, but if its sole purpose is determining whether to turn something on or off, no one really cares about minimizing overhead.<\/p>\n<p>So you give it a secondary purpose: handling a TCP\/IP stack and a basic webserver! All of a sudden, instead of an infinite loop, you run a tiny bit of code every 30 seconds.<\/p>\n<p>You can also generate some interesting statistics. For example, how long does the furnace need to run to raise the temperature one degree? How does this scale&#8211;if you want to raise it three degrees, does it take three times as long? How does the temperature of my house look when graphed across a day? How about telling me how long the furnace ran yesterday? And, given information about my furnace&#8217;s oil consumption and our fuel costs, it&#8217;d be cool to see how much it&#8217;s costing. And it could give us suggestions: &#8220;If you drop the temperature from 68 to 67, you&#8217;ll save $13.50 a month,&#8221; or such. This would require some storage, but a gig of solid-state media (e.g., a camera&#8217;s SD or CF card) is around $10-20 now. Plus, with the advent of AJAX, you can push some of the processing off to the client&#8211;let the client use a Flash applet or some good Javascript to draw the graphs if the thermostat is underpowered!<\/p>\n<p>In conclusion, I&#8217;m freezing.<\/p>","protected":false},"excerpt":{"rendered":"<p>Disclaimer: I can tell right now that this is one of those late-night posts where I should be sleeping, not posting about a technical topic. But these not-entirely-lucid ones are sometimes the most fun to read. I consider myself extremely &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2008\/01\/03\/geekostat\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,11,15,16,18,22,24],"tags":[],"class_list":["post-416","post","type-post","status-publish","format-standard","hentry","category-ideas","category-insanity","category-living","category-materialism","category-ocd","category-programming","category-rants-raves"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=416"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/416\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}