Thursday, May 29, 2014

(#3) Shout It, Shout It, Shout It Out Loud
By far and away, the fondest memories of my career, so far, are all rooted in the people I've met. I've had the opportunity to get to know some of the smartest, most thoughtful engineers on our planet.

For this post, one person, in particular, comes to mind.  In the mid 1990s, I was contracting at a large Telecommunication company headquartered in New Jersey.  One of their incumbent chief architects and I were butting heads over an inter-application protocol. I was advocating CORBA and he wasn't.

The circumstances aren't important.  What is important is, this person was right. And I was wrong. Gary Zidd, if you're reading this, please recall I bet you a nice dinner that CORBA would rule the world.  Pick the restaurant, order a nice dinner for you and the wife, and send me the bill.


What Gary was advocating was -- messaging. 
And he was so very, very, very right!


Are you Listening?
Mr. McGuire: I want to say one word to you. Just one word.
Benjamin: Yes, sir.
Mr. McGuire: Are you listening?
Benjamin: Yes, I am.


I'll save the Soapbox-ing for another post, but, dear reader - the future is in asynchronous messaging. The only path forward for us, mired in this muck we've created is asynchronous messaging.

In a half-hearted attempt to stay on the Home Automation topic, let's continue the discussion on a subclass of those asynchronous messages: events.


Academics To The Obfuscation
Leave it to the Ph.D.'s to take something as well-understood and intuitive as an "event" and complicate it.  Suffice to say, there's some interesting (yawn!) discourse on what constitutes an event.

For this post, please accept the following:

  • an event is something that will happen, is happening or has happened
  • and an event is also the message that captures such


For Example
Opening a door is an event. 

 And so is the message "The door has been opened!".   Ignore tense, ignore grammar. Note the academicians seem to prefer the past tense: an event is something that has happened.  But, pragmatically, it makes little difference.



Here's another example of an event: "The Inside humidity has exceeded 65%".  


And some more event examples:
"Someone just called from 303-555-1212"
"The motion sensor has gone quiet - nothing is moving"
"The water-leak sensor by the water heater is now reporting it's wet!"

Some non-Home Automation event examples:
"The 30 day moving average price for NetFlix stock has passed $400"
"The odometer on you car has crossed the next service interval threshold"
"The sun just set"
"The JVM heap space is 95% exhausted"


It's Just Thousand Island Dressing!
One of the ingredients in our Home Automation Secret Sauce is - an event.  Well, events, plural actually.  I'll share part of the Home Automation Secret Sauce Special Recipe with you:

Successful Home Automation Software:
  • Is event based, is event driven
  • Broadcasts, shares, these events with every other device on the network


Apple - are you listening?  I know you'll do the first and not do the second.  You'll create and consume events from your Home Automation ecosystem. But you won't share them.  You won't make them available to the rest of the world.

No.
They'll be locked up and sequestered inside your hub, your box, your controller.

That's myopic, at best.  Stupid, at worst.

Spray and Pray
My hacked-up cobbled together Home Automation fills my network with events. After watching it run for about a year, I think this is the path forward.

Sniff my network for these event messages (MQTT packets) and this is what you'll see:



It's unreadable, in this post, for a reason.

We'll cover off the event content later.

The point is - those events are being shared.
Those events are broadcasted.
Those events are visible to any other device, or application, on my network.


They're available to be consumed, interpreted, acted-upon.
In ways I haven't thought of yet.


The Answer to "Why Can't I..."
In an earlier blog post, I rhetorically asked "Why can't I turn the thermostat down when I know someone has left the house?"

The hard part becomes knowing when some has left, when someone isn't home.

I stumbled across something interesting the other day - an odd way to tell when someone is home.



No comments :

Post a Comment