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

Posted (edited)

@jgab, Normaly if open ER5 QA it will show main.

After changing in erlib some QA's by edit opens with a blanc page and I need to click on main to modify a rule.

how to correct?

All ER5 QA's open and clicked on main changed >> saved >>no fix.

Question: can I use fa wall plug = not reachable or disconnect in a rule? if yes how?

Thanks

Edited by Sjakie
Posted

Dear all. 

I am using a similar rule "enable / disable"  elsewhere, and there it works as expected. However I try to trigger the rule enable / disable based on a GlobalVariable, but the few lines below do not work, and I do not spot my mistake. 

Any thoughts?

 

Please login or register to see this code.

 

The error I get: 

Please login or register to see this code.

Thanks for any insights... 

Jeroen 

  • Topic Author
  • Posted

    There is a bug where chaining of .enable() at the end of the rule definition don't return the rule,

    so 'Kitchen_rule' becomes nil, and it crashes later.

    It will work if you split it up and do a separate .enable().

    Please login or register to see this code.

     

    • Thanks 1
    • 2 weeks later...
    Posted

    Dear all, 

     

    Another question, trying to randomize my lights, it sort of works, but it doesn't in the sense that every day timer random_time_1 is scheduled for exactly the same random time. Do I have to (re)init something somewhere? 

    Thanks again for any thoughts!  Jeroen

     

    Example of what I tried: 

    Please login or register to see this code.

     

    Posted

    @jgab if I install a new ER5 QA how to get rid of the every 5 min ping?

    This does't work

    --[[var.i = 0 -- initialize ER variable
    rule("@@00:00:05 => i=i+1; log('ping: %s seconds',i*5)",{ruleTrue=false}) -- test rule, ping every 5 seconds
    ]]
  • Topic Author
  • Posted
    1 hour ago, Sjakie_ said:

    @jgab if I install a new ER5 QA how to get rid of the every 5 min ping?

    This does't work

    --[[var.i = 0 -- initialize ER variable
    rule("@@00:00:05 => i=i+1; log('ping: %s seconds',i*5)",{ruleTrue=false}) -- test rule, ping every 5 seconds
    ]]

    yes

  • Topic Author
  • Posted
    13 hours ago, JeroenL said:

    Dear all, 

     

    Another question, trying to randomize my lights, it sort of works, but it doesn't in the sense that every day timer random_time_1 is scheduled for exactly the same random time. Do I have to (re)init something somewhere? 

    Thanks again for any thoughts!  Jeroen

     

    Example of what I tried: 

    Please login or register to see this code.

     

    You shouldn't need to call _setupDailys here....

    The problem is that when the QA starts/restarts the number generator is initialized with the same starting values. 

    If you would let it run, without restarting the QA, for several days you would see different values.

    However, you can initialize the random generator with a "random" seed when the QA is started

    Please login or register to see this code.

     

    • Thanks 1
  • Topic Author
  • Posted
    On 1/29/2025 at 7:23 PM, JeroenL said:

    Dear all, 

     

    Another question, trying to randomize my lights, it sort of works, but it doesn't in the sense that every day timer random_time_1 is scheduled for exactly the same random time. Do I have to (re)init something somewhere? 

    Thanks again for any thoughts!  Gerona

     

    So, the rnd function takes either 1 argument or 2 arguments. With 2 arguments it returns a random value between the arguments/values.

    So, if you want a random time around 22:45, ex +/- 15 minutes you can write

    Please login or register to see this code.

    The @ rules will be scheduled every midnight (00:00) for the day to come. In this case it will compute 

    Please login or register to see this code.

    and schedule a timer for that time. Next midnight it will compute a new time.

    • Like 3

    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...