Logic behaviour in PAC/PICED.

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Ingo, Jul 4, 2015.

  1. Ingo

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Guys,

    I have had a strange problem with a logic routine which bugged me for a long time now. I finally tracked this down to a behavioural difference between what is configured and what is actually happening.

    Some quick facts: I have a Comfort system I use for security and a PAC to do all my logic stuff. Basically, in this case, I monitor for a PIR Zone trigger and then set a light to a saved level. So, I switch my kitchen light On and then save the value in a variable. Over time this level reduces by 50% and if I trigger the Scullery PIR I want the Kitchen to go back to the saved level at the beginning EG 100%

    Here is my logic:
    Code:
    once GetLightingState("Group 117 - Kitchen Downlighters") then
    begin
      SavedLevel := GetLightingLevel("Group 117 - Kitchen Downlighters");    {Initial Light Level }
    end;
    The above just saves the level of the kitchen lights for later use.

    Here comes the strange part. If I walk into the kitchen I switch the lights on from the wall switch or PICED, No problem. If I then walk into the scullery the PAC in the background sends the saved value, 100% in this case, to the kitchen lights, no problem.

    When I do the same from the 'outside' of the Cbus network EG I switch the light on from Comfort then the scenario changes. What happens is that as I walk into the scullery the kitchen light turns 'almost' off. Usually a level between 5 and 15.

    I summised that the savedlevel of the logic routine must be incorrect and I then looked at the PICED log to see what is the difference between the wall switch, PICED and Comfort. From the wall switch and PICED the command sent is a 'Switch On' command even though PICED is configured to Ramp the light over 4s. If I look at the log entry for the Comfort command I see a Ramp over 4s command. This proves my SavedValue is saving a value still on it's way to the final ramp value.

    Code:
    2015/07/05 00:06:41  C-Bus Tx : Set Group 117 - Kitchen Downlighters On (User Click)
    
    Code:
    2015/07/05 00:08:24  C-Bus Rx : Ramp Group 117 - Kitchen Downlighters On over 4s (unit 18)
    2015/07/05 00:08:27  C-Bus Rx : Ramp Group 117 - Kitchen Downlighters Off over 4s (unit 18)
    
    My question is: Why does PICED send an On command even though a Ramp over 4s is configured for that object? AND would a delay(4) catch the final Ramp value for my SavedValue in the logic example above?

    Thanks,
    Ingo
     

    Attached Files:

    Ingo, Jul 4, 2015
    #1
  2. Ingo

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    Hi Ingo,

    A few things, the button you have configured in PICED is as a dimmer. That means that with a long press it will dim up/down over to 0/100 over 4 seconds or until you stop pressing it, whichever is sooner. If you do a short press it will toggle the light off/on IMMEDIATELY. That is what you are seeing. If you wanted to have it just toggle and ramp over time then I would just use on/off with a ramp rate.

    In terms of your logic, try using GetCBusTargetLevel instead.

    Not sure what you are trying to do exactly if mostly what you are recording is 100% based on what you have described, but doesn't really matter hopefully what I have said makes sense and helps!

    J
     
    jboer, Jul 5, 2015
    #2
  3. Ingo

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Hi J,

    I was under the impression that when I short press the button it would DimUp to <LastLevel>, which is usually 100% in my case, over 4s set in PICED. I agree if you long press it would DimUp|Down over the 4s specified. That said, I tested changing from RampUp to SwitchOn and that captured the final value of EG 100%. I will test the GetCBusTargetLevel as you suggested, I think it's a cleaner solution.

    So here is what it actually does when working:

    The missus walks into the kitchen and switches the light on at 100% While movement is detected in the kitchen a timer continuously resets to 30 minutes. When her favourite soapie starts on the TV she walks to the living room and the 30 minute timer starts to count down. At 15 minutes the lights dim to 50% of the original value to remind here to get back to the kitchen :) If she ignores it then 15 minutes later the light goes off.

    If however she gets up from the couch and walks back to the kitchen the level restores to the original level once movement is detected and the timer resets to 30 minutes.

    I also have a trigger in the washing area, if movement is detected there then the kitchen also goes back to the original level. It works quite nice now that the strange bug I had in my logic has been sorted.

    Ingo
     
    Ingo, Jul 5, 2015
    #3
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.