Wall Outlets with USB Ports

Posted on | | Leave a Comment on Wall Outlets with USB Ports

In case you didn’t know, wall outlets with USB ports are a thing. They’re neat for a couple reasons:

  • Cleaner look, no wall-wart chargers hanging off the wall or falling out the socket
  • Always there and don’t disappear because someone has to quickly pack for a business trip
  • 110V receptacles can be used for other things that USB-chargers

When we moved in 2017 I installed outlets with USB-A ports in a couple of strategic locations and really liked them. The most-used locations are the kitchen and hallway where we tend to charge phones, bike-lights and so on.

This hallway outlet powers baby-monitor charger, dual Qi charger for AirPods, an IKEA ZigBee repeater and the house thermostat. The ZigBee repeater could probably be in a USB port.

I also installed an outlet with USB-ports behind our bed headboard to charge phones at night. This works fine, but in retrospect was it also relatively pointless: There’s already power strip behind the headboard to power reading lights and other stuff so the USB outlet doesn’t make it any cleaner or more convenient than a wall-wart in the power strip.

12W USB-A type outlets were fine for 2017: USB-C wasn’t all that common (at least not for charging phones and tablets) and you couldn’t get outlets with high-power PD type USB-C ports anyway. That left me without an elegant way to charge our USB-C/Thunderbolt-port laptops. Without having done any research, my understanding is that Ultrabook-style Windows laptops generally require at least 45W to charge, and can typically accept higher charge rates. Way more than what comes out of the USB-A ports.

Laptop charging around the house became less of a problem with the pandemic because both my partner and I now haw full-featured home desk setups that we plug into, but a new one cropped up: HomePod Minis. These are in plain sight in our kitchen and I never really liked the look of the 20W wall-wart with a wire snaking down to the inevitable coil around the base of the speaker. HomePod Minis originally required the full output of the included 20W charger, but a software update dialed that down to 18W—still too much for USB-A outlets.

Not a good look

I’ve periodically checked for outlets with higher-power USB-C ports, and they finally starting showing up this past year. I was slightly annoyed it took so long since it’s an obvious improvement and 3rd party wall-wart manufacturers like Anker were perfectly capable of churning out GAN-based chargers that would fit within the envelope of a standard US wall receptacle. I guess safety regulations, heat-dissipation and reliability requirements combine to make designing a wall-plug receptacle integrating high-power USB-C ports harder than it seems. 

Regardless, we’re now spoiled for choice and you can get outlets with (at the time of writing) up to 60W single-port output, enough to charge even relatively powerful laptops. When deciding which ones to get, I was tempted to spring for the most powerful (and expensive) option, also because installing outlets involves turning off electrical breakers and is generally annoying and not something I’d want to do again later to upgrade. But I ended up going for a much cheaper dual USB-C ELEGRP model with 36W max output (18W per port) that I can’t find on Amazon anymore.

Much better. Above the outlet is an off-brand “MagSafe compatible” charger.

I chose those partly because they’re powerful enough to power our HomePod Minis and high-output MagSafe chargers, and partly because I’ve largely switched to Apple Silicon Laptops that have much lower power draw. In fact, both my M2 MacBook Air and (work) M1 MacBook Pro can charge (albeit very slowly) off the old USB-A style outlets (I’m sure someone’s going to point out in the comments that one should only use a proper Mac charger and that I’m ruining my laptop batteries and so on, but I’m going to go ahead and assume that whoever designed the charge controller chose to add support for those charging speeds because it’s safe).

So there you have it: Wall outlets with integrated USB charging ports are awesome and are now powerful enough to power small speakers and even laptops, in addition to charging phones and tablets. And outlets with built-in USB ports look much cleaner than wall-warts that fall out, go missing and take up an outlet.

Ecobee3 Lite, two wires and fan-only

Posted on | | Leave a Comment on Ecobee3 Lite, two wires and fan-only

This post covers how I upgraded our home thermostat from a battery-powered two-wire setup to an Ecobee3 Lite supporting both heating and fan-only modes. I wanted the fan-only mode to circulate air in our two-level condo where hot days often result in a hot and stale 2nd floor and a frigid 1st floor.

Note that I’m neither an electrician nor an HVAC pro and it’s very possible that what I did is a very bad idea. But it worked for me, so I thought I’d share.

Our house only has two wires running from the thermostat mount in the condo to the furnace in the garage, just enough to complete an electrical on/off circuit used to tell the furnace whether to heat or not. This is the dreaded “no C-wire” situation with no way to power a smart thermostat and no way for the thermostat to tell the furnace to just run the air circulation fan. Our furnace is relatively modern and has more wire terminals, but running additional wires from the condo down to the garage was not really an option.

Two wires 🙁

To overcome this I bought two items:

  • A 24V transformer that’s plugged into an outlet near the thermostat mount inside the condo. This powers the Ecobee
  • A Fast-Stat Model 1000. This gizmo consists of sender (inside) and receiver (furnace) components. It works by multiplexing additional control signals (for fan-only, in my case) over the single installed wire-pair. Higher-model-number Fast-Stats can provide more virtualized wires, but I just needed one

The first step was to install the Fast-Stat. It comes with easy-to-follow instructions and wiring it into our furnace’s clearly labeled bread-board-like circuit board was relatively simple.

Furnace-side Fast-Stat install

With the Fast-Stat installed I could run both heating and fan-only modes using the old dumb thermostat, validating that it’s working correctly.

Next, I mounted the new Ecobee and wired it up with the wires from the Fast-Stat and from the 24V transformer. The first time I did this, I got it wrong. I wired the transformer wires to C (“Common”) and R(c) (for “Red-Cooling”, I believe) and put the black wire in R(h) (for “Red-Heating”). I guess I thought that the Ecobee wanted it that way because it’s going to be running the heating system (hence R(h)) and the transformer instructions said to connect to C and R(c) wires.

With that ready the Ecobee turned on fine and all the wires showed up in the Ecobee configuration interface. Heating even worked! I couldn’t make the Ecobee run the fan-only mode, however, and at this point I actually gave up on fan-only for a couple of months, happy that I could at least control heating using the fancy new smart thermostat.

This weekend I had a chance to fiddle with the thermostat some more, and managed to get everything working. First I tried just connecting the G (“Green”) terminal (which runs just the fan) to R(h) with a piece of wire and the fan duly started whooshing air around. This was not surprising since the old dumb thermostat could to that too, but at least it showed that the wiring and connections on the Ecobee mount were OK.

Then I tried simply reversing the inputs to the R(c) and R(h) terminals so the transformer wire went to R(h) and the furnace control wire to R(c). In that configuration the Ecobee wasn’t getting any power and wouldn’t turn on. The breakthrough was to simply jam both the transformer and the furnace control wire into the R(c) terminal of the Ecobee mount. Re-reading the Ecobee instructions that makes some sense because the Ecobee wants to always use the R(c) terminal for systems with only one R-wire.

Working setup

In spite of much googling I never found complete instructions for combining a 24V transformer and a Fast-Stat to make an Ecobee work for both heating and fan-only with a two-wire system. I hope this post helps others with the same setup.

Screen scraping flight data from Amadeus checkmytrip.com

Posted on | | 3 Comments on Screen scraping flight data from Amadeus checkmytrip.com

checkmytrip.com let’s you input an airplane flight booking reference and your surname in return for a flight itinerary. This is useful for building all sorts of services to travellers. Unfortunately Amadeus doesn’t have an API, nor are their url’s restful. Using Python, mechanize, htm5lib and BeautifulSoup, you can get at the data pretty easy though.

It is somewhat unclear whether Amadeus approve of people scraping their site, related debate here (check the comments).

I’m not a very good Python programmer (yet!) and the script below could probably be improved quite a lot:

import re
import mechanize
import html5lib
from BeautifulSoup import BeautifulSoup

br = mechanize.Browser()
re1 = br.open("http://www.checkmytrip.com")
br.select_form(nr=2)
br["REC_LOC"] = "BOOKREF"
br["DIRECT_RETRIEVE_LASTNAME"] = "LASTNAME"
re2 = br.submit()
html = re2.read()
doc = html5lib.parse(html)
soup =  BeautifulSoup(doc.toxml())
flightdivs = soup.findAll('div', { "class" : "divtableFlightConf" } )
for div in flightdivs:
    table = div.table
    daterow = table.findChildren("tr")[2]
    datecell = daterow.findChildren("td")[1].string.lstrip().rstrip()
    maincell = table.findChildren("tr")[3]
    timetable = maincell.table.findChildren("tr")[0].td.table
    times =  timetable.findAll("td", {"class" : "nowrap"})
    dtime = times[0].string.lstrip().rstrip()
    atime = times[1].string.lstrip().rstrip()
    airports = timetable.findAll("input", {"name" : "AIRPORT_CODE"})
    aairport = airports[0]['value'].lstrip().rstrip()
    dairport = airports[1]['value'].lstrip().rstrip()
    flight = table.findAll("td", {"id" : "segAirline_0_0"})[0].string.lstrip().rstrip()
    print '--'    
    print 'date: ' + datecell
    print 'departuretime: ' + dtime
    print 'arrivaltime: ' + atime
    print 'departureairport: ' + dairport    
    print 'arrivalairport: ' + aairport
    print 'flight: ' + flight