View Poll Results: Is this a useful exercise ?

Voters
9. You may not vote on this poll
  • Yes - I would be / am interested

    9 100.00%
  • No - Forget it

    0 0%
Page 1 of 10 123 ... LastLast
Results 1 to 10 of 91

Thread: Home Automation using Girder / Net Remote and C-Bus

  1. #1

    Default Home Automation using Girder / Net Remote and C-Bus

    Hope this will be of interest to other members and will maybe provide a mechanism for me gaining some help along the way when I get stuck (which will be inevitable)!

    Anyway, I have quite an ambitious project ahead of me as I am looking to use Girder 4 & Net Remote to form the heart of my House Automation Project.
    Basically I have a C-Bus controller system (which is great by the way) that will take control of all lights, blinds & sensors. I then have an Extron Matrix switcher for juggling the surround sound, the dual SKY+ boxes and music (music will be held on a networked PC). All output from the Matrix switcher can be pumped out to any room in the house. Finally I have a number of IP cameras placed both within and outwith the house.

    I am an electronic hobbiest who has a good knowledge of programming (VB and its variants) but never done C programming. The whole project is being done by myself in my spare time so it projected to take me the rest of the year.

    My plan is to post progress on this board and ask for help when required.

    Regards

    Gus

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Hi Gus,

    I have looked at the CBUS protocol in the past and it should be fairly easy to do with the serial plugin -> all in Lua. If you know VB it will be easy for you to do Lua.

    We have a serial extension for the Extron. It might need some modification depending on the model.

    Let us know how we can help out..

  3. #3

    Default CBUS Connection - Global Variables in LUA

    From my knowledge of C-Bus it is better to use C-Gate as the mechanism to send any messages through. Based on that I have used the GIP Plug-in and do seem to be getting somewhere but have a problem / question.

    Here is my initial code:

    -- CallBack Function
    function CGateCallBack(uData,uReturnCode)

    if ( uReturnCode == gip.CONNECTIONCLOSED ) then
    print("Connection Closed")
    return
    end

    if ( uReturnCode == gip.CONNECTIONESTABLISHED ) then
    if ( uData == 0 ) then
    print("New Connection")
    else
    print("New Connection Failed: ", uData)
    end

    return
    end

    print(uData)

    end

    --Start of Main Code
    --Open C-Gate Session & Register Callback
    uSession = gip.Open('127.0.0.1',20023)
    uSession:Callback(2, '\r\n', 1000, CGateCallBack)


    -- Initialise Session
    uSession:Write('PROJECT DIR\n')
    uSession:Write('PROJECT LOAD CBUSNET\n')
    uSession:Write('PROJECT USE CBUSNET\n')
    uSession:Write('PROJECT START\n')
    uSession:Write('NET OPEN 254\n')
    uSession:Write('TREE 254\n')


    This sets up the CBUS Project ready for commands to be sent. What I want to be able to do is then allow Actions to send a simple write command.

    e.g. uSession.Write('RAMP 254/56/1 50%').

    This would switch on a light to 50% of intensity. To make this work I need to be able to hold the uSession variable and call it from various different places (i.e. the script that sits on the back of the Action.

    Finally I would have a function that closes the project and clears the uSession variable.

    Can someone help please ?

    Cheers

    Gus

  4. #4
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    disclaimer, just did a nice hike out in the mountains and I am a little tired :-)

    if uSession is not declared local then it should be available from anywhere in Girder. You can verify this in the Variable inspector.
    Ron
    No support through PM

  5. #5

    Default Global Variables

    9pm at night here in the UK so I guess you are a few hours back. Sounds like you had a good long walk (and I assume in the sun)......

    What a platform - I am starting to see the power (and flexibility) it has and am getting a bit more confident. I even have the event messages from the whole C-Bus system now feeding back into the console by reading port 20025 and setting up a similar CallBack.

    And yes, it was a missing \n that was causing my problem.

    Onwards & upwards

    Cheers for now

    Gus

  6. #6
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    Cool! If you have the message feeding into the console, you can even feed them into Girder's event system!

    Code:
    gir.TriggerEventEx([eventstring], [eventdevice], [keymodifier], [payload] ... )
    It was a little overcast here in CA, which is good. Hiking out in the mountains during summer is... HOT.
    Ron
    No support through PM

  7. #7

    Default Finding out Device No for AddEventhandler Function

    Moving onto using the AddEventHandler, how do I find out the device No. I am using an MCE remote control at the moment ?

    Cheers

    Gus

  8. #8
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    Plugin page on the settings dialog. Select the MCE plugin it will list the number on the left.
    Ron
    No support through PM

  9. #9

    Default Select Case Statement

    Thanks Ron - That has my AddEventHandler picking up all the commands from the remote so that I can programatically issue relevant commands to the C-GATE Server. There are a lot of commands and I wanted to use the structure

    Select Case CommandIssued
    Case "Up"
    Send Increase Brightness Command

    Case "Down"
    Send Decrease Brightness Command

    End Select

    Is this possible or must I resort to an If / Else If structure ?

    Cheers

    Gus

  10. #10

    Default String Manipulation

    How good is LUA for manipulating strings (e.g. Len, RIGHT, LEFT, INSTR etc). If it can do it where would I look for the details ?

    Cheers

    Gus

Page 1 of 10 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •