Interesting.  Looks like a bunch of us are thinking along the same lines.

I was embarking on the same path and realized I need to have most base protocols supported before I could begin researching a new event model.  MH's low-level interfaces are closely tied to MH core.   There already is independent xPL support for X10, X10RF, UPB, and ZWAVE, so you can guess why I picked up a new Insteon PLM recently.  ;)

What code in MH would you actually want to re-use?

-J


On Sun, Mar 27, 2011 at 8:26 PM, Brian Paulsen <brian@thepaulsens.com> wrote:
Ok - did a bit more research.  AnyEvent looks like a good base for the event programming.

On Mar 27, 2011, at 8:19 PM, Brian Paulsen wrote:

> I'm inclined to go with POE for the event driven framework simply because I've heard of POE in several different contexts.
>
> I'd suggest that we start with the X10 system because that is likely what is in most people's houses.  Many of the concepts that already exist in misterhouse would likely be reused (e.g. the Light* modules), but they'd be refactored with an event-driven framework in mind.  For example, the X10 system would be listening for different types of events and then also emitting events as various lights are turned off an on.
>
> The biggest question I have is would it be more work to try to put this into the existing misterhouse framework than it would be to try to write something from scratch and then port into that.
>
> Brian
>
> On Mar 27, 2011, at 7:49 PM, Rick Naething wrote:
>
>> Brian,
>>
>> Personally I think that is a great idea! In fact, I have been working
>> on something very close to what you are talking about for the last
>> week. I have been writing classes using Moose but using Dancer rather
>> than Catalyst as a web framework. This is just because Dancer seemed
>> was lighter weight and seemed a little easier to learn.
>>
>> I also have been using AnyEvent. If you are looking at rewriting any
>> major portion of mh you should move to an event driven programming
>> framework. Maybe someone can chime in with a reason that is a bad
>> idea, but I can't think of one. I couldn't get the more well know POE
>> to do what I wanted, but AnyEvent was pretty simple. In my opinion it
>> not only is simpler, more efficient, more flexible, and more powerful
>> than the misterperl loop approach.
>>
>> I don't have it all working yet - I've only put in a couple of hours
>> and this might end up being my "one to throw away". However, I've done
>> enough to be convinced that it will work great and that for HA:
>>
>> 1. Moose is a good idea
>> 2. A web framework (Catalyst, Dancer, etc) is a good idea
>> 3. An event driven framework (AnyEvent, POE) is a must.
>>
>> I'm interested in collaborating. I also listed the devices I'm
>> interfacing below just in case anyone is interested. Otherwise, I'll
>> probably throw my stuff on the web in a couple months if I get it less
>> ugly. But either way I think you have a good idea and you should run
>> with it.
>>
>> You also might want to take a look at this. It is a Catalyst /
>> perl-xpl based home automation package that Mark Hindess just
>> released.
>>
>> https://github.com/beanz/zenah-perl/
>>
>> Rick
>>
>> - a Denon 3808ci receiver over ethernet
>> - a cm15a using the new mochad daemon (mochad also supports the cm19a
>> and full PL, RF, and RF security communication, very slick)
>> - LIRC with a Manta TR1 receiver (a Windows MCE receiver)
>> - control of the Micasaverde Vera 2 over JSON (I haven't attempted this yet)
>> - control of XBMC over JSON (also not attempted)
>>
>> On Sun, Mar 27, 2011 at 4:09 PM, Brian Paulsen <brian@thepaulsens.com> wrote:
>>> I'm looking to start playing around with Moose and Catalyst and I thought I might try with misterhouse as it has a fairly good class structure.  I'm thinking of starting with the X10 modules and then the 1-wire modules (mainly because those are the ones I'm most familiar with).  Those might benefit most from Moose.
>>>
>>> I'd then like to take some of the functions that I mostly use, such as HVAC, lights, and trigger updating, and convert those to use Catalyst.
>>>
>>> Then as a final step, I'm thinking of creating a whole new misterhouse branch.  I'd like to create something that is a lot more event driven, and maybe we could use the misterhouse code base as a start, but then use the Event modules to fire off various items.  I'd like to build this as something that is inherently multi-processed.  I.e., we'd have a central system (likely a database system) that would hold all of the events and then other systems that would act on them.  For instance, in the new system, we might have a central concept being location monitoring, which could be updated via motion sensors, lights turning on and off, TVs being turned on and off, etc...  Then the location updates would feed back into the light management system, the HVAC system, and the TV system.  If the HVAC system were to suddenly crash or get hung, that shouldn't stop the light and TV system from operating.
>>>
>>> Thoughts?
>>>
>>> Brian
>>>
>>> ------------------------------------------------------------------------------
>>> Enable your software for Intel(R) Active Management Technology to meet the
>>> growing manageability and security demands of your customers. Businesses
>>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>>> be a part of the solution? Download the Intel(R) Manageability Checker
>>> today! http://p.sf.net/sfu/intel-dev2devmar
>>> ________________________________________________________
>>> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Enable your software for Intel(R) Active Management Technology to meet the
>> growing manageability and security demands of your customers. Businesses
>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>> be a part of the solution? Download the Intel(R) Manageability Checker
>> today! http://p.sf.net/sfu/intel-dev2devmar
>> ________________________________________________________
>> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> ________________________________________________________
> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365