Help with a script

Discussion in 'C-Bus Automation Controllers' started by GlenF, Jul 6, 2019.

  1. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Hi all,
    New to scripting and would appreciate some help (PS - love the SHAC, has been easy to setup and works great for me)
    I am trying to run my pool filters for a variable amount of time depending on the time of the year. I have set up a scheduled script with the following:

    upload_2019-7-6_9-47-23.png

    and added the following script but nothing seems to happen. Any suggestions on where I am going wrong?

    month = tonumber(os.date('%m'))
    if month == 12 or month == 1 or month == 2 then
    PulseCBusLevel(0, 56, 13, 255, 0, 25200, 0) -- Summer
    elseif month == 6 or month == 7 or month == 8 then
    PulseCBusLevel(0, 56, 13, 255, 0, 10800, 0) -- Winter 3 hrs
    else
    PulseCBusLevel(0, 56, 13, 255, 0, 18000, 0) -- Spring / Autumn
    end


    Thanks
    Glen
     
    Last edited: Jul 6, 2019
    GlenF, Jul 6, 2019
    #1
  2. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Ok, replying to my own post which seems weird but for anyone interested, thought I would provide an update.

    It appears my script was fine but I think I might have uncovered a bug in the SHAC software. I am programming this remotely as it is at another house so I thought nothing was happening. Apparently, it was all working fine but for some reason, when the cbus address is triggered from the SHAC, the status is not updated in the SHAC software visualisation. The next day after the 0800 trigger, I checked my Ctouch and it indicated the filter was on, the power monitor app showed the power usage and the Cgate log showed the address being turned on and off at the programmed time.

    The strange thing is the status button did not update inside the visualisation, even after refresh and logging out and in. Once I pressed the button it turned on (although actually already on) and then off but the SHAC triggered elements did not trigger. (cgate registered all)

    Not sure if I am missing something here, (and keen for someone else to try this) but it does seem like a fault that the system works but does not update its status.


    Glen
     
    GlenF, Jul 8, 2019
    #2
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.