LinuxMCE Forums

General => Developers => Topic started by: ddamron on April 05, 2008, 07:06:31 pm

Title: GSD/Ruby Developers Conferences
Post by: ddamron on April 05, 2008, 07:06:31 pm
I'd like to host a GSD/Ruby Developer's conference.  Some topics I'd like to cover are:

1.  How Ruby is embedded
2.  The cmd object
3.  The device_ hash
4.  Sending/Receiving Commands
5.  Sending/Receiving Events
6.  Commands/Events of interest
7.  How and WHY to send a command to yourself
8.  cmd.Param_[120] Retransmit
9.  Command Types (Command/Event/etc)
10.  Command Interceptors and how to use them in Ruby
11.  Sending User Feedback
12.  Asking the User a Question

This may be a bit much, but we'll try to focus on the basics first, then move on to the more advanced items.

I'd like to do this via teleconference and webcast (so people can see how I do it)

If you are interested in this, please reply here.  If there's enough interest, I'll set a date, and we'll go with it.

All the best,

Dan Damron
Title: Re: Ruby Developers Conference
Post by: caiman on April 06, 2008, 11:36:22 am
Dan,

very interesting. Also, if there is a way to record the webcast for those who won't be able to attend, it would be marvellous.

Sam
Title: Re: Ruby Developers Conference
Post by: ddamron on April 06, 2008, 09:17:01 pm
Hi sam.

Yes, I'll try to arrange something for that.

There's a lot of ground to be covered in the above list.  I'm going to break them down into different webcasts.
My goal is to have something FUNCTIONAL by the end of each webcast.

Here's the schedule of events:

1.  GSD/Ruby 101 - Topic: Your First GSD/Ruby Device.

We will create a fully functioning GSD/Ruby Device.
No prerequisites required.

2.  DCE 101 - Topic: DCE  Commands/Events

This webcast will concentrate on the vast DCE commands and how to implement them. 
This will be a good primer for ANYONE wanting to get into development. (regardless of the language)
No prerequisites required, but GSD/Ruby 101 recommended.

3.  Ruby 101 - Topic: Ruby Tutorial

This webcast will concentrate specifically on the Ruby Programming Language, it's structure, and it's OO nature.
(You will see here why we say Ruby is leaps and bounds ahead of C++ in OO implementation)

No prerequisites required.  This tutorial will be EXTERNAL to LinuxMCE for ease of demonstration.

4.  Advanced GSD/Ruby 201 - Topic: ThreadedRuby
This webcase will concentrate on my current ThreadedRuby Project.  I will step through it's structure, it's classes, and it's methods
This code demonstrates Object Encapsulation and Polymorphism.

Prerequisites: Ruby 101, GSDRuby 101



Now, I have 2 ideas for GSD/Ruby 101.  The first is to pull weather data down from theweathernetwork.com, but displaying the data to the user is a bit tricky,
The other idea is to write a 'DCE Command Prompt', accessible via an RS232 port connected with a null modem cable to another computer.

Both are a bit complex..  The problem here is we are dealing with the outside world, and not everyone will have the same device to talk to.

If anyone has any suggestions on a simple easy project to implement GSD(tcp or serial), let me know.

Regards,

Dan Damron
Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on April 06, 2008, 10:44:31 pm
Hi,

more and more conferences - that's something really positive. But we have no convenient option/architecture to have them.

I thought what if we would use our own Asterisk servers and conference rooms ?  We already have buttons like call "LMCE user" (not sure if functional)... Also there is interesting project for web collaboration based on Asterisk - VMukti...

Regards,

Bulek....
Title: Re: GSD/Ruby Developers Conferences
Post by: 1audio on April 07, 2008, 03:09:25 am
Quote
The other idea is to write a 'DCE Command Prompt', accessible via an RS232 port connected with a null modem cable to another computer.
With a serial interface that would allow the hopelessly defensive Crestron and AMX programmers to interface to DCE they could apply their UI's and hardware to an LMCE system. Just make enough commands available that they can do a little. This is training wheels for the Luddites.
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 07, 2008, 06:55:46 am
Quote
The other idea is to write a 'DCE Command Prompt', accessible via an RS232 port connected with a null modem cable to another computer.
With a serial interface that would allow the hopelessly defensive Crestron and AMX programmers to interface to DCE they could apply their UI's and hardware to an LMCE system. Just make enough commands available that they can do a little. This is training wheels for the Luddites.

LMAO, That's great!

Heh, wouldn't that just be the selling point... Compatible with LMCE!!!

That was just an idea, if anyone has another suggestion, I'm still brainstorming for a 'project'
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 08, 2008, 05:20:58 am
Ok, I've writ the GSD/Ruby test project.  It took me all of 15 minutes this AM, but I'm sure it will take a bit longer online.

I have also sorted out the Video capturing.  TSCHAK has pointed me to the proper direction for the conference.  I'm ready to move on the first of these conferences.

GSD/Ruby 101 - Test project: Serial DCE Command Interface.


Date and time to be determined soon.
Title: Re: GSD/Ruby Developers Conferences
Post by: JimmyGosling on April 08, 2008, 07:09:35 pm
Just stating again that I am looking forward to this conference and would like to add my name to that list.
Title: Re: GSD/Ruby Developers Conferences
Post by: MarcoZan on April 08, 2008, 07:22:30 pm
Hi all
just my 0,02 ...

I think it may be useful to open a dedicated section on the wiki in which store and organize all the recorded seminar that may occur in the future or that have been already held.

I am stronlgy interested in GSD development as shortly (and hopefully) I should start writing a driver for my new house lighting system, but I'm also extremely busy with my job now and I cannot be sure that I will be attending to all planned conferences. So having a "conference library" would help me quite a lot.

And generally speaking I think that this kind of resource could dramatically speed up the learning curve for all those are wanting to jump in, willing to get their hands dirty but not really knowing from where to start.

Any thoughts?

Regards
MarcoZan
 
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on April 08, 2008, 07:38:33 pm
I am interested in coding a device which sits and looks for motion in rooms, then turns lights on and off according to day/night, house status, media playing status, user in room, whether it is already on, etc. While this is almost possible using an advanced respond to events command it is not possible to reset timers so the light will go on and off periodically when the room is occupied for more than the switch-off delay period.
Title: Re: GSD/Ruby Developers Conferences
Post by: JimmyGosling on April 08, 2008, 07:47:23 pm
MarcoZan,  for the recordings that are being made/have been made I agree that this is a good idea.  I know that we've posted meeting minutes before, but I have not seen any posted recordings yet.
Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on April 08, 2008, 09:26:50 pm
Hi,

thanks guys for great help for all others....

If I may add an idea, on few places on Wiki there is possibility of making more complex event handlers in Ruby possible.

I'd kindly ask if anyone knows more about this - if it is usable right now - if yes, than it would be great to teach people how to make those event handlers... If not possible, then it would be great to make skeleton for external Ruby application that would connect to DCERouter and receive/respond to various commands/events/data...

Regards,

Bulek.
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on April 08, 2008, 10:39:51 pm
If I may add an idea, on few places on Wiki there is possibility of making more complex event handlers in Ruby possible.

This fits in nicely with what I'm after!
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 09, 2008, 09:47:05 pm
Hi,

thanks guys for great help for all others....

If I may add an idea, on few places on Wiki there is possibility of making more complex event handlers in Ruby possible.

I'd kindly ask if anyone knows more about this - if it is usable right now - if yes, than it would be great to teach people how to make those event handlers... If not possible, then it would be great to make skeleton for external Ruby application that would connect to DCERouter and receive/respond to various commands/events/data...

Regards,

Bulek.


Bulek, I'll add that to the DCE 101 Outline.  It's possible right now, (from a round about way)

in a nutshell, you need to register a message interceptor. (there's a good wiki on that)
Now, to do it in Ruby, you can't actually use the cmd object... so what you need to do is:

system("/usr/pluto/bin/SendMessage .....")

to register the interceptor, then the messages will be sent accordingly.

HTH,

Dan
Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on April 09, 2008, 11:41:23 pm
Hi,

thanks guys for great help for all others....

If I may add an idea, on few places on Wiki there is possibility of making more complex event handlers in Ruby possible.

I'd kindly ask if anyone knows more about this - if it is usable right now - if yes, than it would be great to teach people how to make those event handlers... If not possible, then it would be great to make skeleton for external Ruby application that would connect to DCERouter and receive/respond to various commands/events/data...

Regards,

Bulek.


Bulek, I'll add that to the DCE 101 Outline.  It's possible right now, (from a round about way)

in a nutshell, you need to register a message interceptor. (there's a good wiki on that)
Now, to do it in Ruby, you can't actually use the cmd object... so what you need to do is:

system("/usr/pluto/bin/SendMessage .....")

to register the interceptor, then the messages will be sent accordingly.

HTH,

Dan

Hi,

thanks for info.. I thought that maybe this is more closely integrated - like GSD is, so one can have few predefined things to work with....

Regards,

Bulek.

Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 10, 2008, 01:59:11 am
well, it is, but you still need to tell DCE that you want to be a sink for those events.. (not just your own)
Once you've registered the interceptor, dealing with those events is trivial.

I'll touch base on this in DCE 101. (and maybe possibly some examples)

Regards,

Dan
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 12, 2008, 10:20:18 pm
Bulek,

well, we're getting closer to that as we speak.  I'm sure we can add another wrapper to implement those functions into Ruby.  I've looked at the code, it's in generic_Serial_Device, and the wrappers look straight forward.

HTH,

Dan
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 13, 2008, 05:06:01 am
Ok, We're ready to do this.

Date: Saturday, April 19, 2008
Time: 12:00 PM MDT (GMT -7)
Webconference: GSD/Ruby 101

We've found a serious bug in the Flash plugin for linux, the sample rate gets screwed up, so we can't use ANYTHING flash for audio.

For audio, you need to install Skype.  (has very good linux and windows support.  This is not negotiable.)

To be invited to the conference, add me as a contact in Skype.  My email is dan.damron@techengine.ca

For Desktop/Presentation, we will be using dimdim. (www.dimdim.com)

DimDim is a browser based webconferencing system which allows (currently windows only) full desktop sharing, along with powerpoint presentations.

Now, I will be hosting the conference in a virtual box, and I've tested this combination successfully.

Thom Cherryhomes (TSCHAK) is going to record the webconference, both audio and video. 

See you all Next Saturday!

Regards,

Dan Damron
Title: Re: GSD/Ruby Developers Conferences
Post by: MarcoZan on April 13, 2008, 03:21:53 pm
Hi Dan

just a question: can you already estimate how long will last the webconference?

This is just to properly arrange things .... 12.00 PM in Calgary will be 08:00 PM here where I live, and I have to start early to convince my wife not to make special plans for saturday night ...

Thanks and regards
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 14, 2008, 05:07:40 am
I'm blocking 2 hours, but 1/2 of that is Q&A.
so, the demo will be about 1 hour, once everything is said and done.

HTH,

Dan
Title: Re: GSD/Ruby Developers Conferences
Post by: MarcoZan on April 14, 2008, 11:42:58 am
Hi Dan and thanks for your reply

I just happened to read the official announcement of the webconference here -> http://www.linuxmce.org/news.php?id=23#comments

It is stated that webconference will start at 2.00 PM, while in the forum you said it will be at 12.00 PM.

Can you confirm which is the correct one?

TIA and regards

Marco
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 15, 2008, 01:04:59 am
The conference will start at 12:00PM MDT, or 2:00 PM EDT (Same time, different zone)

Also:  for everyone:  I will need your email addresses to add you to the dimdim webconference!

Sorry about that, I forgot to mention that.

If you have already added me via skype, I have accepted your responses (5 so far), just make your email address visible via skype.

I believe Skype also has a 10 or 25 user limit on conference calls, I'll dig into that further.

All the best,

Dan Damron
Title: Re: GSD/Ruby Developers Conferences
Post by: MarcoZan on April 15, 2008, 08:03:16 am
Didn't notice the different time zone ...  :-[

Sorry
Title: Re: GSD/Ruby Developers Conferences
Post by: agentc0re on April 20, 2008, 01:32:47 am
I'm sorry i couldn't make the first one.  I had some family stuff pop up right after i had spoke with you in IRC Dan.  Hopefully Thoms recording software didn't blowup this time cuz i'd really like to see what ruby has to offer.  Sounds pretty cool.
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 20, 2008, 05:17:32 am
Well, the Webcast was a success,

I had set another machine up to record here.  However, we DID have a software crash (webconferencing software DimDIm) and I didn't get a chance to reconnect the recording PC.
This is almost a 2 person job, 1 to record, and 1 to host.

Title: Re: GSD/Ruby Developers Conferences
Post by: MarcoZan on April 21, 2008, 03:03:12 pm
Sorry if I do it only now, but I would like to say a big "Thank You guys" to Dan and Thom for last saturday webconference.

From my point of view it was really a success, and even if we had a minor problem with desktop sharing sw I think that this is the proper approach this matter.

Looking forward to partecipate to next GSD webconferences

Thanks again
Marco







Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 21, 2008, 08:09:33 pm
MarcoZan,

I'm glad you found it helpful!  Thom really stepped up to the plate with his help in the webconference.  Coding is hard enough to do without commenting on what your coding.
With Thom's help, this allowed me to concentrate on the actual code, and not worry about explaining it, as I knew Thom would do that for me.

It's too bad we couldn't get the recording working..  I'll try to put together a recording locally here and put it up.

I'd like to put it to you guys on what the next conference should be:

DCE 101 - A Closer look at Data, Commands, and Events
Ruby 101 - A Closer look at Ruby (structures, classes, methods)

Both of these have REALLY good info, and lots of hint's and hidden gotcha's.


Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on April 21, 2008, 09:40:46 pm
Hi,

I'dl also like to thank for conference... It seems that you two are great combo for such events... It goes much faster and efficient...

I'd be happy to attend further conferences...

Regards,

Bulek.
Title: Re: GSD/Ruby Developers Conferences
Post by: teedge77 on April 21, 2008, 09:48:46 pm
maybe someone could make a youtube channel for linuxmce? then save conferences and instructional videos/demonstrations, like thom has done, to that channel. then it could all be in once place for people to look through. if not youtube maybe another video blog kinda place?
Title: Re: GSD/Ruby Developers Conferences
Post by: sp00nhead on April 21, 2008, 11:46:12 pm
Just to say, thanks to watching this i was able to get my Rako kit working :) At the moment its really basic code to "just get it to work" but will be going back over it to add checking and anything else i can think of (the blasted off commands issue for one  >:( )

I'll pop a wiki page up sometime this week with my code.

Looking forward to the next conference, i'll try and add something to it this time (got a list of why dont this works :) )

Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 22, 2008, 03:32:11 am
Just to say, thanks to watching this i was able to get my Rako kit working :) At the moment its really basic code to "just get it to work" but will be going back over it to add checking and anything else i can think of (the blasted off commands issue for one  >:( )

I'll pop a wiki page up sometime this week with my code.

Looking forward to the next conference, i'll try and add something to it this time (got a list of why dont this works :) )



Sp00nhead,

That's GrEaT!  I wanted that first webcast to be a primer, or a basic how-to...  I'm glad it's helped!

Viewing the log is probably the most effective debugging resource, if I didn't mention it in the conference...
just make sure you output to it. :)

and... just do you don't reinvent the wheel, here's a quicky.  Put this in your Private Method Listing:

def log(line)
  $log = File.open("/var/log/pluto/" + device_.devid_.to_s + "_Generic_Serial_Device.log", "a")
  $log.puts "(***):" + line.to_s
  $log.close
end

Now, at any time you have something to log, do this:
log("this will be logged")

Done!

Regards,

Dan
Title: Re: GSD/Ruby Developers Conferences
Post by: darrenmason on April 22, 2008, 05:43:19 am
Dan - since you brought it up....

In the PLC-BUS code you have your logging code outputting its prefix a character at a time. Was there a reason/need for this? Just curious.........
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on April 22, 2008, 06:40:42 am
Darren,

Yes, and No.

heh, I had troubles logging object inspections.. the output never made it to the log because it thought it was xml or other tags...
That was also dealing with a specific bug in the code... I have since fixed that bug, but haven't changed the logging routines back...
Either way, they still work, the code above is more efficient, but in no way will it affect the PLCBUS stuff.

BTW, Good eye!
Now let's see if you can find some of the other hiccups!

My 4th webconference will explain the ThreadedRuby Object model I have created.  PLCBUS is based on that model.

Title: Re: GSD/Ruby Developers Conferences
Post by: lightshow on April 28, 2008, 10:23:18 pm
Did you happen to record your Webcast? 

I'd like to watch what happened since I was unable to attend.
Title: Re: GSD/Ruby Developers Conferences
Post by: brsisr on May 02, 2008, 10:37:43 pm
Well, the Webcast was a success,

I had set another machine up to record here.  However, we DID have a software crash (webconferencing software DimDIm) and I didn't get a chance to reconnect the recording PC.
This is almost a 2 person job, 1 to record, and 1 to host.


Hi Dan!
where could I find the record of thsi video converence,
thanks in advance
Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on May 03, 2008, 09:29:12 pm
as I previously mentioned, the webcast did *NOT* record.
Title: Re: GSD/Ruby Developers Conferences
Post by: domotiqa.com on August 06, 2008, 09:22:32 pm
so sad
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on August 10, 2008, 03:31:26 pm
on the next webcast you wanna play with a vista-15p alarm panel to demo adding support for a device like it :)  Haha, I've been trying to get this panel working/supported for a while now, grasping at hope someone will pick it up
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on August 10, 2008, 06:10:11 pm
what is your exact problem with the panel?

best regards,
Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on August 10, 2008, 06:58:32 pm
The panel does not directly have an ethernet or serial connection, I used a VistaICM to give the panel an ethernet connection and get it on my network.  The problem now is I don't know Ruby at all and have no idea where to start writing a GSD for this panel.  The VistaICM I am using provides a web interface that emulates and is connected to the panel as a keypad.  When you click a number on the keypad it hits a URL that I'm assuming communicates with the panel as if you had just pressed the button on a keypad.  The url's as copied from the VistaICM's web interface use the following formatting

http://192.168.80.113/pda?cmd=7&tick=2139572809&node=1&ctrl=1
http://192.168.80.113/pda?cmd=2&tick=2139572809&node=1&ctrl=1
http://192.168.80.113/pda?cmd=3&tick=2139572809&node=1&ctrl=1
http://192.168.80.113/pda?cmd=Pound&tick=1348042547&node=1&ctrl=1

There are logs on the VistaICM as well and the web interface shows in real time the status of the panel so it should be possible to communicate with sensors hooked to the panel as well somehow, but I have no idea where to even start with being able to arm/disarm the panel...
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on August 10, 2008, 07:15:11 pm
I just confirmed that hitting the links in the proper order for my disarm code will disarm the panel so I'm assuming that means the complexity of the panels protocol is now taken out of the equation since the VistaICM apparently has that logic built in, can you confirm if this is correct?
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on August 10, 2008, 07:38:33 pm
The panel does not directly have an ethernet or serial connection, I used a VistaICM to give the panel an ethernet connection and get it on my network. 

hu? the ICM does not use a serial connection to the panel?
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on August 10, 2008, 08:00:17 pm
It is wired to the panel as a keypad and must be configured with a keypad address so it is emulating a keypad through a web interface.  There is a spec. document on this device located here: http://www.in2networks.com/PDFs/VistaICMSpecSheet.pdf

The document calls the connection to the panel an "addressable ECP port".  It is a 4 wire connection, one wire for power, one for ground, one for tx, and one for rx.
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on August 11, 2008, 12:43:46 pm
1.) Look at templates using HTTP like the Panasonic or the D-Link webcam. That will give you information how to do http requests

2.) Look at the Apex panel ruby code to see which commands/events are relevant for an alarm panel

3.) Create a new device template and copy and paste the ruby snippets you need

4.) ?

5.) Profit

when you get stuck, drop a line. Ruby is not all that hard in LinuxMCE. If you know any script language you should get the pieces together. If you don't, this is the time to improve :-) Start with little shell scripts.

The setup you use is not available in Germany (afaik), so I won't invest time in this. After I've finished Z-Wave I'll look into alarm panels, but I want direct serial control, reports for every zone and an intelligent (tamper resistant) alarm bus and a EU reseller.

br, Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: posde on August 18, 2008, 11:44:02 am
hari,

what is the reason to have a dedicated alarm setup in parallel to LinuxMCE?

rgds
Oliver
Title: Re: GSD/Ruby Developers Conferences
Post by: nite_man on August 18, 2008, 01:41:41 pm
what is the reason to have a dedicated alarm setup in parallel to LinuxMCE?

It's reasonable. Because it can work (in worst case) without LinxuMCE. It's good to have just integration between two systems. We have one installation with dedicated lighting/security system. It works as a stand-alone system when LinuxMCE is down. Also, there are some devices such gate drive which should have possibility to stop immediately them if somebody is near them.
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on August 18, 2008, 06:44:03 pm
hari,

what is the reason to have a dedicated alarm setup in parallel to LinuxMCE?

rgds
Oliver

insurance and a nice temper resistant alarm bus interface for newer systems..

best regards,
Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: posde on August 20, 2008, 09:19:14 pm
To summarize your thoughts:

LinuxMCE is not stable and secure enough to be trusted as the only security system?!

Or did I misinterpret your statements?

rgds
Oliver

Title: Re: GSD/Ruby Developers Conferences
Post by: nite_man on August 21, 2008, 08:13:45 am
To summarize your thoughts:

LinuxMCE is not stable and secure enough to be trusted as the only security system?!

Or did I misinterpret your statements?

As I see you can trust to controller with real time OS inside and minimum applications only. LinuxMCE is good but it's run on PC which can crash by some reason. So, that's why IMHO it'd better to use separate trusted system at least  for security and just integrate it with LMCE using GSD, for example.
Title: Re: GSD/Ruby Developers Conferences
Post by: tschak909 on August 24, 2008, 07:34:07 am
you guys have never disassembled the firmware to a security panel, have you?

;)

-Thom
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on August 24, 2008, 08:58:06 am
To summarize your thoughts:

LinuxMCE is not stable and secure enough to be trusted as the only security system?!

Or did I misinterpret your statements?

yes :-) Some insurances request special certifications. We don't have them. And imagine you wan't to hook up 50-70 sensors to your house. A panel is a nice interface for that. You can daisy chain them on the alarm bus. They can draw power, have intelligence and constantly talk with the panel to prevent tampering.

I for my part don't use a panel. I use a Z-Wave PIR for the security system. Not the highest level of security. But hey, I don't have a Picasso in my bedroom. But isn't it nice to have choice?

best regards,
Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: totallymaxed on August 24, 2008, 11:32:24 am
To summarize your thoughts:

LinuxMCE is not stable and secure enough to be trusted as the only security system?!

Or did I misinterpret your statements?

yes :-) Some insurances request special certifications. We don't have them. And imagine you wan't to hook up 50-70 sensors to your house. A panel is a nice interface for that. You can daisy chain them on the alarm bus. They can draw power, have intelligence and constantly talk with the panel to prevent tampering.

I for my part don't use a panel. I use a Z-Wave PIR for the security system. Not the highest level of security. But hey, I don't have a Picasso in my bedroom. But isn't it nice to have choice?

best regards,
Hari

I agree... it depends on your needs and as Hari says your Insurers! Sometimes you need an approved alarm panel to meet insurance requirements. But that panel can still interface to LinuxMCE. In other circumstances where the the security side of LinuxMCE is not central to why the system is of interest to you adding some security capability via Z-wave is just a nice ancillary benefit.

Andrew
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on December 17, 2008, 03:03:53 pm
Hey guys, I've been attempting to create a device template for my Honeywell Vista-15P alarm panel for some time now and have obtained the source code from a guy who got it working with Homeseer using the same VistaICM module that I am.  Would anyone be willing to take a look over this for me and help me get this going...I've been struggling for upwards of 6 months and I just can't get my head around it.  I'm afraid I'm going to need spoonfed on this one.
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on December 17, 2008, 06:15:59 pm
Please...I hate to keep bringing this up...I just need to see it setup on something I actually have so I can understand it.  Surely someone has time to assist
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on December 17, 2008, 07:07:58 pm
no, sorry, it is really a shame that I've not fixed that yet. I'll try to find some time this night.

br, Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on December 17, 2008, 08:30:03 pm
fixed. Tested by tkmedia.

br, Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on December 17, 2008, 08:31:36 pm
oh, i completely mixed threads :-)
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on December 19, 2008, 03:41:02 pm
Is there anyone who can help me get my alarm panel working please?
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on December 19, 2008, 04:31:30 pm
can you show what you have for now?

br
Title: Re: GSD/Ruby Developers Conferences
Post by: los93sol on December 19, 2008, 06:02:04 pm
Hari
The steps I've taken are below...

Log into Web Admin>Devices Interfaces>Add Device>
I added the manufacturer "Honeywell" and selected it
Device Category "Interfaces"
Add device template
I then chose "It's a simple, generic serial device controlled by RS232, Ethernet or USB, which you'll control with Pluto's GSD and embedded Ruby snippets (very easy). Examples: Lighting control, alarm panels, surveillance cameras, thermostats, weather stations, a/v equipment with RS232 ports, etc." and listed the model number as "Vista-15P" and clicked Add.
I did not choose a room for the device and chose "CORE" from the controlled by dropdown.
Now I click on Advanced and input the IP Address of my device "192.168.80.114" under device info
My next step was to click View in the Device template field
I added the Controlled Via Device as "Computers" like the apex template
Now I check the Is IP Based box and select Ethernet as my Comm Method
Under Device data I added "TCP Port" added that comment "Port to connect to" set a default value of 80 and check both Required and Allowed to Modify.  I also added "TCP Address", set the comment "IP Address" left the default value blank and check both Required and Allowed to Modify.
Then under Commands I added "Security Panel" and "Ruby Internal Commands"
Under Events I added "Reporting Child Devices" and "Sensor Tripped"

This is as far as I've gotten and I have no idea what to do next.  I obtained the source code for a Homeseer plugin that was written to interface with this device if that helps, however I was unable to really understand what it's doing.  That source code is attached.  :)
Title: Re: GSD/Ruby Developers Conferences
Post by: hari on December 20, 2008, 01:48:12 am
The steps I've taken are below...
this is not much :-p

i was refering to ruby code..

look at the attachment. I'm way no ruby expert and it is not complete but works for me with another panel. I did not yet implement arming and house modes.

br, Hari
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on December 24, 2008, 12:53:30 am
I'm trying to write a ruby GSD template which you can use to monitor a motion sensor and control a light. It will be more advanced than the respond to events, as a resettable timer will be setup and things like overriding whether it's day or night automatically by detecting someone using the light switch to manually switch the light on, and disabling motion detected in rooms with media playing etc will be supported.

If I want to create a GSD which runs a bit of code when a sensor is tripped or light switched off, or MD starts playing media etc, then how is this achieved? The devices in question would not be children of the GSD so I'm not sure how to get it to look out for these triggers and respond by running ruby code.

Also, how can I add custom attributes to the configuration of my device and then reference these in the ruby code?

Thanks,

Chris
Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on December 24, 2008, 01:02:00 pm
I'm trying to write a ruby GSD template which you can use to monitor a motion sensor and control a light. It will be more advanced than the respond to events, as a resettable timer will be setup and things like overriding whether it's day or night automatically by detecting someone using the light switch to manually switch the light on, and disabling motion detected in rooms with media playing etc will be supported.

If I want to create a GSD which runs a bit of code when a sensor is tripped or light switched off, or MD starts playing media etc, then how is this achieved? The devices in question would not be children of the GSD so I'm not sure how to get it to look out for these triggers and respond by running ruby code.

Also, how can I add custom attributes to the configuration of my device and then reference these in the ruby code?

Thanks,

Chris
Hi,

I'm also interested in your work. I probably won't be much of help, since I do most of my work in Perl, but will try to help as much as I can. What I'd think of this is to maybe start with a skeleton to more generic event/action parser and action triggering code in Ruby.

Well the basic start would be (as far as I remember reading posts from other Ruby developers - BTW DDamron used to be GSD Guru for us, but he's not present lately)...:
- basically you would have to start a new thread that would continuously run (if you use Idle function in GSD device it's only callled every few seconds; I guess unusable for what we need) - I remember that Ddamron used this (perhaps we can find clue in GSD code he wrote - I think he has written multithreaded device driver in GSD and Ruby)
- this thread should register with DCE router mainly as DCE message interceptor (there you can define which messages you will receive).
- then I guess we would need some text formal form (maybe xml) to describe desired criterias and actions and then parse it and evaluate...
  something similar like knxweb and linknx are doing : rules written in xml gets displayed in this manner :

http://ouaye.net/linknx/knxwebsim-0.4/rules.html (http://ouaye.net/linknx/knxwebsim-0.4/rules.html)

What I would personally like to do is some generic engine in Ruby, where I could easily access devices, device data, messages, events, database, timers and then ability to write simple if-then-else action code that will be executed... Something more flexible than web-admin events handler interface...

HTH,

regards,

Bulek.
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on December 24, 2008, 02:03:51 pm
So you would prefer something which is external and registers with the core via two sockets for a list of devices we are interested in. Then we have a ruby MVC app which allows you to link triggers to reponses. This app should also be able to get information like names of devices from the database to make creating these things easy and offer some helpers to easily create rules.

Can anyone else comment on whether this seems like the correct approach?

It seems that the GSD should actually run the commands and the MVC web GUI should allow the user to define them. Or should the code which runs the commands be external and link to the core via sockets? I am now getting a bit confused as to what the best architecture would be...

Chris
Title: Re: GSD/Ruby Developers Conferences
Post by: caiman on December 24, 2008, 02:20:34 pm
While I for sure cannot tell you which architecture is "right", I am currently _trying_ to implement something similar using an external process, connecting to DCE router with two connections.

The main reason is that I find it easier to manage code in an external file, specially with vi over an SSH connection or running the device on a separate machine. It could also make multi-threading easier (though as Bulek said above, there have been examples of multi-threaded code in GSD).

What I am lacking at the moment is a clear view on how to access device data via the DCE. I have set it up so far via SQL queries, which is breaking away from the client/server model.

In another thread http://forum.linuxmce.org/index.php?topic=6899.msg42888#msg42888 (http://forum.linuxmce.org/index.php?topic=6899.msg42888#msg42888), Hari suggested to have a look at the general plugin, which I didn't have time to do yet.

My goal is remote control of lmce via IM btw.
Title: Re: GSD/Ruby Developers Conferences
Post by: tschak909 on December 24, 2008, 04:58:37 pm
The last goal can easily be implemented, without needing to do a full device.

Take a serious look at src/MessageSend

It uses the DCE libraries, but is not a full device.

-Thom
Title: Re: GSD/Ruby Developers Conferences
Post by: caiman on December 24, 2008, 05:05:21 pm
Hi Tschak,

I have (had) that already working, using SQL queries to get the info, MessageSend to send the commands, and a ready-made library for jabber connectivity (well, that is until I made a stupid "rm" command on it recently and of course, no backup :(

Yet it was nice to switch lights on/off and query status from a mobile IM client on my phone :)

But I wanted to make it "nicer and cleaner" and re-implement fully using DCE. Maybe it's not worth the effort per se, but it's mostly for learning.
Title: Re: GSD/Ruby Developers Conferences
Post by: tschak909 on December 24, 2008, 05:06:47 pm
gotcha.

-Thom
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on December 24, 2008, 06:23:46 pm
Well, the idea is that this would replace Misterhouse in my system, which currently connects via two socket connections. This setup has been heavily criticised in these forums so I am looking for guidance to replace with something people are more happy with and others may find useful. External code making 2 socket connections is therefore not the way to go it seems. What I need is someone with experience of Linux MCE to dictate the basic architecture to me so I can then get on and build the blocks needed to fit it all together.

Regards,

Chris
Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on December 24, 2008, 11:30:44 pm
Well, the idea is that this would replace Misterhouse in my system, which currently connects via two socket connections. This setup has been heavily criticised in these forums so I am looking for guidance to replace with something people are more happy with and others may find useful. External code making 2 socket connections is therefore not the way to go it seems. What I need is someone with experience of Linux MCE to dictate the basic architecture to me so I can then get on and build the blocks needed to fit it all together.

Regards,

Chris

Hi,

funny thing is we're going in opposite directions... You're replacing MH, I plan to go back and use it with LMCE. I just somehow cannot live without it... :-) .... Anyway I'm interested in your work on LMCE side, but also what you did on MH side... I think that MH is great test&run platform for trying new ideas and rapid prototyping things around smart home...

Psst, don't talk about MH too much, Tschak is around ;-)....

Regards,

Bulek.
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on December 25, 2008, 02:04:57 am
I see Thom's point. We have this Ruby framework and defined classes which expose DCE to the ruby code in a fairly simple way, so it seems silly to have an external Perl app which connects over TCP/IP to do messaging logic. But I really want to know what the best alternative is, as I think that having an external Ruby app connecting over TCP/IP is just the same!

Regards,

Chris
Title: Re: GSD/Ruby Developers Conferences
Post by: bulek on December 25, 2008, 09:48:43 am
I see Thom's point. We have this Ruby framework and defined classes which expose DCE to the ruby code in a fairly simple way, so it seems silly to have an external Perl app which connects over TCP/IP to do messaging logic. But I really want to know what the best alternative is, as I think that having an external Ruby app connecting over TCP/IP is just the same!

Regards,

Chris
Hi,

I'm not an Ruby and GSD expert, but don't understand, why you make such hard distinction between external and "internal" Ruby application. If you want to write event handler, you will AFAIK have to register message interceptor with DCERouter anyway (also all plugins function in this way) - but under your criteria this makes your application external... But it still is GSD and Ruby code.... Another story is how easy you can access device data, events and other needed DCE stuff. I currently don't know much about this matter and I'm curious if all this already exists and we need only some additional docs, or not...

What I really would like to know is whether GSD currently offer more that we know from docs or are there many things to add in code or documentation....

We should get to the point where  all needed data, devices, events etc... will be easily accessed and handled within Ruby framework.

Regards,

Bulek.
Title: Re: GSD/Ruby Developers Conferences
Post by: chrisbirkinshaw on December 26, 2008, 12:03:36 am
I think it can be figured out. It all basically runs on messages, and the message types are all documented.

The problem for me is deciding what architecture I should use. I think that right now Thom is the best person to guide us here. Hopefully he will be able to help us out after the festivities!

Happy Christmas!

Chris
Title: Re: GSD/Ruby Developers Conferences
Post by: tschak909 on December 26, 2008, 02:10:43 am
I will try to help as much as I can. I need to spend some serious time looking at the code in src/Generic_Serial_Device.

-Thom

I think it can be figured out. It all basically runs on messages, and the message types are all documented.

The problem for me is deciding what architecture I should use. I think that right now Thom is the best person to guide us here. Hopefully he will be able to help us out after the festivities!

Happy Christmas!

Chris

Title: Re: GSD/Ruby Developers Conferences
Post by: ddamron on January 01, 2009, 11:13:40 pm
Hi guys.

Quick note:  look up the PLCBUS code in the wiki:
That code has all my ThreadedRuby (I didn't find out until AFTER I coded it that PLCBUS can't handle threaded messages :/)
I did comment the code, and it's a bit alpha-ish, but that might help.

Bulek, a note for your if-then-else,
the threadedruby code is designed so you can put all your protocol dependant code in a seperate object.  because of this, there are certain parts you need to implement:
eg: sending a command to insteon, here's the steps:
First, each command is an object consisting of a complete structure of data, and flags.

threadedruby intercepts the message from DCE
checks to see if its a response the other way around (eg: a command originating from GSD)
when it does this, it passes the message to the device's object (to determine if it's a proper response)
if not, it moves on to the next command object, etc, etc.
if all that failes, (eg: it's not a proper response to any existing messages) then it creates a new command object, sets the direction, etc, and queues the command for transmission.

The nice thing about threadedruby is that the code for processing data is the same in both directions, ie DCE->GSD, and GSD->DCE.
Both GSD and DCE have data to return to each other, and may not be particularly sync'ed up.

The goal of threadedruby was to allow multiple commands/responses to and from GSD/DCE.
ThreadedRuby tracks all messages for you.


http://wiki.linuxmce.org/index.php/PLCBUScmd373 (this has all the details)
http://wiki.linuxmce.org/index.php/PLCBUS (this has all the rest)


Best holiday wishes to all!

Dan

PS,
Sorry I haven't been around much lately, I've got other issues to deal with atm.

Title: Re: GSD/Ruby Developers Conferences
Post by: alx9r on April 11, 2009, 06:08:04 pm
Is there any chance there will be another GSD/Ruby Developers Conference?  Sadly the first one wasn't recorded. 

I think I would benefit from the wisdom disseminated in Ruby 101 as there are a couple device templates that I would like to fix (The Marantz SR series and the Denon AVR series).  I suspect that there are other people who would benefit from this and other templates that need improvement. 

Just a video of the originial runthrough would be awesome.  It doesn't have to be a live webcast.

Regards,
Alex
Title: Re: GSD/Ruby Developers Conferences
Post by: Kooma on December 24, 2009, 10:54:58 pm
Yep, wish there was another GSD 101 conference and video.

Been spending most of the Christmas now reading GSD related topics and wiki. Still quite lost, missing a simple step-by-step instructions, but I guess there are many things to consider making it more difficult to create a simple tutorial for it.

What might be the simplest GSD implemeted, I would like to take a look at that and try to understand it??

Thanks.