Wiser SDK?

Discussion in 'C-Bus Wiser 1 Controller' started by nickrusanov, Mar 4, 2010.

  1. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    We have a good bunch of tools available for C-Bus integration now: .dll, Linux driver, C-Gate protocol documentation, C-Bus Serial Protocols. They are not perfect.

    .dll needs Windows and computer. Linux needs Linux with all it's compilations and complexity and computer. C-Gate needs Java and computer. Serial Protocol needs 1 expensive C-Bus interface per connected device.:mad:

    Don't you think that there is one thing for perfection - "Wiser Software Development Kit"? This way anyone will be able to create a simple program in their controller and easily connect 5-6 devices to C-Bus.

    I can use Philips Pronto as an example. Now we have "not easy to get" CNI prontoscript driver, which needs 1 CNI per every Pronto and very good C-Gate driver which needs computer always turned on. We could connect many Prontos directly to Wiser if we had an SDK:rolleyes:
     
    nickrusanov, Mar 4, 2010
    #1
  2. nickrusanov

    kjayakumar

    Joined:
    Oct 27, 2008
    Messages:
    448
    Likes Received:
    0
    I understand. I should make sure we agree on what an SDK means though. As you know, the Pronto uses Prontoscript which is a javascript based language. If by SDK, you mean that Clipsal should provide a Prontoscript language library that has simple functions like pronto_set_wiser_lighting(address, level), then that is technically feasible but it might not be commercially possible for Clipsal (I don't know, just guessing). Also, there are a lot of devices with a lot of operating systems out there and Clipsal has to pick the ones that are most likely to be useful to existing customers. I do agree that I see Pronto show up a lot on these forums but don't know how much commercial demand the people in charge see for it.
     
    kjayakumar, Mar 5, 2010
    #2
  3. nickrusanov

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    Ofcourse you're right. I meant SDK like a kit, which would help third party developers integrate using Wiser (not using C-Gate or .dll like now). Maybe I whould have called it Wiser Protocol (like C-Bus Open Protocols, but for Wiser), which would help third party developers to create their own prontoscript and other ...script drivers.

    That's what you do with iPhone application right now.
     
    nickrusanov, Mar 16, 2010
    #3
  4. nickrusanov

    kjayakumar

    Joined:
    Oct 27, 2008
    Messages:
    448
    Likes Received:
    0
    Ah, I understand now. Ok, I think publishing the Wiser protocol (and more importantly keeping it consistent across different versions) would be a strategy decision for Clipsal and I think the decision makers are considering the pro/con of doing so. For example, if the API is still evolving then it probably doesn't make sense to publish it as developers would keep having to change their device as well, and that would make an unhappy developer.

    One thing to clarify, the Wiser iPhone app was developed in-house by Clipsal engineers and is not a third-party developed app. It uses Apple's native iPhone/iTouch SDK which is from Apple.
     
    kjayakumar, Mar 16, 2010
    #4
  5. nickrusanov

    mmd

    Joined:
    Jan 30, 2006
    Messages:
    42
    Likes Received:
    0
    Location:
    Melbourne
    Hmmm, are you sure? Why doesn't the seller information on Itunes say Schneider or Clipsal instead of Yun Wei Khong? Even assuming Yun is the head programmer for this at adelaide, it seems odd their details would appear in that field instead of company information.......
     
    mmd, Mar 17, 2010
    #5
  6. nickrusanov

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    It does seem odd.. probably an oversight, but yes, it is developed in-house (Yun Wei is the developer). There are a few schneider-electric logos scattered around the place if you look carefully.

    Nick
     
    NickD, Mar 17, 2010
    #6
  7. nickrusanov

    mmd

    Joined:
    Jan 30, 2006
    Messages:
    42
    Likes Received:
    0
    Location:
    Melbourne
    Fair enough. Must've just typed the details wrong when the apple account was created.
     
    mmd, Mar 18, 2010
    #7
  8. nickrusanov

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    +1 for a real SDK. I'm putting in a clipsal system in our new home and came out hunting for an SDK and am a little scared at the lack of developer tools available to provider a simple integration point. I think it would be fantastic if there we some sort of a "no brainer" situation.
     
    ievolve, Mar 20, 2010
    #8
  9. nickrusanov

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Depends on what you want. If you want a set of WISER tools, thats one thing.

    If you want general tools for general development, there is a great deal which is published and freely available (eg - all the protocol documentation is available for free download, and there is a complete portable C library for device development which is on sourceforge.)
     
    ashleigh, Mar 20, 2010
    #9
  10. nickrusanov

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Control Sonos from C-Bus

    What I am trying to do is this:

    I want to control the volume on my sonos from the clipsal "saturn" lighting keypads I have.

    So I need to have something listening for keypresses and calling out to sonos to adjust the volume.

    I've already written the piece to talk to sonos, that was upnp and simple to do.

    Now what I need to do is to have a way to listen for those keypresses on the keypad.

    Problem is I dont know which of the many ways to integrate with c-bus is the way I need to go. What hardware do I need and what software/SDK/library is the best for what I am trying to do? Seems like there are a lot of integration options, just dont know what each is used for.
     
    ievolve, Mar 20, 2010
    #10
  11. nickrusanov

    kjayakumar

    Joined:
    Oct 27, 2008
    Messages:
    448
    Likes Received:
    0
    What does the piece you mentioned above run on? If its a PC, then you could have it either talk to cgate to pick up the C-Bus events from your saturn key input , or use PICED with Logic to pick up the events there and then use Logic's TCP/IP socket API to send that to your application.

    If you're trying to do this on a Wiser, you'd add logic in your PICED project to use the TCP/IP socket API to peek/poke the Sonos directly via HTTP but keep in mind Wiser's TCP/IP socket buffers have smaller sizes.
     
    kjayakumar, Mar 20, 2010
    #11
  12. nickrusanov

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Yes, it is running on a PC.

    Can you tell me the pro/con to the cgate solution vs the PICED/logic solution? I'm not familiar with either. Is one easier to deal with? One more reliable?

    One thing that I would like to do as well is send signal back to the keypad to update the label.

    In either case, what are the hardware requirements on the clipsal end for the PC to be able to receive signal? I know a lot of this stuff uses serial port which my PC doesnt have :(

    I'd like to set up a little mock environment locally so I can have everything ready when the house is complete. Wife acceptance is a big factor here as she has reluctantly agreed to let me do the clipsal so it needs to please.

    I dont have wiser and would like to have to avoid having to buy another piece of hardware if possible.
     
    ievolve, Mar 20, 2010
    #12
  13. nickrusanov

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    There are at least 4 possible solutions depending on what you want to do and how you want to do it.

    1/ You could run HomeGate (which you have to buy) on a PC. This has a built-in logic engine (where you write your own code which it will run for you). To attach this to cbus you will need a PCI (5500PC) or USB PCI (cant remember part number), or an (ethernet) CNI (5500CN).

    2/ You could run cgate on a PC, and write your own client. Cgate is free, and comes with cbus Toolkit when you download it. You will need to figure out how to write a TCP / socket based client of cgate. To attach this to cbus you will need a you will need a PCI (5500PC) or USB PCI (cant remember part number), or an (ethernet) CNI (5500CN).

    3/ You could download the "Cbus module" from sourceforge. This is a bunch of C source code units which you will then need to tailor to the processor and compiler you have. Or use the pre-compiled Windows DLL version of it. These are all free (source - from SourceForge - pre-compiled version from the Clipsal web site). You then need to write your own code to use the API that is exposed, in order to deliver the functions you want. To attach this to cbus you will need a you will need a PCI (5500PC) or USB PCI (cant remember part number). [This code DOES NOT work over ethernet to a CNI unless you write your own sockets-layer wrapper, which has been done by a number of users but never released into the public domain.]

    4/ You could download the protocol documents from the Clipsal web site and grow your own solution from the ground up. This requires a PCI or USB PCI for the cbus connection.

    You will notice that none of the above solutions involve the Wiser - it sounds like you don't have one of these and don't really want to buy one. Even if you did, it (of itself) would not solve your problem - though you might be able to use the Wiser to run logic code just like Homegate. (In fact the logic code that runs on them both is the same.)

    In rough order of difficulty, (easiest to hardest) the solutions above are in order of 1, (2 / 3), 4. Solutions 2 & 3 both require a fair bit of programming skill - just different skills. Solution 4 requires a good understanding of communication protocols, serial I/O, how to drive your PC's serial ports, and how to write code to manage asynchronous operations.

    In rough order of cost (least to highest), the solutions above are in order of 4, (2 / 3), 1. The reverse of difficulty. Thats hardly surprising.
     
    ashleigh, Mar 21, 2010
    #13
  14. nickrusanov

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Very thorough reply, thank you so very much!

    One small question. In option 1, what interface does homegate expose for me to trigger commands to/from the cbus network?

    Meaning, when the user presses a button on the keypad, can homegate call a .bat file on my server which I would trip my sonos with?

    What about the inverse? Song changes on the sonos and I need to push a command to homegate, is there some sort of CLI (command line interface) to homegate that I hit to do that? Perhaps an http API?

    So basically what are the options in homegate to 1) make calls to external resources and 2) receive calls from external interfaces.

    Thanks so much, I am very excited about clipsal, I think we made a fine choice indeed.
     
    ievolve, Mar 21, 2010
    #14
  15. nickrusanov

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    I'm not sure if Homegate can execute a batch file for you or not.

    Probably the best way to look at logic is to download PICED - which is also free. It has the same logic engine as Homegate so you can take a look through the help files, and experiment a bit.
     
    ashleigh, Mar 21, 2010
    #15
  16. nickrusanov

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Thanks ashleigh, I think I have decided on using c-gate as a first rev. Just got through the manual and I think everything (and way more) should be in there that I need, perfect!
     
    ievolve, Mar 21, 2010
    #16
  17. nickrusanov

    Mr Mark

    Joined:
    Jan 27, 2006
    Messages:
    323
    Likes Received:
    5
    Location:
    FNQ
    In the past I have used C-Bus events to trigger TCL scripting via Homegate - shouldn't be any different for batch files.

    Mark
     
    Mr Mark, Mar 21, 2010
    #17
  18. nickrusanov

    KevinH

    Joined:
    Aug 3, 2004
    Messages:
    171
    Likes Received:
    0
    Location:
    Yorkshire. UK
    Are you just implementing volume / transport control or have you written a complete UPnP based interface ? You'll certainly need more than launching script files based on events from C-Bus.

    I've gone a very circuitous route to integrating Sonos (that wouldn't be something you'd want to consider), but it has taken a long while to get working (still in progress) as aspects of the Sonos implementation are very challenging - and non standard (cover art, playlist management, external service meta data).

    K
     
    KevinH, Mar 23, 2010
    #18
  19. nickrusanov

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Hi kevin, I've yet to really dig in to the full sonos stack yet. The wife agreed to let me go with sonos if she could simply turn it on and off from the wall and not have to hunt for the controller every time she wanted to play some music.

    So my needs were pretty simple:
    1) listen for keypad presses > invoke volume control on a zone.

    Additionally, since I am getting the DLT touchpads I want to be able to show on them the artist/track that is currently playing. That is going to be trickier so I am trying to decide if I should go so far as to write a UPnP listener, or just (gasp) poll every once in a while. :) Have you done anything on the sonos side that listens for track changes? I know it is somewhere in the AVTransport stuff IIRC.
     
    ievolve, Mar 23, 2010
    #19
  20. nickrusanov

    KevinH

    Joined:
    Aug 3, 2004
    Messages:
    171
    Likes Received:
    0
    Location:
    Yorkshire. UK
    Your wife's needs for on/off and volume control - as well as transport control should be easy to do via a DLT. Just FYI button presses don't really 'event' on C-Bus - it's more a case of looking at the command/reaction associated with the C-Bus group that they are linked to.

    Although it might seem desireable to try and get artist or trackname onto a DLT I think you will find that the label is too short for such use. Where this is more useful is for display within HomeGate or in my case on a C-Bus touch screen.

    Yes I have change events and complete track/artist/album art retrieval as well as playlist management but I am basing my implementation on other people's work (and code) in reverse engineering the non standard Sonos UPnP implementation . Polling is required for some aspects of the Sonos implementation and it is quite timing sensitive. My Sonos integration uses other PC based home automation software as the coordinator and into that is fed C-Bus events and it issues C-Bus updates/info back to the touch screen and DLT's etc.

    K
     
    Last edited by a moderator: Mar 23, 2010
    KevinH, Mar 23, 2010
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.