Author Topic: Automatically creating devices in plug'n'play manner  (Read 23791 times)

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Automatically creating devices in plug'n'play manner
« on: December 13, 2005, 05:35:54 pm »
Hi,

I'm trying to implement plug'n'play feature for my home automation system under Pluto.

I get list of home automation devices in Perl script - now I'd like to add them to Pluto system (I guess I can use generate device utility, but have few questions):
- how to generate devices as child devices of certain device from command line utility ?
- how to check if device already exists in database (comparison of certain parameter & device id to see that ) - plug'n'play connection can check devices, so it would reenter devices each time, if this check is not taking place...

I could use help of some already made similar scripts (preferable in Perl)....

Thanks in advance,

regards,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Automatically creating devices in plug'n'play manner
« Reply #1 on: January 06, 2006, 03:40:53 pm »
Hi,

I had conversation with Radu on that matter and I copy'paste of conversation follows if of any help to anyone :

Code: [Select]


radu_c_public: hi
Rob: hi...
radu_c_public: I have a forum message that you posted here: http://plutohome.com/support/phpbb2/viewtopic.php?t=525 and I seem to be the one to answer it
radu_c_public: what exactly do you want to do?
Rob: well in the mean time I did it in someway with pluto command utility and Perl scripts... will post answer to myself....
Rob: I have upgraded my core to mobile pentium processor (CT479 asus adapter), but now I see that cpufrequency scaling feature is not enabled in kernel - could you consider this in future ?
radu_c_public: the answer I would have given at the time of the post would have been radically different from what I'd give you now
radu_c_public: I sent the request to the guy that builds the kernel (there will be a new kernel soon)
Rob: well you can give the answer - it won't harm. All I did was to check manually in database if such device exists prior calling command line utility that generates devices....
Rob: the possible problem is that when you call command utility for generating devices it will create it and then give new ID back - so if you call it twice, you get two new devices....
radu_c_public: the two answers to the post would be like:
- to create the device use the CreateDevice program and the "controlled via device category" mechanism in the device template
- to check if the device already exists, you'll have to do some manual database checks as CreateDevice won't do it for you
Rob: in plug'n'play you do occasionally check what devices you have in system and then you get new devices in spite of device being already in....
radu_c_public: PnP is actualy Network PnP
Rob: I did the trick - so I checked existence for devices in Perl and then create new if necesary, but maybe this mechanism could be in CreateDevice already...
radu_c_public: a PnP device has a unique MAC, and that check is being done
radu_c_public: other forms of PnP aren't handled AFAIK
Rob: well what I mean is plug'n'play on other - home automation - level....
Rob: for instance EIB - you have to manually enter all connected devices in Pluto - but better way would be :
Rob: EIB controller scans EIB bus and then sends list of devices to Pluto and it generates devices (new only if device doesn't yet exist) - my case is pretty similar....
Rob: I just did Perl script that gets device list from controller, checks for devices and creates them if seen for the first time. Now I just trigger that script and pluto devices are uptodate with my current automation configuration. That's feature that is not currently present in most similar systems...
Rob: and I think is convenient solution....
Rob: you just rename devices and place them on floorplans....


Regards,

Rob.