Premise premise UPB drive and SA US2-40

Motorola Premise

dBeau

Active Member
I was a bit surprised the UPB driver doesnt seem to support SA's US2-40. Am I missing something?
 
... UPB driver doesnt seem to support SA's US2-40 ...
Premise's UPB driver was written a few years ago (before the US2-40) but its architecture is forward-thinking. It understands that SA's dimmer switch can be configured with 1,2,3,4,5 or 6 buttons and calls it a "USQ". Then it proceeds to associate each switch's Product ID to "USQ". Here's what it has in its upbProductIDs property in "upbSA.dll":

<Property Name="upbProductIDs" DisplayName="Product ID List" Class="sys://Schema/System/Text" DefaultValue="1 LM1 5 AM1 22 USQ 30 SerialPIM 40 CM01" Description="The list of product ID's this driver supports" ReadOnly="True" ID="{5A3BDD24-6B60-49A8-A028-23CDA217619D}"/>

So when the driver discovers a device whose UPB Product ID is 22 , it handles it as a "USQ" switch. The driver also has a property that lists a USQ's rocker button configurations:
"Half Height Quad Rocker"
"Half Height Dual Rocker"
"Half Height Triple Rocker"
"Full Height Single Rocker"
"Full Height Dual Rocker"
"Full Height Single Rocker"
etc etc

What's needed is to add the US2-40's Product ID (29) into the driver's upbProductIDs property so that it looks like this:
<Property Name="upbProductIDs" DisplayName="Product ID List" Class="sys://Schema/System/Text" DefaultValue="1 LM1 5 AM1 22 USQ 29 USQ 40 CM01 48 SerialPIM 201 LM1 205 AM1" Description="The list of product ID's this driver supports" ReadOnly="True" ID="{5A3BDD24-6B60-49A8-A028-23CDA217619D}"/>

The above example not only appends "29 USQ" it corrects the Product ID for SA's Serial PIM (it is 48 and not 30). You can use XN Resource Editor to edit upbSA.dll or simply download an updated version of it from Premise Downloads, compliments of Sam Greco.
 
If you've added a device, you should probably upload the revised driver with that noted. We should probably have a way of tracking them.

I havent added a device but I would like to. The download that 123 pointed me to already knew about the US2-40. Oddly, the older driver knew about the SA UML but the newer one is calling it a WS1D6.

I have a couple of SA US22-40's and a couple of PCS FMD2's that I'd like to be to control. I havent looked through the code yet to see if mapping their device id to an existing device would work right. Has anyone managed to build new dll's from the source code?

A bit off the original topic, but I was also wondering if anyone is using button press on the US2-40 to trigger "occupancy" for a room.

Thanks!
 
... wondering if anyone is using button press on the US2-40 to trigger "occupancy" for a room.
A little tweak to the Occupancy module and it'll consider turning on a Light as evidence of occupancy.

At the moment, the Occupancy module has an extension relationship with the following classes:
  • FloorSensor
  • MotionDetector
  • DoorSensor
  • GarageDoorSensor
  • WindowSensor
  • Button
If a Room contains any of the listed objects, its Occupancy property will be set if one or more of the objects is activated. The attached XDO file adds an extension relationship with the Lighting class. A Room will be Occupied whenever a Light's PowerState property is set to true.

Installation: Ensure you have the Occupancy module installed, then import the attached XDO.
 

Attachments

If a Room contains any of the listed objects, its Occupancy property will be set if one or more of the objects is activated. The attached XDO file adds an extension relationship with the Lighting class. A Room will be Occupied whenever a Light's PowerState property is set to true.

Now that's very cool. It's been about a week now and I am really starting to like premise. I'll have to take a look at what you've done, but the way you describe it makes me think it might not be what I was hoping for. It's not about the light being on. That can happen for many reasons, like a timer event, that have nothing at all to do with the room being occupied. I was hoping that the UPB driver was smart enough to generate an event when a button was pressed. A physical button press would indicate occupancy.

It's not been obvious to me how the driver deals with links. I havent seen them show up as objects anywhere, but there must be a way to trigger them.

Thanks!
 
Doh! Excellent point! A Light turned on by a Timer or Schedule doesn't indicate someone is in the room! Well, it's still a handy example of how to extend the functionality of an existing class ... ;)

Detecting a physical button-press is an interesting challenge. I think you're on the right track; some sort of signal must be sent to indicate when the light switch's rocker button is pressed. This signal should not be transmitted when the switch's power-state changes. I have no idea if links can satisfy these requirements.

I bought some UPB gear but haven't found the time to install it ... so I'm not sure how Premise's UPB driver handles, or displays, links. A quick search through the UPB driver's source code shows that it does do something with "LinkID".
 
Detecting a physical button-press is an interesting challenge. I think you're on the right track; some sort of signal must be sent to indicate when the light switch's rocker button is pressed. This signal should not be transmitted when the switch's power-state changes. I have no idea if links can satisfy these requirements.
One of the cool things about the UPB protocol is that every packet sent contains the ID of the source device. So the data is there. It's just a simple matter of programming ;) Multi-button switches like the US2-40 are a little trickier because they dont indicate which button was pressed. Instead, they simply send the command associated with the button. The nice thing about the premise UBP driver is that it bothers to query the switches for both their receive and transmit components. So internally at least it has all the information needed to track switch state through link activations and even make a very good guess at which button of a multi-button switch has been press (regardless of that button press actually activating anything). The down side to the approach is that the driver has to be tailored to each new switch.

Aside from not seeing how links figure in, the other thing that surprised me was that an unknown device is pretty useless. The protocol has many "generic" commands that could have been implemented.

I bought some UPB gear but haven't found the time to install it ... so I'm not sure how Premise's UPB driver handles, or displays, links. A quick search through the UPB driver's source code shows that it does do something with "LinkID".

I've got a pretty solid understanding of the UPB protocol and a working UPB (non premise) driver of my own. I'll be taking a closer look at the premise UPB driver.
 
...
I've got a pretty solid understanding of the UPB protocol and a working UPB (non premise) driver of my own. I'll be taking a closer look at the premise UPB driver.
Welcome to Premise! ;) Your time and expertise are greatly appreciated.

Before writing the USB-UIRT driver, I studied the source code for the UPB and ALC native drivers. C++ and COM programming are not my stock-in-trade but a great deal of persistence paid off. Premise's HSDK is needed to create new native drivers ... I don't believe it is needed to compile the UPB driver (but I may be wrong).
 
I followed the directions in this thread to get my us2-40 working but Im not having success.  I even used the xn resource editor to verify the product id 29 is in the dll and it is.  attached is the properties from my switch in premise.  What might I be missing?
 

Attachments

  • US2-40.JPG
    US2-40.JPG
    34.6 KB · Views: 5
Back
Top