Page 1 of 1

Complex device orgainization

Posted: Wed Sep 01, 2004 12:59 am
by csharp
Just learned about HouseBot yesterday. Great stuff here.



I want to develop a drive for Vantage Dimmer and Relays. These have a physical heirachy of Enclosure has Modules has Loads that should be exposed to the user. Only the Loads will have properties for setting the light level, power state, etc...



So my question is, what is the best way to orgainize this. I can tell by sending RS-232 commands to the system how the system is configure (how many enclosures, modules, etc...). I could then automatically create all of the Load devices. But I think it best to orgainize them.



I do not understand why I should use a Group verses a View?



I see that I can use CreateDevice from my Hardware Instance to create all of the devices. But I don't see how to put the device into a Group or View?



Or perhaps I use the DeviceName to indicate the EnclosureModuleLoad? But is it the DeviceName or the DeviceDescription that is used in scripts? I want the user to be able to give the device a nice logical name "Living Room Light" too.



Thanks in advance for the advice...

Re: Complex device orgainization

Posted: Wed Sep 01, 2004 9:12 am
by ScottBot
Lots of good questions.
csharp wrote:I want to develop a drive for Vantage Dimmer and Relays. These have a physical heirachy of Enclosure has Modules has Loads that should be exposed to the user. Only the Loads will have properties for setting the light level, power state, etc...

So my question is, what is the best way to orgainize this. I can tell by sending RS-232 commands to the system how the system is configure (how many enclosures, modules, etc...). I could then automatically create all of the Load devices. But I think it best to orgainize them.
You should create a single Hardware Interface plugin that will provide the lower level protocol control to the Vantage RS232 device. The hardware Interface will provide calls (Interfaces) that other devices that you develop can use to control the equipment. The Loads would be HouseBot Devices. I’m not sure about the Modules (I’m not familiar with the Vantage system). If this is something that can be handled internally by the Hardware Interface, I’d try to keep it internal. If you need to define some kind of Module ID from the Load Device, you may need to at least display the Modules in a dialog from the Hardware Interface so the user knows what they have to choose from.

The Z-Wave Hardware Interface plugin has the ability to automatically generate Z-Wave Devices using the configuration info contained in the hardware, so I gave this as an option to the user. Sometimes it might be nice to auto-generate the devices, but sometimes it's better to allow the user to create them manually.
I do not understand why I should use a Group verses a View?
You can think of a Group simply as a folder, like in the Windows explorer/file system. You can use it to help group Devices or Tasks. A group only contains like items (e.g. Task groups can only contain Tasks). A View provides a higher level organization that spans Modes, Tasks, and Devices to give you a 'virtual group'. Views don't actually hold the items, they only reference the items for display purposes. So removing an item from a view, doesn't delete it.

In my system I have groups setup into categories like "Lights" (which you could have sub-groups by room if needed), "Phone", "Media", etc. I think use the Views to organize by a more logical view such as "Kids", "Lighting", "Media", etc. The Views give me quick access to all of the Tasks, Modes, and Devices so I don't have to keep navigating between the Mode, Task, and Devices nodes in the tree view. A single object can be in more than one view, so my "Kids" view may contain a Light Device that is also included in the "Lighting" view.
I see that I can use CreateDevice from my Hardware Instance to create all of the devices. But I don't see how to put the device into a Group or View?
You're right. There's no way to do that with the current API. Groups and Views were implemented after the initial API was developed so there are no APIs to deal with them. I guess I always think of Groups and Views as things that individual users will use to setup their system to meet their specific needs and not something that the Devices or Interfaces would specify. When creating a new Device, the user can create it from a group and it will automatically be added to that group. The Device wizard will also prompt them to add it to a view.
Or perhaps I use the DeviceName to indicate the EnclosureModuleLoad?
Not sure what you mean here.
But is it the DeviceName or the DeviceDescription that is used in scripts?
DeviceDescription. DeviceName is like a unique identifier for that device type, but you may have multiple instances of the same device type (Name), so it's not unique in the system.
I want the user to be able to give the device a nice logical name "Living Room Light" too.
That's exactly what Device Description is for. You can give a default description when creating the device with the API, but the user can still change it from the UI after it is created. You could prompt for a description while creating it if you wanted it to be more interactive.

Posted: Fri Sep 10, 2004 12:14 am
by csharp
Scott thanks for the info. I've got the Vantage Dimmer and Relay modules implemented and it works great.



Vantage is a fairly hi-end system but I choose it because it is rock solid. If others would like to have this device support, what is the proper way to share it? Except for having not written any help, the work is solid.



I did have a question. I want to be able to map the cursor keys on a PPC to increase or decrease the dim level of a light. What is the proper way to express this in HouseBot?



If in a theme I map the "Cursor Up" button to a property, it can only set the Dim Level property to an absolute value, not a relative value. But I want it to increment the Dim Level by 1 not exceeding the Maximum value.



I thought I could create an Increment property in my Software Dimmer device with values Up and Down. Internally the Software Dimmer device could then do the right thing on repeatedly having it's property value set to Up.



Alternatively the Increment value could be a positive or negative number to apply a relative change to the current dim level.



But to have to put the code into a single software device make me wonder it this is the proper way to do this?



There doesn't seem to be a way to rename a theme? I made a duplicate of one and don't want it the have a similar name.



Thanks for your quick replies...

Posted: Fri Sep 10, 2004 8:48 am
by ScottBot
To increment or decrement a value from a Theme control, use the += or -= notation for the Value instead of an absolute value. For example, to increase a numeric value by 5, you would specify +=5 for the Value.



There's no way to set the limits for a Property Value from the Theme controls (except for gauges,sliders and dials). Limits need to be controlled by the Devices. So if you have a physical limit of 100, for example, and someone tries to change it to 105, the Device will simply set it to 100 (it could also fail the request, but its nicer to just manage the over-request).



You can rename a Theme by selecting "Theme / Theme Properties" from the main menu when viewing the Theme in the Theme editor. There's no way to change the actual physical theme file name (.XML file) without modifying the DB manually.



Thanks for your offer to share the plugins with the community! :D

Ultimately, we will have things setup where HouseBot plugins can be posted to the Meedio Add-Ins (MAID) area. I'm not sure when this will be available, so let me check into the best way to do this. If nothing else, I can post them as an attachement to a post in your behalf.

Posted: Fri Sep 10, 2004 12:48 pm
by csharp
Thanks for the reply. I figured you would have had a means already to do the relative settings.



If someone has an interested in a Vantgage driver, post here and I'll work with Scott to get it to you. In the mean time I'll continue to test and make improvements until they have a general way to post user built plug-ins.

Vantage plug-in

Posted: Tue Nov 23, 2004 9:36 pm
by ltb
I'm interested in the Vantage plug-in. I'm a Vantage dealer and I see huge potential for Meedio used with the Vantage system.

Thanks,

Lance

Vantage driver release

Posted: Sat Nov 27, 2004 2:12 pm
by csharp
I'd post it if there were a way on this forum to do so. Othewise, send me your e-mail via PM and I'll send it to you.