Cbus external loggin

Discussion in 'C-Bus Toolkit and C-Gate Software' started by [email protected], Apr 20, 2007.

  1. arnis@nyherji.is

    [email protected]

    Joined:
    Oct 30, 2004
    Messages:
    43
    Likes Received:
    0
    Location:
    Iceland
    Hi

    I want to log how long each day a cbus channel ( relay and dimmer)

    possibly with MRTG or something similar

    i.e. I want to be able to display the resaults on a simple webpage
    or in homegate

    anyone that has done anything like that before ?
     
    [email protected], Apr 20, 2007
    #1
  2. arnis@nyherji.is

    PSC

    Joined:
    Aug 3, 2004
    Messages:
    626
    Likes Received:
    0
    Location:
    Brisbane, Australia
    Why not just write some code in the Homegate logic engine something along the lines of -

    once (GetCBusState("NETWORK 1", "Lighting", "CHANNEL X") = ON) then
    begin
    TimerStart(CHANNEL X TIMER);
    end;

    once (GetCBusState("NETWORK 1", "Lighting", "CHANNEL X") = OFF) then
    begin
    LogMessage('CHANNEL X =', TimerTime(CHANNEL X TIMER));
    TimerStop(CHANNEL X TIMER);
    end;

    This will write how long 'channel x' has been on for in seconds to the Homegate log file.

    Setup the limit log file size in Homegate so it starts a new file every day at midnight.

    Unfortunately you will have to do a daily search for 'Channel X =' in the log file and add up all the seconds as each time 'channel x' turns off the counter resets.

    You will also need to setup your timers in the 'constant' module of the logic engine.

    Maybe Darren or someone else can suggust a better way...
     
    PSC, Apr 20, 2007
    #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.