Nest Update #11: Resetting Ranges

Quick update about a new bug/issue/feature in the Nest thermostat that I’ve encountered.

Here’s the before image:

image

I’ve used the new Nest 2.0 software to set ranges for the various floors as you can see above. I captured that image on the 30th of May.

Here’s the image from this morning (4th of June):

image

The first floor is set to Off as I neglected to take a screen shot before I adjusted the setting (and I’d turned the Basement back On earlier, so ignore that).

However, the First Floor had the same range as the Second Floor in the shot above (68-75F) before I switched it to Off. Yes, automatically, two of the active Nests had reset their range from my choice back to the defaults. That’s an expensive choice during the hot muggy summers of Wisconsin (or any time of the year). This is the second time this has actually happened.

It also happened while were were on vacation recently (but I hadn’t had visual evidence). The house went from a range of 62-84F to 68-75F. While I’m sure our house cat appreciated it, our electrical bill will not (as it was extremely hot while we were away).

And if you’re planning on trolling/flaming this post, don’t bother. I won’t publish it.

A bit of reflow, using TweenJS

Inspired by some modern applications (especially the “Metro” look and feel), I wanted to put together an animated tile reflow script for an HTML page I was creating.

As the size of the page changes, the tiles move into their new positions.

SNAGHTML113b633f[4]

You can try it here, if you’re using a modern browser (IE9+, Chrome, FF, Safari, etc.).

Dependencies:

  1. TweenJS
  2. EaselJS (for the ticker used in TweenJS)
  3. CSSPlugin (an add on to the the TweenJS library)
  4. jQuery (1.7.2)

Relayouts are queued (as to prevent multiple from running).

Only boxes that will be visible to the end user (either animating to the screen or off the screen) are animated. It does not animate elements that do not start or end in the current viewport including boxes that would animate “through” the current viewport. I considered the latter to not add anything to the overall experience and just uses more CPU to perform the animations, so I intentionally left it out.

In the layout loop, the code verifies that the animation needs to run:

// here's the final destination
pos = { left: Math.round(x), top: Math.round(y) };

// check old and new positions, if either are in the viewport, we'll animate
if (isScrolledIntoView(pos.top + parentOfBoxesOffsetTop, boxH) || isScrolledIntoView(box.y + parentOfBoxesOffsetTop, boxH)) {
    Tween.get(box.e).to(pos, 500 + 500 * Math.random(), 
        Ease.quadInOut).call(function () {
            --layoutPending;
            if (!layoutPending && queuedLayout) { queueLayout(); }
    });
} else {

If it needs to animate, the code uses the static Tween method “get” to start an animation on the current element.

  1. Tween.get(box.e) creates a new instance of the Tween class (initialized with the element to tween).
  2. Using that Tween instance, the CSS attributes (thanks to the handy CSSPlugin), for left and top are animated for at least 500ms and up to a full second. The easing function I chose is quadInOut. Tip: Here’s a great way to visualize easing options using TweenJS.
  3. Finally, when the animation completes, an anonymous function is called which decrements the number of pending animations and if there are no remaining elements to animate, and there’s something queued, another cycle is started.

All the code used by the demo is in default.html.

Colors of the boxes were set using hsl (only available in modern browsers):

box.style.backgroundColor = "hsl(" + c + ", 100%, 50%)";

Where “c” is:

c = (i / boxes * 360).toFixed(1);

Adding an External Tool for Compiling LESS files in WebStorm (on Windows)

Interested in converting/compiling LESS files into their CSS counterparts?

Here are the steps (from version 4 of WebStorm from JetBrains).

1. Install Node JS

2. Install the node package (using npm) for less (remember where you install this as you’ll need the path later):

    npm install less

3. In WebStorm, File > Settings, then under the IDE Settings heading, select External Tools.

4. Click on the + icon to add a new tool:

image

5. You’ll see a dialog very much like this:

SNAGHTMLcd7f5f5

6. Fill it out like this (substitute whatever you’d like of course):

SNAGHTMLceae4a7

I chose not to have the console window open every time the compilation occurs.

The only things you’ll need to change is the path to the file lessc. That file is actually JavaScript file (minus the extension). So, replace the first quoted parameter in “Parameters” above with the location that you installed the package for less in.

As it’s a JavaScript file you need to be executed, the “Program” is set to the node executable. Provide the full path (when I didn’t, it sometimes wouldn’t work and would complain that a path didn’t exist).

"###YOUR PATH TO LESSC###\lessc" $FilePath$ "$FileDir$\$FileNameWithoutExtension$.css"

I tried using the Working Directory option and it also worked inconsistently with Node. So, I used the options you see above and it seemed to work more consistently.

7. I also added a shortcut so I could execute it on demand:

SNAGHTMLcdbd3f4

SNAGHTMLcdc51ca

I picked Ctrl+Alt+L, as it was memorable (and available!).

While this is not using a file watcher technique (you could do that if you’d like instead), it works well enough for my workflow.

Backup Reminder for Windows Home Server 2011

This is just a reminder to anyone who uses Windows Home Server’s Backup functionality to verify Backups are working.

I love the “turn it on and forget about it” feature of WHS backup. Computers automatically wake, backup, and sleep. Nice.

However, I noticed last week that at some point WHS2011 had an issue more than a month ago where it no longer was backing up ANY of the Windows PCs in our house (2 laptops, 2 desktops).

No actionable errors had occurred in March that I could find, so I can’t pinpoint a reason. I needed to go to every Windows PC in our house and re-enable backups. Thankfully, it didn’t need to start over from scratch (it picked up where it left off).

image

Needless to say, having your computer backups silently fail is a bit worrisome. As many WHS2011 users likely don’t routinely go to the WHS dashboard – you might want to occasionally and check that every thing is OK.

I don’t use the LAUNCHPAD much as it tends to be the “software who cried wolf” too often. But, even if I had, I couldn’t see any indication in the Dashboard that I would have been alerted to this issue (since alerts are all saved until resolved or ignored).

SNAGHTML7ba7bdb

(The two warnings shown in the screenshot are for: “Important updates should be installed.” and “Free space is low.” AKA, A drive has only 62GB free (10%)).

If you do use the LAUNCHPAD, you can verify the last backup by clicking the “Backup” button. You should see something like this in the dialog that is opened:

image

SVG Setting Text Content Dynamically

Continuing on a theme of animating SVG, I’ve added a label in the center of the animation which contains the current angle of the ever-rotating marker (in fact in a centered horizontally and vertically SVG text node).

(Click image below to try it.)

image

At the bottom of the file from the previous post, I’ve added the following:

    <text id="currentValueAsText" x="300" y="300" 
        style="text-anchor: middle;alignment-baseline:middle" 
        fill="#FFFFFF" font-family="'Arial'" font-size="96" opacity=".6">0</text>

It’s a new text node. It’s set to centered both horizontally and vertically (using the text-anchor and alignment-baseline style properties respectively) at 300,300.

Setting the content is simple as well:

(function () {
    window.onload = loaded;
    function loaded() {
        var colorTemp = document.getElementById("color-temp");
        var reading = document.getElementById('current-reading');
        var currentVal = document.getElementById("currentValueAsText");
        var currentAngle = 0;
        var fill;

        var direction = 1;
        setInterval(function () {
            currentAngle += direction;
            if (currentAngle >= 120 || currentAngle <= -120) {
                direction *= -1;
            } else if (currentAngle === 0) {
                fill = direction === 1 ? "#BE1E2D" : "#10A2DC";
                colorTemp.setAttribute("fill", fill);
            }
            // adjust the opacity
            colorTemp.setAttribute("opacity", Math.abs(currentAngle) / 120.0);
            reading.setAttribute("transform", "rotate(" + currentAngle + ")");
            currentValueAsText.textContent = currentAngle.toString();

        }, 25);
    }
})();

Use the textContent property of the SVG text node to set the text.

Done. Smile