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
  • 1 hour ago, FrankT said:

    Thank you Jan, now all my flows are working in V3. GREAT!  I have no experience in JavaScript, but better in ancient Fortran

    /F

    Did my first programming in Fortran, Forth, Algol, Simula, Pascal - shows my age too ?

    But it's all the same... ;)

    3 minutes ago, domin12 said:

    @jgab One more question

    i have rule :

    rule([[{945,1057}:breached & 20:00..23:58 =>||744:isOff >> log('..lights on...'); 744:on]])  

    which does not work because of the range of hours, how to improve it to work properly?

    Eh, what's the problem with the range of the hours?

    Link to comment
    Share on other sites

    4 minuty temu, jgab napisał:

    Eh, what's the problem with the range of the hours?

    with the range of hours the rule does not start, without, works normally, I thought something had changed

    Link to comment
    Share on other sites

  • Topic Author
  • 7 minutes ago, domin12 said:

    with the range of hours the rule does not start, without, works normally, I thought something had changed

    Works well for me. If you are testing it now it should be within the range? (after 20.00 in Poland).

    If {945,1057} is already breached when you start the scene you won't get a trigger. try adding .start() after (to make the rule run once when you start the scene)

    Please login or register to see this code.

     

    Is your HC2 clock strange?

     

    Btw, a trick to see what triggers a rule react on is to do

    Please login or register to see this code.

    only works for rules with '=>'.

    Edited by jgab
    Link to comment
    Share on other sites

    2 minuty temu, jgab napisał:

    Works well for me. If you are testing it now it should be within the range? (after 20.00 in Poland).

    If {945,1057} is already breached when you start the scene you won't get a trigger. try adding .start() after (to make the rule run once when you start the scene)

    Please login or register to see this code.

     

    Is your HC2 clock strange?

     Clock is ok :)  checked it at the begining..... adding start() after rule not helped ....... will restart HC2

     

    Link to comment
    Share on other sites

    36 minut temu, jgab napisał:

    Works well for me. If you are testing it now it should be within the range? (after 20.00 in Poland).

    If {945,1057} is already breached when you start the scene you won't get a trigger. try adding .start() after (to make the rule run once when you start the scene)

    Please login or register to see this code.

     

    Is your HC2 clock strange?

     

    Btw, a trick to see what triggers a rule react on is to do

    Please login or register to see this code.

    only works for rules with '=>'.

    hmmm... still does not work, this what i have in debug windows seems to be a little strange........

    Please login or register to see this image.

    /monthly_2019_07/image.png.ca9c7e6fa49e8e78a24d6a4c2e0d3dfa.png" />

    Link to comment
    Share on other sites

  • Topic Author
  • 13 minutes ago, domin12 said:

    hmmm... still does not work, this what i have in debug windows seems to be a little strange........

    Please login or register to see this link.

    Seems to be something strange (at least noisy) with the auto-reschedule of daylies... I think it's harmless but I have pushed a B18 where I disabled it for now. Will have look at it tomorrow.

    Link to comment
    Share on other sites

    Hello Jan,

    Both rules does not work anyore, gordijn= curtain does not open or close

      --Gordijnen dicht-----curtain close--

      Rule.eval("once(oprit.luxsensor:lux < 100 ) => post(#eveningMsg)")
          Rule.eval("#eveningMsg & once(16:00..23:15,n/24:00) => remote(_myNodeRed,#speak{data='de gordijnen worden gesloten'}) ; wait(00:00:10) ; woonkamer.gordijnvoor:value=0 ; wait(00:00:8) ; woonkamer.gordijnoprit:value=0 ; wait(00:00:07) ; woonkamer.gordijnzijkant:close ;  wait(00:00:05) ; eetkamer.gordijnzijkant:close; log('Gordijnen sluiten')")  
          --XXXXX    Rule.eval(" woonkamer.gordijnvoor:value==0  & eetkamer.deur:safe => remote(_myNodeRed,#speak{data='het gordijnachter wordt gesloten'}); wait(00:00:15) ; eetkamer.gordijnachter:close; log('Serre deur dicht gordijn sluiten')")
         Rule.eval(" woonkamer.gordijnvoor:open  & eetkamer.deur:safe => remote(_myNodeRed,#speak{data='het gordijnachter wordt gesloten'}); wait(00:00:15) ; eetkamer.gordijnachter:close; log('Serre deur dicht gordijn sluiten')")
        
     --Gordijnen openen---curtain open--
     
          Rule.eval("once(oprit.luxsensor:lux > 105)=> post(#morningMsg)")
           Rule.eval("@sunrise => post(#morningMsg)")
         Rule.eval("#morningMsg & once(05:00..09:15,n/10:00) =>  remote(_myNodeRed,#speak{data='de gordijnen worden geopend'}); wait(00:00:15); woonkamer.gordijnvoor:open; wait(00:00:08);woonkamer.gordijnzijkant:open; wait(00:00:05);   woonkamer.gordijnoprit:open; wait(00:00:06);  eetkamer.gordijnachter:open; wait(00:00:05);  eetkamer.gordijnzijkant:value=100; log('Gordijnen openen')")         
         Rule.eval("@sunrise =>  remote(_myNodeRed,#speak{data='de gordijnen worden geopend'}); wait(00:00:15); woonkamer.gordijnvoor:open; wait(00:00:08);woonkamer.gordijnzijkant:open; wait(00:00:05);   woonkamer.gordijnoprit:open; wait(00:00:06);  eetkamer.gordijnachter:open; wait(00:00:05);  eetkamer.gordijnzijkant:value=100; log('Gordijnen openen')")         

     

    Link to comment
    Share on other sites

  • Topic Author
  • 8 hours ago, Sjakie said:

    Hello Jan,

    Both rules does not work anyore, gordijn= curtain does not open or close

      --Gordijnen dicht-----curtain close--

      Rule.eval("once(oprit.luxsensor:lux < 100 ) => post(#eveningMsg)")
          Rule.eval("#eveningMsg & once(16:00..23:15,n/24:00) => remote(_myNodeRed,#speak{data='de gordijnen worden gesloten'}) ; wait(00:00:10) ; woonkamer.gordijnvoor:value=0 ; wait(00:00:8) ; woonkamer.gordijnoprit:value=0 ; wait(00:00:07) ; woonkamer.gordijnzijkant:close ;  wait(00:00:05) ; eetkamer.gordijnzijkant:close; log('Gordijnen sluiten')")  
          --XXXXX    Rule.eval(" woonkamer.gordijnvoor:value==0  & eetkamer.deur:safe => remote(_myNodeRed,#speak{data='het gordijnachter wordt gesloten'}); wait(00:00:15) ; eetkamer.gordijnachter:close; log('Serre deur dicht gordijn sluiten')")
         Rule.eval(" woonkamer.gordijnvoor:open  & eetkamer.deur:safe => remote(_myNodeRed,#speak{data='het gordijnachter wordt gesloten'}); wait(00:00:15) ; eetkamer.gordijnachter:close; log('Serre deur dicht gordijn sluiten')")
        
     --Gordijnen openen---curtain open--
     
          Rule.eval("once(oprit.luxsensor:lux > 105)=> post(#morningMsg)")
           Rule.eval("@sunrise => post(#morningMsg)")
         Rule.eval("#morningMsg & once(05:00..09:15,n/10:00) =>  remote(_myNodeRed,#speak{data='de gordijnen worden geopend'}); wait(00:00:15); woonkamer.gordijnvoor:open; wait(00:00:08);woonkamer.gordijnzijkant:open; wait(00:00:05);   woonkamer.gordijnoprit:open; wait(00:00:06);  eetkamer.gordijnachter:open; wait(00:00:05);  eetkamer.gordijnzijkant:value=100; log('Gordijnen openen')")         
         Rule.eval("@sunrise =>  remote(_myNodeRed,#speak{data='de gordijnen worden geopend'}); wait(00:00:15); woonkamer.gordijnvoor:open; wait(00:00:08);woonkamer.gordijnzijkant:open; wait(00:00:05);   woonkamer.gordijnoprit:open; wait(00:00:06);  eetkamer.gordijnachter:open; wait(00:00:05);  eetkamer.gordijnzijkant:value=100; log('Gordijnen openen')")         

     

     

    Oh, that was a bug! (actually 2 bugs)

    This may have been the problem for @domin12 too,

    Pushed B19

    • Thanks 1
    Link to comment
    Share on other sites

    What should i change here with v3?

    Please login or register to see this code.

    Please login or register to see this code.

    Event arrive but then nothing.

    Link to comment
    Share on other sites

    Godzinę temu, jgab napisał:

    Oh, that was a bug! (actually 2 bugs)

    This may have been the problem for @domin12 too,

    Pushed B19

    It's working now, great work, thanks again

    Link to comment
    Share on other sites

  • Topic Author
  • 28 minutes ago, jompa68 said:

    What should i change here with v3?

    Please login or register to see this code.

    Please login or register to see this code.

    Event arrive but then nothing.

    Uploaded with a fix for that, B20

    Link to comment
    Share on other sites

    Good morning Jan,

    Is this wrong in version 3? Lights does not switch off:

     

     Rule.eval("23:00..03:00 & hoofdslaapkamer.ladertelefoonsjaak:isOn  => post(#nightlightsOff); remote(1627,#nightlightsOff); log('TV uit indien hij 5 min op standbye staat')")
         
                 Rule.eval("#nightlightsOff => verlkeuken:off; verlhal:off ; huelinks:off ; wait(00:00:05) ; huerechts:off ; wait(00:00:05);  huetelevisie:off ; wait(00:00:05) ; huediversen:off ;eetkamer.lampplafond:off; log('Alle hue lichten uit bij naar bed gaan')")
       

    Jonny/Jan,

    My Alexa works with the same rule from you, I just saw the debug when she witched TV on

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, Sjakie said:

    Good morning Jan,

    Is this wrong in version 3? Lights does not switch off:

     

     Rule.eval("23:00..03:00 & hoofdslaapkamer.ladertelefoonsjaak:isOn  => post(#nightlightsOff); remote(1627,#nightlightsOff); log('TV uit indien hij 5 min op standbye staat')")
         
                 Rule.eval("#nightlightsOff => verlkeuken:off; verlhal:off ; huelinks:off ; wait(00:00:05) ; huerechts:off ; wait(00:00:05);  huetelevisie:off ; wait(00:00:05) ; huediversen:off ;eetkamer.lampplafond:off; log('Alle hue lichten uit bij naar bed gaan')")

     

    No, that should work without problem. (just tested)

    Are some of the lights Hue lights?

    Do you get any logs that it tries to turn them off?

    Anyway, try the latest version.

    Link to comment
    Share on other sites

    Yep Hue lights.

    If I do Ruile.eval("woonkamer.test:isOn=> huediversen:off") it works same sentence as in my origianl rule.

    Will update to latest version

    Link to comment
    Share on other sites

    Just tried

         rule("huelinks={ woonkamer.spotbeeldlinks , woonkamer.spotschilderijlinks , woonkamer.spotkastlinks }")
              huelinks does not work in:

     Rule.eval("woonkamer.test:isOff => eetkamer.lampplafond:off; woonkamer.spotschilderijrechts:off; huelinks:off")
     if I do a separate light such as woonkamer.spotschilderijrechts it works

    Link to comment
    Share on other sites

  • Topic Author
  • 24 minutes ago, Sjakie said:

    Just tried

         rule("huelinks={ woonkamer.spotbeeldlinks , woonkamer.spotschilderijlinks , woonkamer.spotkastlinks }")
              huelinks does not work in:

     Rule.eval("woonkamer.test:isOff => eetkamer.lampplafond:off; woonkamer.spotschilderijrechts:off; huelinks:off")
     if I do a separate light such as woonkamer.spotschilderijrechts it works

     

    It works for my hue lights to do that.

    Something that can cause this behaviour is if woonkamer.spotbeeldlinks is nil. 

    huelinks:off will loop over the list but will stop if an element (deviceID) is nil. 

    In the next release I will be more strict and give an error if there is a nil in a list.

    Link to comment
    Share on other sites

    @jgab just put in the new ER 3.0 and i get stuck on this error message below.

     

    code

    Please login or register to see this code.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, sonnyboy said:

    @jgab just put in the new ER 3.0 and i get stuck on this error message below.

     

    code

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

    The Lua functions osDate and osTime has become os.date and os.time (inside ER rules they are osdate and ostime)

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 21 minutes ago, jgab said:

     

    The Lua functions osDate and osTime has become os.date and os.time (inside ER rules they are osdate and ostime)

    Please login or register to see this code.

     

     

    Actually, setting a global once per day is very cheap and it will not generate a trigger to other scenes if it is set to the same value.

    So, a bit simpler to set it every night. Then you can add the .start() command to run the rule when the scene starts up too.

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

     

    Actually, setting a global once per day is very cheap and it will not generate a trigger to other scenes if it is set to the same value.

    So, a bit simpler to set it every night. Then you can add the .start() command to run the rule when the scene starts up too.

    Please login or register to see this code.

     

    Thanks, now that works :)

    Will se when i got home if everything works :)

    only got Earth Hour left but its time to fix that.

     

    Edited by sonnyboy
    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...