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

Converting ER4>EV5

 

Works in Ev4 but not in EV5

Please login or register to see this code.

 

[23.11.2023] [17:48:20] [ERROR] [QUICKAPP1961]: Last err: [Rule:57:trueFor(00:04:00,Flisegang:safe & entre.FliseAutoORManuelt) => 1184:off; entre..] Rule: nil is not a valid device trueFor(00:04:00,Flisegang:safe & entre.FliseAutoORManuelt) => 1184:off; entre.FliseAutoORManuelt=false ^

 

Works in EV5

Please login or register to see this code.

 

is this by design or me messing up ?

Posted (edited)

Jan sorry wrong statement

 

Edited by Sjakie
  • Topic Author
  • Posted
    1 hour ago, ChristianSogaard said:

    I tried on version 0.300 - and i get no trigger -uptimeMinutes 

    It's not a trigger, just a predefined variable. Just check the value at upstart and log/do something. Like in my previous example.

    1 hour ago, ChristianSogaard said:

    Hi Jan

    How do i do Util.defTriggerVar - in ER5

    Please login or register to see this code.

     

    It er.defTriggerVar(...) or Util.defTriggerVar(...) if you have the standard main() function that declares

    Util (similar like the 'var' discussion we had).

     

    There is also a 'triggerVar' variable defined the same way as 'var' to declare triggerVariables.

    Ex

    triggerVar.SiemensCookTop = 0

     

    If you have your own local mains in modules you need to set the variables up yourself...

    Posted
    2 hours ago, jgab said:

    It's not a trigger, just a predefined variable. Just check the value at upstart and log/do something. Like in my previous example.

    It er.defTriggerVar(...) or Util.defTriggerVar(...) if you have the standard main() function that declares

    Util (similar like the 'var' discussion we had).

     

    There is also a 'triggerVar' variable defined the same way as 'var' to declare triggerVariables.

    Ex

    triggerVar.SiemensCookTop = 0

     

    If you have your own local mains in modules you need to set the variables up yourself...

    Got it - that part is running now

     

    [QUICKAPP1961]: Last err: [Rule:21:#device{id=extractor_hood,value='$value'} => || value < 10 & value > 0 >> extr..] Parser: bad expression || value < 500 & value > 225 >> extractor_step=4; extractor_light = 1 ^

     

    I removed the last ; in each line

    I was a litte unsure for the last "log('%s %s',extractor_step,extractor_light)"  normal the libefore would have ;; but i removed both

    All variables should be declared, so what is the Parser: bad expression about

     

    Please login or register to see this code.

     

    Posted (edited)
    34 minutes ago, ChristianSogaard said:

    Got it - that part is running now

     

    [QUICKAPP1961]: Last err: [Rule:21:#device{id=extractor_hood,value='$value'} => || value < 10 & value > 0 >> extr..] Parser: bad expression || value < 500 & value > 225 >> extractor_step=4; extractor_light = 1 ^

     

    I removed the last ; in each line

    I was a litte unsure for the last "log('%s %s',extractor_step,extractor_light)"  normal the libefore would have ;; but i removed both

    All variables should be declared, so what is the Parser: bad expression about

     

    Please login or register to see this code.

     

    i dont want to say something stupid, so forgive me if i am wrong, but i learnt from Jan in some of my toipcs that separating the || >> part from other statements should be done by ;; So before the log( ) part you need to put a double ; i think

    Sorry if i am wrong

    Edited by Neo Andersson
  • Topic Author
  • Posted
    58 minutes ago, Neo Andersson said:

    i dont want to say something stupid, so forgive me if i am wrong, but i learnt from Jan in some of my toipcs that separating the || >> part from other statements should be done by ;; So before the log( ) part you need to put a double ; i think

    Sorry if i am wrong

    Please login or register to see this code.

    Yes correct, it should be

    Please login or register to see this code.

    @Neo Andersson, maybe it's time to move to ER5? ;-) 

    • Thanks 1
    Posted

    If you don't have ;; it does't give error

    • Thanks 1
    Posted
    10 hours ago, jgab said:

    Please login or register to see this code.

    Yes correct, it should be

    Please login or register to see this code.

    @Neo Andersson, maybe it's time to move to ER5? ;-) 

    @jgab is it safe to move in production? I mean i have dozens of systems running with ER4. Somewhere more than 150 rules.

    If so, what is the best way to upgrade? Just copy paste rules into ER5 Main function?

    Posted (edited)

    If you ask me it's reliable to use!! I am on ER5 since the first release and arming halfway. 

    I had QA's with over 500 rules what is't a problem at all. They are reduced now in our new appartment

    If you doubt you can test;

    create back-up

    copy and past all your excisting QA's in one,

    delete all others,

    see the result it's amazing it will still work.

    The compliments to Jan!

    ps working with colors in debug is easy and it can help you with a fast check of your triggers or execution

    Edited by Sjakie
    add color
    Posted

    [24.11.2023] [08:23:38] [TRACE] [QUICKAPP1062]: media.wcd_SubWoofer = Uit[24.11.2023] [08:23:38] [TRACE] [QUICKAPP1062]: tv_aan=false[24.11.2023] [08:27:29] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Uit[24.11.2023] [08:27:29] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Uit met als gevolg 1[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: keuken.Bovenkastrechts = Uit[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Syncbox_Uit = 2[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Lezen_Uit = 00:00:02[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Kunst_Uit = 00:00:03[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_TV_Uit = 00:00:04[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Salonlampen_Uit = 00:00:05[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Eethoek_Uit = 00:00:10

    Posted
    8 minutes ago, Sjakie said:

    If you ask me it's reliable to use!! I am on ER5 since the first release and arming halfway. 

    I had QA's with over 500 rules what is't a problem at all. They are reduced now in our new appartment

    If you doubt you can test;

    create back-up

    copy and past all your excisting QA's in one,

    delete all others,

    see the result it's amazing it will still work.

    The compliments to Jan!

    ps working with colors in debug is easy and it can help you with a fast check of your triggers or execution

    Thanks Sjakie

    Posted

    Okay, i have transposed my home system to ER5

    I ran into errors around these rules.

    First error complaining about nonexistent diarmed property. I suppose in ER5 there is different approach.

    The second does not give me any sense, as it is complaining about miising >> operand byt it is there

     

    Please login or register to see this code.

     

     

    Please login or register to see this attachment.

     

    Posted (edited)
    16 minutes ago, Neo Andersson said:

    Okay, i have transposed my home system to ER5

    I ran into errors around these rules.

    First error complaining about nonexistent diarmed property. I suppose in ER5 there is different approach.

    The second does not give me any sense, as it is complaining about miising >> operand byt it is there

     

    Please login or register to see this code.

     

     

    Please login or register to see this attachment.

     

    UPDATE:

    Okay, first error i solved by using

    Please login or register to see this code.

    and the second by reformatting the rule to

    Please login or register to see this code.

     CASE sloved

    Edited by Neo Andersson
  • Topic Author
  • Posted (edited)
    11 minutes ago, Neo Andersson said:

    UPDATE:

    Okay, first error i solved by using house_alarm_sirene:armed == false

    and the second by reformatting the rule to

    Please login or register to see this code.

     CASE sloved

     

    Ok, this will be interesting :-) Keep us posted how it goes. There are some small changes to the "language" - mostly I would say missing stuff - that I would like to keep out from ER5 (there were always 4 different ways to accomplish the same thing in ER4).

    I'm thinking of some module model for extra stuff to ER5 - ex. the child device support - very few use it and I'm unsure it motivates to be a standard part of ER5.

     

    I think where ER5 differs most is the rule management and life-cycle. Much more options to tailor logs and outputs - and hopefully better error messages. I haven't documented it all yet. However, I'm open to implement stuff you need and that I haven't carried over from ER4...

     

    There is also the possibility to create user defined :property functions - I'm not sure how useful that is, but if I have forgotten something, users can add.

    ... and a lot more stuff....

    Edited by jgab
    Posted
    7 minutes ago, jgab said:

     

    Ok, this will be interesting :-) Keep us posted how it goes. There are some small changes to the "language" - mostly I would say missing stuff - that I would like to keep out from ER5 (there were always 4 different ways to accomplish the same thing in ER4).

    I'm thinking of some module model for extra stuff to ER5 - ex. the child device support - very few use it and I'm unsure it motivates to be a standard part of ER5.

     

    I think where ER5 differs most is the rule management and life-cycle. Much more options to tailor logs and outputs - and hopefully better error messages. I haven't documented it all yet. However, I'm open to implement stuff you need and that I haven't carried over from ER4...

     

    There is also the possibility to create user defined :property functions - I'm not sure how useful that is, but if I have forgotten something, users can add.

    ... and a lot more stuff....

    How to set up user defined properties with :

    I couldn't find any description. I think it is very usefull.

    Also, i think child support is very usefull.

    Like this

    Please login or register to see this code.

     

  • Topic Author
  • Posted (edited)
    4 hours ago, Sjakie said:

    [24.11.2023] [08:23:38] [TRACE] [QUICKAPP1062]: media.wcd_SubWoofer = Uit[24.11.2023] [08:23:38] [TRACE] [QUICKAPP1062]: tv_aan=false[24.11.2023] [08:27:29] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Uit[24.11.2023] [08:27:29] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Uit met als gevolg 1[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: keuken.Bovenkastrechts = Uit[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Syncbox_Uit = 2[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Lezen_Uit = 00:00:02[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Kunst_Uit = 00:00:03[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_TV_Uit = 00:00:04[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Woonkamer_Salonlampen_Uit = 00:00:05[24.11.2023] [08:27:30] [TRACE] [QUICKAPP1062]: #licht_Eethoek_Uit = 00:00:10

     

    So, if you want custom color for the log output I think it's better to use the rule options than to add #C: directive to the rule.

    The rule function takes the "rule string" but also an optional options argument.

    Ex.

    Please login or register to see this code.

    This will log the text in green for this "rule".

    In fact, it's not a real rule, just an expression that we run to log, so we are not really interested in that the rule call returns the result and logs that - which is the string ''This is a test"

    We can make the rule function quite by telling it to not log the evaluated result

    Please login or register to see this code.

    Now, this will only log the text in green in the console.

    The options table is a bit long to send to "log rule" so we can create a couple of predefined options tables and reuse them

    Please login or register to see this code.

     

    and we can define our own versions of the rule functions using these options

    Please login or register to see this code.

     

    etc.

    3 hours ago, Neo Andersson said:

    How to set up user defined properties with :

    I couldn't find any description. I think it is very usefull.

    Also, i think child support is very usefull.

    Like this

    Please login or register to see this code.

     

    Ok, I can add child support in next version.

    No, the user defined :props are not documented yet - this weekend.

    Edited by jgab
    Posted (edited)

    @jgab Jan we also had a conversation about the better trace of timers in trueFor.

    Somehow, i need to get the information about a trueFor rule's timer. Where is the counting at a moment. ex how much seconds remains to the trigger..Like in case of delayed opening of a door, i can show the remaining seconds to the user..is that too complicated?

    And also we tlaked about action calls where the state should be chceked first and not performed any operation if the desired state is already present. Now i am using for it my own function that actuially follows this logic ... => device:isOff & device:on

    Sorry, one more thing

    using push and simplePush somehow..i think at this moment only push is working..notifications for devices doesn't have support even in ER4..maybe i am wrong

     

    Edited by Neo Andersson
    Posted (edited)
    12 hours ago, jgab said:

    Please login or register to see this code.

    Yes correct, it should be

    Please login or register to see this code.

    @Neo Andersson, maybe it's time to move to ER5? ;-) 

    Reason for the post, is that i am moving to ER5 ;-) you can see that i removed the ; in || each

    line 

    Edited by ChristianSogaard
    Typo
    Posted

    Jan, can you take in consideration

    standard devieces isOn yellow, isOf lighter or darker form of yellow

    device trigger=true green, device trigger=false lightgreen

    $GV set pink,

    $$QA gv>> violet

    Perhaps as custom setting?

    Thanks in advance

    Posted
    12 minutes ago, ChristianSogaard said:

    Reason for the post, is that i am moving to ER5 ;-) you can see that i removed the ; in || each

    line 

    I am a bit confused now..

    I think || >> lines never needed any ; in ER4

    Only after the whole ||>> part is finished, and you needed to add some other statements after, there you needed the ;; to mark the end of the ||>> part

    Did this change in ER5 to some other pttern? I doubt,because my ER5 based home system never complained about this

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