Blind control

Discussion in 'C-Bus Toolkit and C-Gate Software' started by dave240t, Jun 14, 2008.

  1. dave240t

    dave240t

    Joined:
    Apr 10, 2008
    Messages:
    26
    Likes Received:
    0
    I need some help in controling a motorised blind with one key

    I have seen this done with dynalite before and i want to know the best way to do this with c-bus

    I have a somfy controller controlling the blind so i have three c-bus groups addresses that operate the controller

    one for up
    one for down
    one for stop this turns both channels up and down on at the same time
    Stop also work by pressing either the up or down key in succession of the the last press ie if you press up then up again it stops

    What i want to happen is say i send the blind down with one key press i then was to press the key again i want the blind to stop. Then i want the next key press to send the blind up

    What would the easies way to achive this functionallty i hav a PAC on the job
     
    dave240t, Jun 14, 2008
    #1
  2. dave240t

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    Fortunately you have a PAC, as this is the simplest way to get one button control as you describe if you don't have a shutter relay. If you had a shutter relay this functionality is built in :)

    I suggest you code up a simple state machine in logic, and use Trigger Control messages from your key unit to switch between the states.. You would have 4 states. MovingUp, MovingDown, IdleUp, IdleDown. The purpose for two idle states is to know which direction you're going in next.

    The key unit sets the Trigger Group "BlindTrigger" to Action Selector "Active". To do this you make the key a scene key and and create a blank scene with Trigger Group "BlindTrigger" and Action Selector "Active". You also need to create another Action Selector "Waiting" with level zero... the code sets the Trigger Group back to this level once it's "seen" the Active level.

    The state machine would be something like (this is pseudocode)

    Code:
    if (BlindTrigger = Active) then
      begin
       BlindTrigger = Waiting; {reset trigger}
       if (BlindState = IdleUp) then
        begin
         Activate Up Relay;
         BlindState = MovingUp;
        end
       else if (BlindState = MovingUp) then
        begin
         Activate Stop;
         BlindState = IdleDown;
        end
       else if (BlindState = IdleDown) then
        begin
         Activate Down Relay;
         BlindState = MovingDown;
        end
       else {BlindState must be MovingDown}
        begin
         Activate Stop;
         BlindState = IdleUp;
        end
    end;
    
    Don't forget to initialise your state variable. You may also want to add some kind of timeout. The states "MovingUp", "MovingDown", "IdleUp", and "IdleDown" are constants.. so you also need to define these in your constants section. You could just as easily use integer values in the code, but using constants makes it a lot easier to follow.

    HTH.. let us know how you go.

    Nick
     
    NickD, Jun 16, 2008
    #2
  3. dave240t

    darrenblake

    Joined:
    Nov 1, 2004
    Messages:
    151
    Likes Received:
    0
    Location:
    Melbourne
    Or buy a C-Bus blind controller!!!
     
    darrenblake, Jun 18, 2008
    #3
  4. dave240t

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    There has got to be something said for keeping it simple....
     
    znelbok, Jun 18, 2008
    #4
  5. dave240t

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    I agree.. if you're at the stage where you haven't purchased any bits yet, the Shutter Relay is by far the simplest and cheapest option.

    However, since he said that he already has the Somfy controller and has already set up the relays to drive it, and had the PAC available.. this is how I would suggest it's done.

    Nick
     
    NickD, Jun 19, 2008
    #5
  6. dave240t

    dave240t

    Joined:
    Apr 10, 2008
    Messages:
    26
    Likes Received:
    0
    The blinds are wireless with dry contact closures thats why i need the pac and cannot use the blind relay.
     
    dave240t, Jul 8, 2008
    #6
  7. dave240t

    brodricj

    Joined:
    Mar 27, 2007
    Messages:
    117
    Likes Received:
    0
    Location:
    Perth
    If you can find one, I think I just bought the last two in the country (I had to do a stock transfer from Victoria to WA because the back-order list here was so long I'd be waiting for weeks).
     
    brodricj, Jul 10, 2008
    #7
  8. dave240t

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Shutter relay sales are running at about 3 x forecast quantities. This has created a big problem! More shipments are on their way.
     
    ashleigh, Jul 11, 2008
    #8
  9. dave240t

    Lucky555

    Joined:
    Aug 13, 2007
    Messages:
    229
    Likes Received:
    0
    Get the person who provided the forecast and bash them to within an inch of their life.....


    Only joking... :D
     
    Lucky555, Jul 12, 2008
    #9
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.