Sun, 13 Nov 2016

Scripting A Light Bulb

This is adapted from an email I sent to an internal "gadget fan" mailing list at work in response to a question someone asked about controlling lighting electronically.

I went “simple” and I’m pretty happy with it.

I bought this bulb from Amazon.

It’s made in China and sold under several different brand names, most commonly “Flux” and “Magichome.”

You can get the WiFi RGBW version from Amazon (and a domestic seller) for ~$35.

If you feel comfortable shopping via Alibaba (I don’t) you could probably get it for ~$20.

There are several client tools for interacting with them. I’ve used one written in Go and an (easier to work with, IMO) one written in Python.

It doesn't do the dumb thing (UPnP on the open internet) so no, my light bulb isn't helping to bring down Twitter.

In addition, if you live in the iOS universe there’s a plugin that makes it work with Homebridge (and hence HomeKit.)

I can tell Siri to control my lights. Useless, but fun.

More practically, I wrote a Python script that turns on the lamp in my son’s room in the morning and gradually eases him up with subtle color changes.

It kicks off from a cron job running on a Raspberry Pi. (It doesn’t have to be a Pi, of course — any Linux machine or Mac would work.)

I’m sure it could be made to work from Windows, too, but that’s Somebody Else’s Problem. 😁

:: 19:57
:: /tech/gadgets | [+]
::Comments (0)

The Magic Word:
Which planet is closest to the sun? (hint -- it's Mercury...)

David Brinkley: The daily astrological charts are precisely where, in my
judgment, they belong, and that is on the comic page.
George Will: I don’t think astrology belongs even on the comic pages.
The comics are making no truth claim.
Brinkley: Where would you put it?
Will: I wouldn’t put it in the newspaper. I think it’s transparent rubbish.
It’s a reflection of an idea that we expelled from Western thought in the
sixteenth century, that we are in the center of a caring universe. We are
not the center of the universe, and it doesn’t care. The star’s alignment
at the time of our birth — that is absolute rubbish. It is not funny to
have it intruded among people who have nuclear weapons.
Sam Donaldson: This isn’t something new. Governor Ronald Reagan was sworn
in just after midnight in his first term in Sacramento because the stars
said it was a propitious time.
Will: They [horoscopes] are utter crashing banalities. They could apply to
anyone and anything.
Brinkley: When is the exact moment [of birth]? I don’t think the nurse is
standing there with a stopwatch and a notepad.
Donaldson: If we’re making decisions based on the stars — that’s a cockamamie
thing. People want to know.
— “This Week” with David Brinkley, ABC Television, Sunday, May 8, 1988,
excerpts from a discussion on Astrology and Reagan