UPB C# Source Code?

DotNetDog

Active Member
Does anyone have some C# sample code for sending/receiving UPB commands?
 
Yes, I'm planning to play with the protocol.  No, I am not planning to write another HA Software product.  This is just a fun little exercise to see if I can get my teenage son interested in programming.  He has already expressed an interest in this project.
 
 
 
Have a look here maybe
 
Cloning UPB
 
There is stuff here on the forum from a few years back relating to same topic.
 
Been playing a bit with OpenWRT on a bunch of devices and the Almond +.
 
I am able to get stuff working (barely) on my OpenWRT router with 8Mb / 32Mb for play which is a good thing right now.
 
Goofing a bit looking to modify the tiny Almond + GUI on it lately.  Much faster and more play room on the Almond +.
 
Just realized that the Casa Verde box roots are in OpenWRt....I've always had one; played with it for a bit then put in the HA automation box of discarded automation stuff....
 
OK, so I am going through the UPB Description doc and trying to understand it.  I have a simple program that connects to my PIM and simply reads any data.  Here is what I am seeing:
 
Device ID is:  14 (0x0E)
 
Manually turn the light ON and I receive two messages:
     PU08042A000E8664D2
     PU08052A000E8664D1
 
Manually turn the light OFF and I receive two messages:
     PU08042A000E860036
     PU08052A000E860035
 
 
Can someone explain these messages?  I need some help getting started at understanding the UPB description.
Thanks!
 
This may be of interest:
 
http://www.simply-automated.com/tech_specs/PimComm1.5a.pdf
 
Back to the message:
 
The "PU" is described in the document above.
 
The remaining fields are in hex.
 
The next 4 characters (0804 or 0805) are the Control Word. It's made up of a number of bit fields so reference the docs.
 
To explain part of it - the 04/05 indicate the packet will be sent 2 times and the 04 indicates it is the 1st, the 05 the 2nd.
 
The next 2 characters (2A) are the Network ID.
 
The next 2 characters (00) are the Destination ID - 00 is the value for the "Broadcast DID".
 
The next 2 characters (0E) are the Source ID - which matches the device ID you mentioned.
 
The next 2 characters (86) are the Message Data ID - 86 is the value for "Device State Report".
 
The next 2 characters (64,00) are the value being reported - as you can see in the docs 1 to 17 values can be reported here - here there is only 1.
 
64 hex = 100 decimal and 00 hex = 0 decimal.
 
The next 2 characters (D2,D1,36,35) are the checksum - see the docs on how it is computed.
 
 
Hope this is enough to get you started.
 
Frederick,
 
Thanks soooo much!  This is VERY helpful.  I was struggling to get started.  Now this is making much more sense to me!
 
I'll play around a bit to be sure that I have it down then I will introduce these concepts to my son.  Of course, he make grasp it faster than I did (young minds).
 
Thanks again!!!
 
This Command Wizard program from PCS is very helpful.
 
http://pcslighting.com/resources/PulseWorx/Software/UPBCmdWizSetupv1.8.zip
 
You follow through the prompts entering the parameters of the UPB command you want to send, including extended commands, and it generates the serial message.
like - PU08042A000E8664D2
 
By tweaking different parameters and observing the resultant changes int eh serial message you can gain a very good understanding of the protocol.
It is also useful as a dubugging tool to confirm the message you are sending is the correct one with the correct syntax.
 
Back
Top