Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Clipsal Cbus Plugin - Please!!

A plugin like the iTunes one or the new Lutron/HAI plugins would be really cool. I'm currently struggling with how to integrate cbus into iRule and specifically the cbus/rs232 based commands that turn lights on/off and dim lights as well as my other items on my cbus network. This coupled with the fact that the network interface unit only allows one connection at a time makes life real fun. I appreciate that last bit is not iRule's problem. ;)
3 people like
this idea
+1
Reply
  • Have you solved the issue yet?

    What network interface unit did you use?

    I would love to integrate I rule and cbus lighting....
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I know it's been a little while since any postings have been added to this idea. Since then I've decided to complete an install document of mine own. I'm doing all the doco needed to convert CBus commands into irule "language". Is their any interest still??? I'm also doing a complete revamp of the device codes and expanding it to include percentage options for dimmer based lights with ramp rates as well. I noticed that the only devices in the current database dealt only with ON/OFF and nothing else. Is their any interest in this information???
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • In my desire to give back to the community I have created a seven page document that outlines the work needed to integrate CBUS into iRule. I hope this helps somebody out there.

    I can provide it in a pdf format as well upon request. Also I'm creating a CBUS device by bringing together all the codes needed for instant on, instant off and a ramp rate of four seconds for all group addresses. The device is available but incomplete and is entitled CBUS - (RR 4 seconds/Percentages).

    The purpose of this document is to provide guidance in the integration of Clipsal’s CBUS network into the iRule Home Automation system. The document is divided into three sections beginning with hardware setup, followed by an explanation of the software commands needed and finally how to create those commands.
    CBUS commands ultimately begin as hexadecimal-based strings from the iRule software and are converted at an iRule button level into rs232 commands.
    NOTE: CBUS’s network will only recognise rs232 commands formatted into hexadecimal strings.
    HARDWARE SETUP
    The recommended hardware setup for iRule integration is either a global cache IP2SL (Ethernet based and individual power model), WF2SL (Wireless based and individual power model) or IP2SL-P (Ethernet based and POE model) connected to a CBUS 5500PC. The inclusion of the Global Cache device allows for multiple devices using the iRule software to be connected and sending commands to the CBUS network at the same time.
    NOTE: All CBUS network interface units allow for only one connection at a time. Additionally Global Cache serial devices only allow for a maximum of four connections at a time. Multiple CBUS 5500PC units and Global Cache devices maybe needed too satisfy increased connections. Eg. Remote access as well as an iPad, an iPad Mini and 2 iPhone’s.
    CBUS COMMANDS
    CBUS lighting commands are primarily grouped into three key areas:
    1. Instant ON
    2. Instant OFF
    3. Ramp Up or Down
    A basic CBUS (iRule formatted) command sent from the iRule software to your CBUS network looks like this:
    \\5380079004Ag\x0D
    This command sends an instant on request to group address 000. ie. Turn the device or devices connected to group address 000 instantly on with no ramp rate. The command is comprised of the following sections:
    1. A starting prefix of \\53800
    2. The instant on command of 79
    3. The group address affected of 00
    4. A mandatory checksum command of 4A (The purpose of this portion of the command is to ensure the integrity of the command. Outlined in the document C-BUS Quick Start Guide Section 4.3)
    5. A confirmation character of g (This portion of the command asks the CBUS network to confirm the receipt of the command. Outlined in the document C-BUS Quick Start Guide Section 4.2)
    6. An ending back slash and x0D to generate a carriage return (This is the same action as hitting the RETURN/ENTER button on your keyboard.)
    The opposing instant off command is as follows:
    \\538000100C2g\x0D
    The layout of the command is the same as above except that following the 53800 prefix, 01 represents the instant off command.
    NOTE: The above examples are the bare minimum needed for all CBUS strings being sent using iRule. The addition of features such as Ramp Rate does extend the length of the string and changes the layout of the command.
    CREATING YOUR OWN CBUS COMMANDS
    The steps taken to create your own CBUS commands firstly require the following information.
    1. What group address you wish to “change”
    2. Whether or not the change will be instant on, instant off or ramp rate based.
    3. If applicable the percentage based rate that you wish to “change” to. Eg. 25%, 50%, 75%
    NOTE: Ramp rate percentages must be converted using the provided formula on page 5 under ADDITIONAL RESOURCES first.
    With these three pieces of information you can begin the process of creating your CBUS command. Remember that the final command is almost completely hexadecimal based.
    As has been previously mentioned all CBUS (iRule formatted) commands start with a prefix of \\53800. The official CBUS prefix is actually \053800. So the unformatted CBUS prefix is:
    \053800
    with the following additions to the command depending on whether the command is instant on, instant off or ramped based.
    1. Instant ON - \05380079ggzzc
    2. Instant OFF - \05380001ggzzc
    3. Ramp - \053800rrggttzzc
    The additional characters are as follows.
    1. RR = ramp rate
    2. GG = Group Address
    3. TT = The percentage that you wish to ramp to
    4. ZZ = The mandatory CBUS checksum
    5. C = The confirmation character
    6. = Standard carriage return (This is represented in the final command differently for each product. Eg iRule shows it as x0D)

    The calculation needed to create the manadtory checksum is completed as follows:
    1. Open CALCULATOR (Windows 7)
    2. Click on VIEW and come down to PROGRAMMER
    3. Ensure your calculator is set to HEX and your output is set to BYTE

    4. Total up your hexadecimal based string so far
    5. Click on the BIN option to convert to binary
    6. Invert your binary result eg. 10011001 becomes 01100110
    7. Add 1 to your inverted result
    8. Click on the HEX button and note the result.
    9. As a final check add all your hexadecimal numbers together and your total should always be 0.
    By following the above steps you now have all the hexadecimal characters needed to create your CBUS command. A final conversion to an iRule compatible format requires the following changes:
    1. Add an additional back slash at the beginning of the string
    2. Drop the first zero
    3. Add an additional back slash after the confirmation character
    4. Add your carriage return characters, 0xD.
    Your final string when a ramp rate is included is as follows:
    \\53800rrggttzzc\0xD

    EXAMPLE 1
    John wants to turn on a light with a Group Address of 016. He wants it turned on instantly with no ramp rate.
    1. The first numbers of your command are always \053800.
    2. Add the instant on command of 79.
    3. Your string is now \05380079.
    4. When you convert your group address of 016 to hexadecimal you get 10.
    5. Your string is now \0538007910.
    6. Calculator your checksum.
    7. Make sure your calculator is in PROGRAMMER mode and that the option for HEX and BYTE are chosen.
    8. Add 05+38+00+79+10. This comes to C6 in hexadecimal or 1100 0110 in Binary.
    9. Now invert your binary result. This comes to 0011 1001.
    10. Add 1 to the binary result. This comes to 0011 1010.
    11. Click the HEX button and you have your hexadecimal result which is 3A.
    12. Your string is now \05380010793A.
    13. Finally add all your hexadecimal groups together and you should get a result of 0.
    To convert the command to an iRule format add an extra black slash at the beginning of the string, drop the first zero, add your confirmation character at the end (any letter is fine but I always use g) followed by a backslash and lastly the all-important x0D for your carriage return. So the final string for irule looks like this:
    \\5380010793Ag\x0D

    EXAMPLE 2
    John wants to turn on a light with a Group Address of 021. He wants it turned on to 50% progressively over 4 seconds.
    1. The first numbers of your command are always \053800.
    2. As the ramp rate is 4 seconds add 0A to your string.
    3. Your string is now \0538000A.
    4. When you convert your group address of 021 to hexadecimal you get 15.
    5. Your string is now \0538000A15.
    6. Convert your percentage ramp rate to decimal and then to hexadecimal. For 50% you get 7F.
    7. Your string is now \0538000A157F.
    8. Calculate your checksum as outlined on page 3. Your result is 25.
    9. Your string is now \0538000A157F25.
    10. Finally add all your hexadecimal groups together and you should get a result of 0.
    To convert the command to an iRule format add an extra black slash at the beginning of the string, drop the first zero, add your confirmation character at the end (any letter is fine but I always use g) followed by a backslash and lastly the all-important x0D for your carriage return. So the final string for irule looks like this:
    \\538000A157F25\0xD

    ADDITIONAL RESOURCES
    1. The C-BUS Quick Start Guide is currently available at http://training.clipsal.com/downloads....

    2. The formula to convert from a percentage based ramp rate to a decimal result is as follows:

    a. Your percentage multiplied by 255
    b. Divide by 100
    c. Truncate the final result
    Eg. 50% ramp rate is 50 x 255 / 100 = 127.5 Truncated becomes 127

    3. All CBUS group address’s converted to hexadecimal
    Group Address Hex Group Address Hex Group Address Hex
    000 0 086 56 172 AC
    001 1 087 57 173 AD
    002 2 088 58 174 AE
    003 3 089 59 175 AF
    004 4 090 5A 176 B0
    005 5 091 5B 177 B1
    006 6 092 5C 178 B2
    007 7 093 5D 179 B3
    008 8 094 5E 180 B4
    009 9 095 5F 181 B5
    010 A 096 60 182 B6
    011 B 097 61 183 B7
    012 C 098 62 184 B8
    013 D 099 63 185 B9
    014 E 100 64 186 BA
    015 F 101 65 187 BB
    016 10 102 66 188 BC
    017 11 103 67 189 BD
    018 12 104 68 190 BE
    019 13 105 69 191 BF
    020 14 106 6A 192 C0
    021 15 107 6B 193 C1
    022 16 108 6C 194 C2
    023 17 109 6D 195 C3
    024 18 110 6E 196 C4
    025 19 111 6F 197 C5
    026 1A 112 70 198 C6
    027 1B 113 71 199 C7
    028 1C 114 72 200 C8
    029 1D 115 73 201 C9
    030 1E 116 74 202 CA
    031 1F 117 75 203 CB
    032 20 118 76 204 CC
    033 21 119 77 205 CD
    034 22 120 78 206 CE
    035 23 121 79 207 CF
    036 24 122 7A 208 D0
    037 25 123 7B 209 D1
    038 26 124 7C 210 D2
    039 27 125 7D 211 D3
    040 28 126 7E 212 D4
    041 29 127 7F 213 D5
    042 2A 128 80 214 D6
    043 2B 129 81 215 D7
    044 2C 130 82 216 D8
    045 2D 131 83 217 D9
    046 2E 132 84 218 DA
    047 2F 133 85 219 DB
    048 30 134 86 220 DC
    049 31 135 87 221 DD
    050 32 136 88 222 DE
    051 33 137 89 223 DF
    052 34 138 8A 224 E0
    053 35 139 8B 225 E1
    054 36 140 8C 226 E2
    055 37 141 8D 227 E3
    056 38 142 8E 228 E4
    057 39 143 8F 229 E5
    058 3A 144 90 230 E6
    059 3B 145 91 231 E7
    060 3C 146 92 232 E8
    061 3D 147 93 233 E9
    062 3E 148 94 234 EA
    063 3F 149 95 235 EB
    064 40 150 96 236 EC
    065 41 151 97 237 ED
    066 42 152 98 238 EE
    067 43 153 99 239 EF
    068 44 154 9A 240 F0
    069 45 155 9B 241 F1
    070 46 156 9C 242 F2
    071 47 157 9D 243 F3
    072 48 158 9E 244 F4
    073 49 159 9F 245 F5
    074 4A 160 A0 246 F6
    075 4B 161 A1 247 F7
    076 4C 162 A2 248 F8
    077 4D 163 A3 249 F9
    078 4E 164 A4 250 FA
    079 4F 165 A5 251 FB
    080 50 166 A6 252 FC
    081 51 167 A7 253 FD
    082 52 168 A8 254 FE
    083 53 169 A9 255 FF
    084 54 170 AA
    085 55 171 AB

    4. Selection of ramp rates converted from seconds to hexadecimal

    Seconds Hex
    4 0A
    8 12
    12 1A
    20 22
    30 2A
    40 32
    60 3A
    90 42
    120 4A
    180 52
    300 5A
    420 62
    600 6A
    900 72
    1020 7A
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • +1 to a C-Bus Module.

    Ideally there would need to be two. One that supports C-Gate, and one that talks to a PCI via the Global Cache devices.

    Personally I think the option of running C-Gate makes the most sense. It reuses all of Clipsal's coding work, doesn't limit you to only four connections, and installed on an RPi talking to either a PCI or CNI, should even be cheaper than a GC setup (not that I've done this, my C-Gate is still running under Win7 talking to a CNI).

    But a single button in iRule that behaves like a Dimmer? That I would eagerly pay for, as with the default options available, I've found no way to achieve it.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • For anybody who cares I've added to the doco that I wrote. It's now eight pages with extra appendix based info. Also I'm forever adding to the CBUS device in the device list. Just search under the COMMUNITY tab for CLIPSAL as the vendor and download the one entitled CBUS - (RR 4 seconds/percentages).
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • John,
    I'm writing ON/OFF ramp program for Clipsal CBUS, for an iOS application. I've done these things successfully, but now I need to get the STATUS of the Controllers, so that the SYSTEM is always updated, as a user may change the state of the system using some other device. can you help?

    Eg: I turn ON the light on channel 1 using my iPAD and then I turn OFF the channel 1 using my iPhone then iPad should reflect that change on the interface .

    Regards.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited