Comfort Home Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register
Comfort Home Automation/ Security System Forums > Third Party (interfacing to Comfort) > CBus > Replicate CBus dimming function with a press switch

Replicate CBus dimming function with a press switch
 Moderated by: admin
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Monday Jun 25th, 2012 07:58 am
   PM  Quote  Reply 
1st Post
richylloyd
Member
 

Joined: Monday Aug 29th, 2011
Location: Woking, United Kingdom
Posts: 17
Status: 
Offline

  back to top

I have a number of spare RIO inputs that I am trying to use as individual light switches (make sno sense to purchase expensive CBUS switches for this).

It is simple code to switch the lights on and off, however, I would like to replicate the normal CBUS dimming function.
Has anyone got the code required for this?

I have tried the following code, but it does not always respond as expected.
I think the issue lies with the StopRamp function as, when triggered, the counters are either 0 or 255 and NOT the current dimmer level.

SwitchPress:
Do NullResponse After 1 Seconds Using Timer01
If Flag Flag01 = 0 Then
    Cbus Ramp4 UCM02 1 255
    Set Flag Flag01
Else
    Cbus Ramp4 UCM02 1 0
    Clear Flag Flag01
End If


SwitchRelease:
If Timer Timer01 = 0 Then
    Cbus StopRamp UCM02 1
Else
    If Counter Counter001 > 10 Then
        Cbus RampInst UCM02 1 0
        Clear Flag Flag01 ! next ramp function will be down
    Else
        Cbus RampInst UCM02 1 255
        Set Flag Flag01 ! next ramp function will be up
    End If
End If



 Posted: Monday Jul 23rd, 2012 02:47 pm
   PM  Quote  Reply 
2nd Post
ndh
Comfort Installers
 

Joined: Sunday Apr 30th, 2006
Location: Wallington, United Kingdom
Posts: 278
Status: 
Offline

  back to top

This is triggered by presses of a single Comfort Remote Scene button:

Ramp On
Stop
Off

But other variants possible of course

If Counter Counter000 = 0 Then
If Counter Counter104 = 0 Then
Cbus Ramp12 UCM02 104 255 ! On (Ramp)
Increment Counter000 ! Counter = 1
End If
Else
If Counter Counter000 = 1 Then
Cbus StopRamp UCM02 104 ! Stop
Increment Counter000 ! Counter = 2
Else
Cbus RampInst UCM02 104 0 ! Off
Set Counter000 = 0 ! Ready for Next On
End If
End If



 Current time is 05:42 am
Comfort Home Automation/ Security System Forums > Third Party (interfacing to Comfort) > CBus > Replicate CBus dimming function with a press switch
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems