Latitude is (almost-)dead – how do I go on?

I’ve espoused the virtues of Latitude as it relates to my Home Automation obsession.  While Google’s Location service once provided a critical means to validate home/way state, it was always critical in the determination of “occupant prediction” – that is, setting up a home-automation posture in anticipation of homeward-bound residents.

It’s no news anymore that Google is shuttering Latitude on August 9th.  It’s something that I predicted on my twitter feed, and I wasn’t alone in feeling that the end was near.

Google attempted to placate the masses by adding a Location feature to Google+, but from a developer perspective it was the retirement of the Latitude API that hurt the most – never mind the giveth/taketh soreness that has come out of Google’s decision to maintain Location History but close it off to 3rd-party developers going forward.

Whatever.  That ship has sailed (or soon will).  The bigger question for me was – how the heck do I keep location-awareness as a staple in my home-automation system?

I was pretty sure that 3rd-party solutions would crop up, ala the Google Reader debacle.  But unlike RSS feeds, there’s something very personal about location data.  Obviously I was (am) placing a large amount of trust in Google to hand over my location data to them, but I was very loathe to do the same for any other entity on the face of the planet.

So I enlisted my go-to man Tasker to fill the void.

Tasker always had a close relationship with Latify on my smartphone.  Tasker would determine which of three Latify profiles were most suitable at any given time.  So it wasn’t a huge stretch to rip out Latify and have Tasker poll location itself, sending that information to my home server so it could Do Something(tm).

And in a nutshell… that’s all there is to it.  With the help of the Tasker App Factory, I’ve produced an .apk that’s been installed on the wifey’s phone and – voila – the home automation system will remain location-aware after August 9.

So that’s part one.  And a very important part it is.

Part two encompasses what to do about sharing location information with friends, whcih is what one traditionally thinks of when they think of Google Latitude.  And in all honesty, I’ve only ever really seen that as valuable in the context of family, where each member probably wants to know where the other is for safety reasons.  To that end I whipped together a page on my intranet which takes Tasker’s reported location data and puts it on a lovely map.  As with all things intranet, this page is accessible from the Internet at large – for authorized users – and works on a laptop as well as it does on a smartphone.  It uses the Google Maps API for all the map-py stuff, AJAX so that locations update dynamically, and it’s generally Very Cool(tm).

So there it is – I’m quite happy with the current solution.  So a heartfelt “Thanks!” to Google for $crewing developers the world over once again.

What have I been up to? (“Home Automation” edition)

Apologies for the dearth of updates.  The silent masses have been wailing my name incessantly as a result.  I hear you, your screams are defeaning.

(WTF?)

Things have been… different… this year.  That’s about as much as I can say at the moment.  The lack of a stable “all systems OK” comfort zone has basically meant that I’m in maintenance mode more than anything else.  Hence – little in the way of blog updates and other reckless indulgences 🙂

Anyhoo, on to the subject of this particular post.  And this will likely be quick.

You may recall that, to-date, the home automation system consists primarily of surveillance, hvac, and music.  Much hasn’t changed in that respect, but I have been able to make some changes that have increased the reliability, efficiency and usefulness of the system.

Surveillance first.  The most notable change here has been the inclusion of HTML5-compatible transcoded video.  For some time I’ve relied on Flash to allow for remote viewing of archived surveillance video – but having upgraded my phone to Jelly Bean and settled on Chrome as my browser of choice, Flash is no longer an option on that particular device.  To that end, the backend transcodes video into both Flash and x264 formats.  The format available to you is in the browser is determined automagically.

Other small changes have been the regular code cleaning that occurs when you realize that the way you did something a year ago makes absolutely no sense and – there – this makes much more sense.  For now.

The next notable change/improvement actually touches on HVAC as well, so it’s a good segue.  You may recall (but probably don’t) that the automation system is occupant-aware.  When we’re home, certain things happen – like telling the thermostat to target a comfortable temperature, or telling the surviellance system not to pepper me with event notifications.  Previously, occupant detection relied on Bluetooth and its rather short range.  And while I had dreams of hacking unsightly 2.4Ghz antennas onto cheap USB Bluetooth adapters, I woke up recently and decided to use WiFi for the same purpose – which also makes sense since our phones are connected to WiFi whenever we’re home.  Well, Shelly’s Nokia wasn’t always connected, by her loaner phone (my Desire Z) is as is my Galaxy S III.  It was just a matter of course before – no changes in usage or increased battery consumption.

This has simplified matters greatly, in addition to greatly increasing the reliability of the detection code.  The method is actually straightforward – check the wireless access point’s association table to see if particular MAC addresses are connected.  C’est tout.

Also within the spherical roundness of occupant-detection (???) is the news that the system can now get updates from the alarm system.  This is very useful, as it leads to very dependable home/away information that is actually more reliable (in some cases) than the wireless detection method.  The automation system is also configured to simulate motion/audio events on all cameras if the alarm notifies it of a perimeter breach.

Now over to HVAC.

Again – more code cleaning.  I spent a little bit of time thinking I could simplify the “Smart Logic” – the stuff that determines if the system should be off or on and what mode and when to run the fan and blah blah blah – but that turned out to be more painful than just leaving it the way it was so left it I did.  However, the system now has the ability to pre-condition the house if the next program calls for it.  This is one end of a multi-month effort that involved the automated collection of efficiency information.  The system keeps track of how long it takes to heat/cool the house – and currently maintains these statistics seperately for various absolute inside temperatures as well as inside/outside temperature differences – and if the next program calls for more heating or cooling, the system will start doing just that so that we hit the desired temperature just as the next program becomes active.

Admittedly this is not a novel concept.  Some thermostats have been doing this for years.  Something they can’t do is take the efficiency data and determine when to start pre-conditioning the house once it has been determined that occupants are on the way home.  And in the name of openness – my system can’t do this either.  But presently that has more to do with niggling concerns rather than a dearth of information or ability.  Any claims to the contrary would be blasphemy – you’ve been warned.

???

Anyhoo, the reality is that the current pre-conditioning only happens once a day – and perhaps twice a day in the cooling season.  Mostly this is due do the fact that I’ve “flattened” my thermostat’s programs, so that we basically have an overnight setpoint and a not-overnight setpoint (like I talked about here).  I’ve been able to do this because:

  1. the HVAC is much more efficient now than it was before (since we’ve moved)
  2. occupant detection can lower/raise the setpoint appropriately
  3. occupant prediction can target the “home” setpoint before we get home

We tend to keep a “cool” house when we’re asleep, but it absolutely sucks to wake up in the morning to cold floors and cold everything-else-too.  Otherwise, there’s really no need to program the thermostat when the pieces are in place to make more effective decisions automatically.

So ya, that’s HVAC.  Last (and perhaps least?), Music.

Admittedly there hasn’t been much development there.  Not to say that I/we don’t use the system – in fact I used it this past Thanksgiving when we entertained family.  I just haven’t had occassion to spend oodles of time on it.  As it is now, it Just Works(tm).

What I have done, though, is to bring some HTML5 usefulness to the streaming aspect of the system.  As with video in the surviellance system, there has been a browser-embedded solution for some time to stream music via a Flash player.  Got the job done, but again – Flash’s days seem numbered and are basically done and done in the mobile world.

To that end I added HTML5 Audio, and it gets regular use when I’m at work.  Not so much in the car (also known as “not at all in the car”) but that’s because Chrome (and perhaps others) will not allow for background HTML5 audio.  If the screen turns off or the browser is pushed to the background: sayonara streaming audio.  So I still rely on a bonafied SHOUTcast client for streaming in the car, and truthfully I’d love to be able to run the browser-only solution as it requires much less in the way of security concessions.

Aaaaaaand….

….that’s it!

Me <3 Opera Mobile

So I’ve been doing some work off-and-on on a mobile version of the site I use to browse/play music on my home network. I’ve wanted a mobile-optimized version of the site for some time, and a recent development with my SHOUTcast streaming client of choice has made this project more of a necessity than a curiosity.

Critical to the operation of the site is the ability to touch-scroll various regions in the page. That, and the ability of the browser to support HTML5 Audio in the MP3 format. And so far, I’ve only found Opera Mobile to be worthy of solving the HTML5 Audio part of the equation while also remaining my mobile browser of choice.

However, I was having no luck with the touch-scrolling part of the equation. Many mobile browsers seem to have a problem handling straight-up overflow:scroll, and even the iScroll Javascript library wasn’t solving my particular flavour of problem. And what was working was working at a horrible pace.

Then I happened to notice that a manual update for Opera Mobile was sitting in my Android Market queue. Among reported changes was an update to the core (or engine) that the Android version of the browser was using. And wouldn’t you know it – upgrading to this version solved all of my touch-scroll issues, and performance is about as snappy as it is on the desktop Opera Mobile emulator.

So colour me happy. Now that the site is functional, I can work on prettying it up and adding gee-whiz features 🙂