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
  • I have pushed v0.98 with some new logging stuff.

    We can add .print() to a rule defined and it will now print some more info

    Ex.

    rule("754:isOn & $YY => log('C')").print()

    will print out the rule and list the triggers that is used to trigger the rule.

    After each trigger listed there is the time the rule was last triggered with that specific trigger.

    Please login or register to see this attachment.

    In these neither the device 754 or the global 'YY' have triggered the rule yet.

    If you have a 'daily' rule like @sunset it will list the time and the last time it was invoked.

     

    I have added this at the end of my main()

    Please login or register to see this code.

    It will print out a custom startup banner and then list all the rules and then some info

    Then it adds an hourly task that prints the info again.

    Please login or register to see this attachment.

    The colors for banners, rules and info can be controlled with setting these variables inside main()

    Please login or register to see this code.

    Note, that the custom banner is set to blue explicitly with the printBanner command.

    • Thanks 2
    Link to comment
    Share on other sites

    Jan, this looks awesome! Give a lot more info without adding log(............

    Thanks!

    Link to comment
    Share on other sites

  • Topic Author
  • On 12/1/2022 at 3:12 PM, fastvd said:

    still figured out how to take into account the manual operation of the thermostat. who is interested, write...

    Jan, thanks again for a great program!

    Because I don't have any thermostats myself and thus haven't dived into the details how it operates I'm not really the right person to solve it. Hopefully someone else in the forum has some ideas?

    Link to comment
    Share on other sites

    I have got an error when i start upp the eventrunner.  

    the error mess 

    [2022-12-04] [12:32:59] [ERROR] [QUICKAPP1033]: in Rule:343[@{catch,22:00} & 22:00..06:00-1 => log('Det är Natt nu'); $TOD='Night']: ./include/EventRunner.lua:1798: ./include/EventRunner.lua:1501: attempt to index a nil value (local 'ev'

     

    The rule . i have done  Notting too the rule 

    -- Script 6 ----------------------------TimeofDay--TOD-------------------------------------------------------------------------------------
      rule("@{catch,06:00} & 06:00..10:00-1 => log('Det är Morgon nu'); $TOD='Morning'").start()
       rule("@{catch,10:00} & 10:00..18:00-1 => log('Det är Dag nu'); $TOD='Day'").start()
       rule("@{catch,18:00} & 18:00..22:00-1 => log('Det är Kväll nu'); $TOD='Evening'").start()
       rule("@{catch,22:00} & 22:00..06:00-1 => log('Det är Natt nu'); $TOD='Night'").start()
     -----------------------------------------------------------------------------------------------------------------------------------------------

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 57 minutes ago, systemfel said:

    I have got an error when i start upp the eventrunner.  

    the error mess 

    [2022-12-04] [12:32:59] [ERROR] [QUICKAPP1033]: in Rule:343[@{catch,22:00} & 22:00..06:00-1 => log('Det är Natt nu'); $TOD='Night']: ./include/EventRunner.lua:1798: ./include/EventRunner.lua:1501: attempt to index a nil value (local 'ev'

     

    The rule . i have done  Notting too the rule 

    -- Script 6 ----------------------------TimeofDay--TOD-------------------------------------------------------------------------------------
      rule("@{catch,06:00} & 06:00..10:00-1 => log('Det är Morgon nu'); $TOD='Morning'").start()
       rule("@{catch,10:00} & 10:00..18:00-1 => log('Det är Dag nu'); $TOD='Day'").start()
       rule("@{catch,18:00} & 18:00..22:00-1 => log('Det är Kväll nu'); $TOD='Evening'").start()
       rule("@{catch,22:00} & 22:00..06:00-1 => log('Det är Natt nu'); $TOD='Night'").start()
     -----------------------------------------------------------------------------------------------------------------------------------------------

     

     

    Well, the @rule has gone through some changes.

    The problem is that you shouldn't add .start() to a @rule in general. You already have the catch added which makes the rules run when defined (if time have passed). Now they will potentially run twice at startup, both for the .start() and for the 'catch' which is a bit unnecessary.

    So, I would recommend to remove the .start()

    However, I have corrected the code so it will not give an error in the next release but I'm working on some more stuff to add before I push the next release.

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Well, the @rule has gone through some changes.

    The problem is that you shouldn't add .start() to a @rule in general. You already have the catch added which makes the rules run when defined (if time have passed). Now they will potentially run twice at startup, both for the .start() and for the 'catch' which is a bit unnecessary.

    So, I would recommend to remove the .start()

    However, I have corrected the code so it will not give an error in the next release but I'm working on some more stuff to add before I push the next release.

     

    Oki tanx jang i will remove .start()

    Link to comment
    Share on other sites

    I have some custom buttons in the ER. How can I prevent them from having to be recreated after an ER update?

    Link to comment
    Share on other sites

    Jan, I have a question for you...how can we not just compare 2 numbers in the rule, but let's say so that the rule is true, so that one number is not just bigger or smaller than the other, but bigger than  specific number...
    for understanding: start the boiler, not just when the temperature in the room is less than the one set in the climate panel, but 2 degrees lower (the key issue here) than the one set in the climate panel!

    in other words, a controlled delta!

    Edited by fastvd
    Link to comment
    Share on other sites

  • Topic Author
  • On 12/10/2022 at 10:02 AM, fastvd said:

    Jan, I have a question for you...how can we not just compare 2 numbers in the rule, but let's say so that the rule is true, so that one number is not just bigger or smaller than the other, but bigger than  specific number...
    for understanding: start the boiler, not just when the temperature in the room is less than the one set in the climate panel, but 2 degrees lower (the key issue here) than the one set in the climate panel!

    in other words, a controlled delta!

    Please login or register to see this code.

    This rule will trigger the diff is 2 degrees or larger. We wrap it in a once(...) so it will only trigger the first time it goes above 2. For the rule to trigger again the value has to be lower then 2.

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • On 12/5/2022 at 12:21 PM, KaWi said:

    I have some custom buttons in the ER. How can I prevent them from having to be recreated after an ER update?

    Unfortunately not at this moment. 

    I think that if you have some custom buttons and labels it would be best to create a separate QA with the buttons and labels and that sends events to ER and that gets updated from ER.

    I can post a template for such an QA if you want?

    In the future I may add an "ignore UI" button to QAUpdater.

    Edited by jgab
    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    I can post a template for such an QA if you want?

    Not necessary. I have two ERs running. The number of buttons is still manageable.

     

    Another question: How can I change the default setting fibaro._pushMethod = 'push' to fibaro._pushMethod = 'simplePush' ? 

    As in

    Please login or register to see this link.

    , it does not work

    At the moment I am manually changing line 1420 after an update in EventRunner

    Link to comment
    Share on other sites

  • Topic Author
  • 29 minutes ago, KaWi said:

    Not necessary. I have two ERs running. The number of buttons is still manageable.

     

    Another question: How can I change the default setting fibaro._pushMethod = 'push' to fibaro._pushMethod = 'simplePush' ? 

    As in

    Please login or register to see this link.

    , it does not work

    At the moment I am manually changing line 1420 after an update in EventRunner

    ~1420 it should look like

    Please login or register to see this code.

    and it should work when setting

    Please login or register to see this code.

    inside main() - before that it may be set back by the line at 1420..

     

    What do you change to what when it works?

    Link to comment
    Share on other sites

    59 minutes ago, jgab said:

    What do you change to what when it works?

    Please login or register to see this attachment.

    I uncomment the Original-Line (1420) and insert the new Line (1421).

     

     

    This is my main()

     

    Please login or register to see this attachment.

     

    I reset line 1420. But it doesn't work.

    Link to comment
    Share on other sites

  • Topic Author
  • 14 hours ago, petrkl12 said:

    I have same problem. Simple push defined in main doesn’t work. 

    @KaWiand @petrkl12 you were right - it was a stupid bug - fixed in v0.99

    /J

    • Thanks 1
    Link to comment
    Share on other sites

    Hello jgab,


    I tried the new version ER4 0.99 with QAupdater.

     

    It ended with an error


    [ERROR] [QUICKAPP1866]: , trying to fetch

    Please login or register to see this link.

    Link to comment
    Share on other sites

  • Topic Author
  • 36 minutes ago, SBK said:

    Hello jgab,


    I tried the new version ER4 0.99 with QAupdater.

     

    It ended with an error


    [ERROR] [QUICKAPP1866]: , trying to fetch

    Please login or register to see this link.

    Sorry, too early this morning. forgot to add tag to git repo. Now it should work.

    /J

    Link to comment
    Share on other sites

    Hello jgab 

    I have the next error:

     

    Main() ERROR:./include/EventRunner.lua:2092: attempt to call a nil value (global 'checkForDST')

     

    Do I have to enter something additionally in Main()?

    Link to comment
    Share on other sites

  • Topic Author
  • 23 minutes ago, KaWi said:

    Hello jgab 

    I have the next error:

     

    Main() ERROR:./include/EventRunner.lua:2092: attempt to call a nil value (global 'checkForDST')

     

    Do I have to enter something additionally in Main()?

    Pushed v0.991 with a fix.

    • Like 2
    Link to comment
    Share on other sites

    As said in

    Please login or register to see this link.

    "EventRunner - now it works again!" :-) 

     

    Thanks for your help jgab

    • Like 1
    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...