PDA

View Full Version : Beta UPB driver


Mark Stega
07-17-2007, 11:12 AM
The UPB driver is ready for beta. We can control toggles, dimmers, leds,and links at this time. The driver was developed using a PIM from both PCS and Simply Automated, it has not been tested with any other PIM.

Driver documentation follows:

General

The UPB driver exists in serial and IP versions. It uses a plain ASCII file, comma delimited, configuration file. This file is called UPB.CSV and is located in the directory MacroFileRoot\Drivers\UPB in the CQC data directory structure. Content is a series of records of "Type, Device address, Channel number, Device name, Additional info". Toymaster has a converter that will read a UPStart export file (.upe) and create the csv file. All values are decimal. An excerpt from a typical file is shown here: NETWORK,231,11,2,,
DIMMER,72,0,DEV-UpstairsHallway_BackLight,,
DIMMER,53,0,DEV-Outside_BalconyLight,,
DIMMER,83,0,DEV-LivingRoom_Bar,,
TOGGLE,112,0,DEV-Kitchen_CounterLightL,,
TOGGLE,113,0,DEV-Kitchen_CounterLightR,,
TOGGLE,120,0,DEV-PowderRoom_Fan,,
LED,4,3,LED-MasterBedroom_TabletopControl-A,,
LED,4,4,LED-MasterBedroom_TabletopControl-B,,
LINK,1,0,LNK-NightTime-1,72;112;113;120;56;69;99;97;95;61;64;75;116;119;1 11;57;86;79;82;70;106;107;114;102;84;51;54;109;115 ;101;110;,
LINK,2,0,LNK-PoolFilter-2,49;,
LINK,3,0,LNK-LivingLamp-3,114;84;115;,
EOF,,,,,

The network record has three fields and those are the network address, the number of device records, and an amount of additional time to delay a poll after a link command (in seconds).

The dimmer, toggle, and led records have a device address, channel number, and device name.

The link records have a link number, a zero channel number, a link name, and a semicolon delimited list of devices affected by the link action. The first entry is the longest default delay time of any device in the list.

The end record stands alone.

Fields

Fields are created for each device. Field names are the names in the configuration file. A toggle has a boolean field created as does an LED, a dimmer has a cardinal field with a range of 0 to 100. These fields are read-write.

Three fields are created for each link. The first (Name-Activate) is a boolean that, when written, will activate or deactivate a link. The second (Name-Fade) will send a fade command to the link. The last (Name-GoTo) will send a GoTo command to the link. These fields are read-write to accomodate a wee problem in the Admin tool.

All actions that result in an effective fade command (writing to a dimmer or to a link GoTo or Fade) are modified by the content of the well known field "UPB-FadeRate". The field contents are read and used to modify all fade commands. The value of "Default" results inthe device's default faderate to be used.

Polling

The driver polls very slowly (One field every minute). On startup it will poll all pollable fields at one per 1&1/2 second. After a link command is issued, the link participants will be polled at one per 1&1/2 seconds. The poll start is delayed by the amount of time set in the FadeRate field plus the additional delay specified on the network configuration line with a maximum delay of one minute.

Events

The driver raises an event of “Activate” with a value of “nnn” when it sees an incoming link activate event. Similarly, the driver raises an event of “Deactivate” with a value of “nnn” for an incoming deactivate event. The “nnn” is a 3 digit device id in decimal.

---------------------

Acquiring the driver: The driver is attached in a zip file. The zip is composed of text files. This means you have to have enough familiarity with the driver test harness that you can open a manifest and get the driver loaded.

---------------------

Update:
23JUL07 - Version 0.3; Corrects a timeout situation
24JUL07 - Version 0.4; Release candidate 1
25JUL07 - Version 0.5; Release candidate 2; Changed UPB.csv location; Changed events

ToyMaster458
07-17-2007, 11:39 AM
I have created a Converter that will convert the UPStart Export to a CQC UPB Configuration File. See Here for more information http://www.charmedquark.com/vb_forum/showthread.php?p=63515#post63515

ToyMaster458
07-18-2007, 08:35 AM
These fields are read-write, but currently show the last value written since the driver is one way.
I was starting to setup my templates for in preperation for the two-way version and you do not have the boolean fields set as ReadWrite just Write

Mark Stega
07-18-2007, 08:41 AM
I was starting to setup my templates for in preperation for the two-way version and you do not have the boolean fields set as ReadWrite just Write You can change line 418 to make them read-write. I actually had all of the fields as write only to correspond to the fact that the driver is one way. I changed the cardinal ones to read-write to get around the field browser bug.

ToyMaster458
07-23-2007, 10:17 AM
Just for everyone knows the Driver Mark has posted is the Two-Way version.

BrandonStapp
07-23-2007, 11:40 AM
okay, just pulled it down, hopefully i will get the chance to play today!

Mark Stega
07-24-2007, 04:51 AM
I posted the first release candidate of the driver.

The driver raises a user event on reception of a link activate/deactivate.

Currently it does:

Action Arguments

UPB-LINK nnnActivate, where nnn is the link number
UPB-LINK nnnDeactivate, where nnn is the link number

There are (at least) two other variants that could be considered:

UPB-LINK-ACTIVATE nnn
UPB-LINK-DEACTIVATE nnn

and

UPB-LINK-nnn ACTIVATE
UPB-LINK-nnn DEACTIVATE

Does anyone have any strong feelings for one form versus the others? Since these are ony raised in response to a user action with lighting from a keypad, I suppose I could raise three events, one of each form, since they are so infrequent.

robertmee
07-24-2007, 04:57 AM
I posted the first release candidate of the driver.

The driver raises a user event on reception of a link activate/deactivate.

Currently it does:

Action Arguments

UPB-LINK nnnActivate, where nnn is the link number
UPB-LINK nnnDeactivate, where nnn is the link number

There are (at least) two other variants that could be considered:

UPB-LINK-ACTIVATE nnn
UPB-LINK-DEACTIVATE nnn

and

UPB-LINK-nnn ACTIVATE
UPB-LINK-nnn DEACTIVATE

Does anyone have any strong feelings for one form versus the others? Since these are ony raised in response to a user action with lighting from a keypad, I suppose I could raise three events, one of each form, since they are so infrequent.

If I understand correctly, these are user action events passed to the event strings? If so, why make them so long? Since the nnn and Activate/Deactivate is the important info and what will be used in actions likely within IF/THENs, do something like Annn and Dnnn. Using the IsUserActionFrom filters, we'll know it is from the UPB driver.

Mark Stega
07-24-2007, 05:17 AM
If I understand correctly, these are user action events passed to the event strings? If so, why make them so long? Since the nnn and Activate/Deactivate is the important info and what will be used in actions likely within IF/THENs, do something like Annn and Dnnn. Using the IsUserActionFrom filters, we'll know it is from the UPB driver.

I don't see why the length matters, the best practice wouldn't be to repetitively type 'nnnActivate' in a series of IF statements, but to process the string first and to split the link and the 'command' once, then to process. I'd rather keep the names long to be more self documenting so a year from now when I look at an action I don't have to remember what A & D stand for.

But you make a good point of using the driver filter. This argues for events of type ActivateLink/DeactivateLink with the data being the link number OR the converse, the event type is the link number and the data is ActivateLink or DeactivateLink. So which of these would be preferable?

robertmee
07-24-2007, 06:47 AM
I don't see why the length matters, the best practice wouldn't be to repetitively type 'nnnActivate' in a series of IF statements, but to process the string first and to split the link and the 'command' once, then to process. I'd rather keep the names long to be more self documenting so a year from now when I look at an action I don't have to remember what A & D stand for.

But you make a good point of using the driver filter. This argues for events of type ActivateLink/DeactivateLink with the data being the link number OR the converse, the event type is the link number and the data is ActivateLink or DeactivateLink. So which of these would be preferable?

The length matters because unlike fields which can be browsed to, these will have to be manually typed into any IF statement, and the longer more convoluted, the better chance of a typo.

I think event type of Active or Deactive with the Link ### as the value would be perfect.

Dean Roddey
07-24-2007, 09:46 AM
You could always just use Off/On instead Activatve/Deactivate. They are shorter and clear as to what they mean.

ToyMaster458
07-24-2007, 11:12 AM
I like Activate and Deactivate better. Sure it is longer but it follows the UPB Link terminology. If it was a User Action from the device instead of a Link then I would agree.

BrandonStapp
08-02-2007, 09:49 AM
looks great so far, we are now using it here at the office. If Kirk has time tonight, i will be running it at the house. ;-)

eded9698
09-20-2007, 05:00 PM
The driver has an IP or serial version. What equipment do I need to use the IP part.

ToyMaster458
09-20-2007, 07:05 PM
An Elk-IP232. It has not been tested yet.

ToyMaster458
09-21-2007, 06:45 AM
Just an FYI. This driver has been officialy released and is part of the CQC install version 2.2.4 and above. Please contact Mark for the official driver write-up as it is not on the web site yet.

fcwilt
10-09-2007, 01:56 PM
One of the Simply Automated modules that I use is the UIM-32 I/O Module. Will this item be supported by this driver?

ToyMaster458
10-09-2007, 02:08 PM
send me the UPStart Configuration file and I will check it out.

fcwilt
10-09-2007, 04:38 PM
send me the UPStart Configuration file and I will check it out.

I would be glad to but the forum option to send email doesn't seem to support attachments.

Recommendations?

ToyMaster458
10-09-2007, 06:52 PM
I sent you a message with my email address.

ToyMaster458
10-09-2007, 08:11 PM
This is an update for everyone just to keep those who maybe interested in the loop. I have looked at his configuration file and here is a copy of my email response back.
Ok looking at this right now you can setup the Outputs as a Toggle records and the Inputs as Links. I am not sure if the driver will report the status back on the Outputs. Without Mark or I having one to test with it would be hard to get stronger integration or even know if this will work. If you are using my UPB UPStart Converter to parse your exported UPStart configuration just add the following records in the CQC UPB Configuration file.

TOGGLE,100,1,DEV-Garage_GarageDoor1-CH-A,,
TOGGLE,100,2,DEV-Garage_GarageDoor1-CH-B,,
TOGGLE,101,1,DEV-Garage_GarageDoor2-CH-A,,
TOGGLE,101,2,DEV-Garage_GarageDoor2-CH-B,,

The links for the Inputs should already be in the file

fcwilt
10-10-2007, 07:51 AM
Adding the devices to the config file as TOGGLE devices worked fine. The LINKS to control the outputs are there as well.

The inputs are configured via UPstart to activate or deactivate certain links. However these inputs do not show up in the CQC field browser.

I have another home automation product that does show the state of these inputs suggesting there is a way to get this information.

eded9698
11-11-2007, 05:44 PM
The stngest thing happened. I restarted my computer and the UPB driver disappeared. And when I try to add it back I get this error.

"The remote driver load was not successful, Driver UPBLighting failed to initialize, so it will not load. See the logs for details
MEng.System.CQC.Drivers.UPB.DriverImpl"

Has anyone experienced this?

Dean Roddey
11-11-2007, 05:55 PM
What is showing up in the logs?

eded9698
11-11-2007, 06:33 PM
"Remote client forcing load of driver. Moniker=xcvxc.M/M/V=UPB/PLC-Serial/05"
"Driver UPB failed to initialize, so it will not load. See the logs for details.

Can making changes to CQC through remote desktop have caused this?

eded9698
11-11-2007, 09:02 PM
It turned out to be the new UPB.csv file that is the problem. I was hoping someone can tell me what is wrong with the file.

NETWORK,110,51,4,,
DIMMER,22,0,DEV-BackDoor_Lights,,
DIMMER,16,0,DEV-BackLight_Lights,,
DIMMER,13,0,DEV-BathRoom2_Lights,,
DIMMER,11,0,DEV-BreakfastNook_Lights,,
TOGGLE,17,0,DEV-Computerlamp_NewSAUML,,
DIMMER,19,0,DEV-ComputerNook_Lights,,
DIMMER,27,0,DEV-Daniel'sRoom_Lights,,
DIMMER,6,0,DEV-DeckLeft_Lights,,
DIMMER,7,0,DEV-DeckRight_Lights,,
DIMMER,9,0,DEV-DiningRoom_Lights,,
DIMMER,28,0,DEV-Erik'sRoom_Lights,,
DIMMER,26,0,DEV-FamilyRoom_Lights,,
DIMMER,15,0,DEV-FrontHall_Lights,,
DIMMER,10,0,DEV-FrontPorch_Lights,,
DIMMER,20,0,DEV-Hallway_Lights,,
DIMMER,5,0,DEV-KeepingRoom_Lights,,
DIMMER,25,0,DEV-Kitchen_Lights,,
DIMMER,21,0,DEV-LaundryRoom_Lights,,
DIMMER,8,0,DEV-MasterBedLamp_Lights,,
DIMMER,1,0,DEV-MasterBedroom_Lights,,
DIMMER,4,0,DEV-MbathCeiling_Lights,,
DIMMER,3,0,DEV-MBathVanity_Lights,,
DIMMER,12,0,DEV-Office_Lights,,
DIMMER,23,0,DEV-OutsideGarage_Lights,,
DIMMER,29,0,DEV-Playroom_Lights,,
DIMMER,24,0,DEV-ScreenPorch_Lights,,
DIMMER,2,0,DEV-SittingRoom_Lights,,
DIMMER,18,0,DEV-Stairs_Lights,,
DIMMER,30,0,DEV-UnderCabinet_Lights,,
LINK,22,0,LNK-Back_Door,0;22;,
LINK,11,0,LNK-Back_Light,0;16;,
LINK,9,0,LNK-Back_Outside,0;7;16;23;,
LINK,8,0,LNK-Computer_Lamp,0;17;,
LINK,7,0,LNK-Computer_Nook,0;19;,
LINK,18,0,LNK-Daniel's_Room,0;27;,
LINK,10,0,LNK-Deck_Right,0;7;,
LINK,15,0,LNK-Dining_Room,0;9;,
LINK,17,0,LNK-Erik's_Room,0;28;,
LINK,20,0,LNK-Family_Room,3;26;,
LINK,13,0,LNK-Front_Hall,0;15;,
LINK,14,0,LNK-Front_Porch,0;10;,
LINK,21,0,LNK-Hallway,0;20;,
LINK,19,0,LNK-Kitchen,0;25;,
LINK,1,0,LNK-Link001,3;19;20;22;24;25;26;28;29;30;,
LINK,2,0,LNK-Link002,3;19;20;22;24;25;26;28;29;30;17;,
LINK,3,0,LNK-Link003,0;17;,
LINK,4,0,LNK-Link004,0;17;,
LINK,5,0,LNK-Link005,0;17;,
LINK,6,0,LNK-Link006,0;17;,
LINK,12,0,LNK-Outside_Garage,0;23;,
LINK,16,0,LNK-Playroom,0;29;,
EOF,,,,,

Mark Stega
11-12-2007, 04:05 AM
I believe the hyphen in "Eric's room" makes the field name invalid...

Dean Roddey
11-12-2007, 01:06 PM
Not the hyphen but the apostrophe. If these are being used to create field names, they have to conform to legal field names, so alphanumerics, underscore and hyplen are the only options.

ToyMaster458
11-12-2007, 01:11 PM
It looks like you used the UPB UPStart Converter. Try the new version, I think it removes more of the illegal options
http://www.kanak.com/Store/proddetail.asp?prod=KSI%2DUPBCQC

eded9698
11-12-2007, 02:30 PM
It looks like you used the UPB UPStart Converter. Try the new version, I think it removes more of the illegal options
http://www.kanak.com/Store/proddetail.asp?prod=KSI%2DUPBCQC

I don't see the download link. The link you provided takes me to a shopping cart.

Mark Stega
11-12-2007, 04:24 PM
Not the hyphen but the apostrophe. If these are being used to create field names, they have to conform to legal field names, so alphanumerics, underscore and hyplen are the only options.That's what I get for typing something after 18 hours of travel! I, of course, meant the 'vertical hyphen' (AKA the apostrophe) in "Erik'sRoom_Lights".


You can edit the UPStart file by hand until Kirk can point you to the utility.

ellisr63
12-09-2007, 11:24 AM
I am getting this error when trying to install the UPB-serial driver...:-( Driver UP-Serial failed to initialize, so it will not load. See the logs for details

MEng.System.CQC.Drivers.UPB.DriverImpl

What am I doing wrong? I am on CQC 2.3.1

ToyMaster458
12-09-2007, 11:29 AM
Can you post or email me your UPB configuration file?

ellisr63
12-09-2007, 12:01 PM
Can you post or email me your UPB configuration file?
Do you mean for the UPB upstart?

ToyMaster458
12-09-2007, 12:04 PM
I sent you an email

ToyMaster458
12-09-2007, 01:03 PM
Just to update everyone, we talked real-time and found that he had no CQC UPB configuration file. After he created the file the driver worked fine.

ellisr63
12-09-2007, 03:29 PM
Thanks again:-)

ellisr63
12-11-2007, 04:20 PM
How would I set up CQC to where if a person turns a light on from the switch.... that CQC would turn it off after say 15 minutes or so, or is this even possible?

ToyMaster458
12-11-2007, 05:26 PM
Place a trigger on that light field so whenever it turns on it will run an event that will set a Timer from the Timer driver to count down from 15 minutes. Then when that timer hits 0 it runs another event to turn off the light.

ellisr63
12-11-2007, 06:47 PM
Place a trigger on that light field so whenever it turns on it will run an event that will set a Timer from the Timer driver to count down from 15 minutes. Then when that timer hits 0 it runs another event to turn off the light.
How do I do that?
tia,
Ron

ellisr63
12-12-2007, 08:22 AM
I found the info on how to do it in the "Learn" section but I don't quite understand what to put in the fields when I make the trigger...

I would like to make a 15 min trigger to turn off a light... could someone post step by step instructions for me please?
tia,
Ron

ellisr63
12-15-2007, 05:46 PM
Just to update everyone, we talked real-time and found that he had no CQC UPB configuration file. After he created the file the driver worked fine.
Was updating the UPStart today and when I eported it... after restarting CQC of course..... I went into ADMIN and my UPB driver was gone:-? . I went to reinstall the driver and I am back to the same error again:-( . I checked and the file is in the location that it should be... unless it is the wrong file?

ellisr63
12-15-2007, 07:27 PM
SOLVED IT...I had a "/" in my UPStart file.:oops:

Mark Stega
12-17-2007, 02:30 AM
Thread closed - New discussion thread concerning a new beta is being created.