Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

  • Topic Author
  • 3 hours ago, jgab said:

    I'm not using the HC3 for alarms currently, but this could be one way to use it.

    Set up alarm zones (partitions) with the UI.

    The 'alarmPartitionsSafe' functions looks through the devices and post an 'ok' event if all devices are safe, otherwise post an 'not ok' event

    The 'partitions' argument can either be nil meaning all partitions or a table of the partitions that should be checked.

     

    The switch:on rule calls the alarmPartitionsSafe function and it will generate events of type #alarmCheck that we have rules for.

    The first says that everything is ok and we go ahead and arm the house.

    The second rule triggers if any device was unsafe and sends a message to close the device in question.

    The code could of course be improved and adapted to specific circumstances.

     

    The 'tag' argument is so that we can have many switches or rules for arming different parts of the house. The 'tag' allow us to tell the #alarmCheck rules apart.

     

    The problem with alarms on the HC3 currently is that there is no event when a user arm a parition/zone with the UI. We only get an event after the delay and when the partition is actually armed.

    One way to look for that is to have a loop that watches the partitions and if they are armed and starting to count down.

    Please login or register to see this code.

    This function will check every other second if a partition is armed and in that case post an event #partitionArmed{id=id,time=timeLeft}

    If enough delay has been set there is the opportunity to call 'alarmPartitionsSafe' like in the previous example and disarm if not all sensors are safe.

    Which Hue QA are you using?

    Link to comment
    Share on other sites

  • Topic Author
  • Sorry, my answer got merged with another post.

     

    Which QA are you using? Is it mine?

    Is it always happening or sometimes?

    Do you have many Hue QAs running? or a Hue VD running on the HC2?

    The problem is that if several VDs/QAs are polling the Hue bridge at the same time there may be issues.

    Link to comment
    Share on other sites

    Jan,

    HC2 only the excelent stuff of Jgab  No VD's for light.

    HC2 only problem is with one light doest switch off >>I can live with it if I migrate soon to HC3.

    HC3 is the problem due to that everything is back now on HC2.

    Yesterday I started (again) to move my toilet scene with HUE to HC3 >>>no issues till now light on/off.

    All living room light doest switch off aswell with post, time (in this case only a piece of rock will do it!)

    I deleted all the HUE related QA's

    I installed petrkl12 his QA and I was able to switch on/off this morning all the living room HUE's in a row with 2 seconds between each light. To see what will happens I need more time to test. Today I will make a scene that it will switch on/off repeatly during an hour.

    If thats working I will switch bath room to HC3

    Hehe takes me a long time to get it working.

    A big advantage of HC3 is th eeasy and fast way to include devices its a bigg hasle to reinclude back in HC2.

    I will keep, you posted

    Thanks for the support,

    //Sjakie

     

    Link to comment
    Share on other sites

  • Topic Author
  • Posted a v0.5fix9

    Support for dimming lights with curves are back from ER3. The algorithms are from krikroff's Dawn Simulator lua engine.

    The curves supported are

    Please login or register to see this attachment.

     Note. name of curves given to function always start with lowercase letter, ex. "inOutQuad".

    Please login or register to see this code.

    Ex.

    Please login or register to see this code.

    This will "dim" light with id 66 during 60s, direction "up", change value every 1s, using curve "linear", start with value 0 and end with value 99.

    The device needs to support 'setValue' which dimmable devices do.

    start/stop is always low/high and direction is chosen by parameter 'dir'.

    Ex. start dimming up a light an hour before sunrise

    Please login or register to see this code.

    Ex. start dimming down a light an hour before sunset

    Please login or register to see this code.

     

    The light will stop its dimming routine if the value is changed by some other means (switch, script etc)

    Link to comment
    Share on other sites

    33 minutes ago, jgab said:

    Posted a v0.5fix9

    Support for dimming lights with curves are back from ER3. The algorithms are from krikroff's Dawn Simulator lua engine.

    The curves supported are

    Please login or register to see this attachment.

     Note. name of curves given to function always start with lowercase letter, ex. "inOutQuad".

    Please login or register to see this code.

    Ex.

    Please login or register to see this code.

    This will "dim" light with id 66 during 60s, direction "up", change value every 1s, using curve "linear", start with value 0 and end with value 99.

    The device needs to support 'setValue' which dimmable devices do.

    start/stop is always low/high and direction is chosen by parameter 'dir'.

    Ex. start dimming up a light an hour before sunrise

    Please login or register to see this code.

    Ex. start dimming down a light an hour before sunset

    Please login or register to see this code.

     

    The light will stop its dimming routine if the value is changed by some other means (switch, script etc)

     

     

    If you use this, is it possible to use the curve mentioned in the place where the LED bulb or LED driver connected to the FIBARO dimmer is installed??

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, Earybeongbeong7 said:

    If you use this, is it possible to use the curve mentioned in the place where the LED bulb or LED driver connected to the FIBARO dimmer is installed??

    So the code uses fibaro.call(deviceId,"setValue",value) to change the dim value. If your device support that it should work.

    Edited by jgab
    Link to comment
    Share on other sites

    3 minutes ago, jgab said:

    So the code uses fibaro.call(deviceId,"setValue",value) to change the dim value. If your device support that it should work.

     

    By device, do you mean an LED bulb or an LED driver?

    Link to comment
    Share on other sites

  • Topic Author
  • 23 minutes ago, Earybeongbeong7 said:

    By device, do you mean an LED bulb or an LED driver?

    Anything that responds to fibaro.call(deviceId,"setValue",value)...

    Link to comment
    Share on other sites

    Jan,

    If I groupe the 10 pieces of HUE"s in  {}  the command switch off  is in executing in between switch on see debug.

    All other combinations split group in 3-4-or 5 lamps wast functioning right.

    Now I have switch on/off and between each lamp 1 sec delay 

    50 sec after the  last lamp switched on break

    Cycle time 1 min 50 

    Now it work like a charm hehe

    Petrkl his QA I am using

    CPU runs if HUE is switching 95%

    CPU runs in between 5-15%

     

    Question is this a normal behaviour for HUE?

    My HC2 also had some delay if all lights should light on.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • Added video in ER4 post that demonstrates how to download/install and get going.

     

    Link to comment
    Share on other sites

  • Topic Author
  • Just now, Sjakie said:

    Jan,

    How to do

    Rule.eval([[#autostart
    in HC3?
     
    //Sjakie

    When the HC3 starts up, or when the QA starts and restarts?

    Link to comment
    Share on other sites

    Jan,

    sorry I use it to get after saving my QA or to reset some stuff or to present some usefull information.

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 41 minutes ago, Sjakie said:

    Jan, sorry I use it to get after saving my QA or to reset some stuff or to present some usefull information.

    There are different ways to do that.

    When the QA starts up I post an event   {type='%startup%'} that you can trigger on. You need to write it this way as #%startup% is not a valid syntax.

    Ex.

    Please login or register to see this code.

    The other way is to understand the function QuickApp:main() is only called once when the QA starts. It defines the rules and then exits. It means that you can do things that should only run once in the main() function.

    Ex.

    function QuickApp:main()

     

       rule("#myStartup => log('START')")

       :

       :

       rule("post(#myStartup,1) -- post event to run my startup rule

    end

    Link to comment
    Share on other sites

    Jan,

    the first rule is okay

    This doest show anything

    function QuickApp:main()
       rule("#myStartup => log('Temperatuur badKamer: %s ℃',badKamer.pirTemp:value)")
       rule("post(#myStartup,1)"-- post event to run my startup rule
    end
     
    Is there someting as I use in HC2
    Rule.eval([[#autostart => post(#bathRoomInfo)]])
     
    //Sjakie
    Link to comment
    Share on other sites

    After update

    Error like below

    The applied version is v0.5fix9

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, minsad79 said:

    After update

    Error like below

    The applied version is v0.5fix9

    Please login or register to see this attachment.

     

    getIPaddress() was broken. Fixed and pushed v05fix10

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...