Quantcast

Guidance on integrating a (not so) new device type

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Guidance on integrating a (not so) new device type

Jon Whitear
Hi guys,

I’ve been thinking about refactoring the Clipsal CBus code to integrate CBus more natively in MH. The recent release of V4 seems like a good time to start working on it. I’d appreciate some guidance on how to approach this, Most of the hard work with getting CBus working has been done - I’d just like to make it more MH “native” so that I and other CBus users can inherit the benefits of (for example) the home kit work that’s going on.

At the moment, Cbus support is provided through cbus.pl, which is enabled as user code. This includes procedures to connect to CGate (the CBus controller) via a socket and list the CBus devices. That list (in XML format) is parsed to generate some code (cbus_routines.pl)) which in turn creates the MH objects and voice commands corresponding to the CBus objects.

What I’m really looking for is an overview of how MH works. I’ve been reading through the Insteon code to get an idea, and I understand that the main MH code parses the .pm files in the lib directory. So if I have a concept of a CBus “controller” and “devices” I can declare them in a .mht file and the appropriate procedures to instantiate them will be called. I’m not really clear on where I’d put the code that should run on each pass of MH to read data from CGate.

I’m a novice programmer, and don’t have much in the way of perl experience, which doesn’t help. All help will be appreciated.

Cheers,

Jon

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Guidance on integrating a (not so) new device type

Lieven Hollevoet
Administrator
Hi Jon,

Welcome!

I can point you to another example of a ‘controller’ with devices: I’ve written some code for Squeezebox devices where I have a single object that connects to the server, and where every squeezebox also has its own object. Maybe this helps you in getting a grip on how things are handled in Misterhouse.

https://github.com/hollie/misterhouse/blob/master/lib/SqueezeboxCLI.pm

To understand how to fetch data from the socket during every pass, please look at line 94. That causes MisterHouse to check for data every cycle.

To see how to contribute code, please see here:
https://github.com/hollie/misterhouse/wiki/Contributing#creating-a-pull-request-for-new-contributors

Hope this helps you further,
 Lieven.

> Op 24 feb. 2016, om 10:28 heeft Jon Whitear <[hidden email]> het volgende geschreven:
>
> Hi guys,
>
> I’ve been thinking about refactoring the Clipsal CBus code to integrate CBus more natively in MH. The recent release of V4 seems like a good time to start working on it. I’d appreciate some guidance on how to approach this, Most of the hard work with getting CBus working has been done - I’d just like to make it more MH “native” so that I and other CBus users can inherit the benefits of (for example) the home kit work that’s going on.
>
> At the moment, Cbus support is provided through cbus.pl, which is enabled as user code. This includes procedures to connect to CGate (the CBus controller) via a socket and list the CBus devices. That list (in XML format) is parsed to generate some code (cbus_routines.pl)) which in turn creates the MH objects and voice commands corresponding to the CBus objects.
>
> What I’m really looking for is an overview of how MH works. I’ve been reading through the Insteon code to get an idea, and I understand that the main MH code parses the .pm files in the lib directory. So if I have a concept of a CBus “controller” and “devices” I can declare them in a .mht file and the appropriate procedures to instantiate them will be called. I’m not really clear on where I’d put the code that should run on each pass of MH to read data from CGate.
>
> I’m a novice programmer, and don’t have much in the way of perl experience, which doesn’t help. All help will be appreciated.
>
> Cheers,
>
> Jon
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> ________________________________________________________
> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users


signature.asc (465 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Guidance on integrating a (not so) new device type

Jon Whitear
Liven,

Thanks. Your squeezebox code has been very helpful in my trip up the learning curve. I have some specific perl questions, but I’ll start a new thread for those.

Cheers,

Jon


> On 26 Feb 2016, at 7:09 AM, Lieven Hollevoet <[hidden email]> wrote:
>
> Hi Jon,
>
> Welcome!
>
> I can point you to another example of a ‘controller’ with devices: I’ve written some code for Squeezebox devices where I have a single object that connects to the server, and where every squeezebox also has its own object. Maybe this helps you in getting a grip on how things are handled in Misterhouse.
>
> https://github.com/hollie/misterhouse/blob/master/lib/SqueezeboxCLI.pm
>
> To understand how to fetch data from the socket during every pass, please look at line 94. That causes MisterHouse to check for data every cycle.
>
> To see how to contribute code, please see here:
> https://github.com/hollie/misterhouse/wiki/Contributing#creating-a-pull-request-for-new-contributors
>
> Hope this helps you further,
> Lieven.
>
>> Op 24 feb. 2016, om 10:28 heeft Jon Whitear <[hidden email]> het volgende geschreven:
>>
>> Hi guys,
>>
>> I’ve been thinking about refactoring the Clipsal CBus code to integrate CBus more natively in MH. The recent release of V4 seems like a good time to start working on it. I’d appreciate some guidance on how to approach this, Most of the hard work with getting CBus working has been done - I’d just like to make it more MH “native” so that I and other CBus users can inherit the benefits of (for example) the home kit work that’s going on.
>>
>> At the moment, Cbus support is provided through cbus.pl, which is enabled as user code. This includes procedures to connect to CGate (the CBus controller) via a socket and list the CBus devices. That list (in XML format) is parsed to generate some code (cbus_routines.pl)) which in turn creates the MH objects and voice commands corresponding to the CBus objects.
>>
>> What I’m really looking for is an overview of how MH works. I’ve been reading through the Insteon code to get an idea, and I understand that the main MH code parses the .pm files in the lib directory. So if I have a concept of a CBus “controller” and “devices” I can declare them in a .mht file and the appropriate procedures to instantiate them will be called. I’m not really clear on where I’d put the code that should run on each pass of MH to read data from CGate.
>>
>> I’m a novice programmer, and don’t have much in the way of perl experience, which doesn’t help. All help will be appreciated.
>>
>> Cheers,
>>
>> Jon
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>> ________________________________________________________
>> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>>
>



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Loading...