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



jgab

Recommended Posts

  • Topic Author
  • Posted (edited)

    I have update ER4 (v0.83) and QAUpdater (v0.66). They can both be updated with QAUpdater.

    The new things is that ER4 can query the updater QA and ask if there are any updates and if so, ask QAUpdater to update it.

    It is implemented using the old functions in ER4 so something like this should work (again)

    Please login or register to see this code.

    A new field is the .descr that contains the update string I provide with the release.

    Edited by jgab
    • Thanks 1
    Link to comment
    Share on other sites

    5 minutes ago, jgab said:

    I have update ER4 (v0.83) and QAUpdater (v0.66). They can both be updated with QAUpdater.

    The new things is that ER4 can query the updater QA and ask if there are any updates and n that case ask QAUpdater to update it.

    It is implemented using the old functions in ER4 so something like this should work (again)

    Please login or register to see this code.

     

    This is a nice feature - thank you for providing this.?

    I have minor feature request for the QAUpdater. 

    When having updated a QA, eg. a Event runner 4, the QAUpdater resets all its GUI settings, so if you want to update eg 10 EV4, its a lot of clicking ;-)

     

    Would it be possible for the QAUpdater so stay in the same GUI settings, so i just can click once for my next Event runner 4, and then pres update ? 

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Yes, it should be possible I guess - added to my todo list.

    You have 10 EV4?

    What you could do is only have the rule in one of them and then let it update the others

    Please login or register to see this code.

     

    You need to have the ID of the QAUpdater.

    If you patch the EventRunner file at around line ~656 you can add the UpdaterQA ID to the event sent

    Please login or register to see this code.

    and you can do 

    Please login or register to see this code.

    It will be in the next version of ER4 but I'm waiting a bit to release that....

    Edited by jgab
    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    A general question - how many ER4 QAs are you running?

    The reason I ask is that if you have more than 3 and think there are more efficient ways to do things - and probably not all rules need <1s response time.

    So what probably takes most cpu power in ER4 is the polling of events. I try to do it as efficient as possible and I never run rules unnecessarily unless events actually can trigger them - but anyway.

     

    An approach would be to have one ER4 to be the "master" and send events to other ER4 instance. The drawback would be that these ER4s would react a little bit slower (probably ~1s) but they would consume very little cpu when there are no events.

    My thinking is to implement it as an option in ER4 to poll for events itself or getting events from a "master" ER4

     

    Then you can have an ER4 with low latency rules (doing its own polling)  and other QAs that don't mind a bit higher latency and receiving events from the master QA.

     

     

    Edited by jgab
    Link to comment
    Share on other sites

    9 minutes ago, jgab said:

    A general question - how many ER4 QAs are you running?

    The reason I ask is that if you have more than 3 and think there are more efficient ways to do things - and probably not all rules need <1s response time.

    So what probably takes most cpu power in ER4 is the polling of events. I try to do it as efficient as possible and I never run rules unnecessarily unless events actually can trigger them - but anyway.

     

    An approach would be to have one ER4 to be the "master" and send events to other ER4 instance. The drawback would be that these ER4s would react a little bit slower (probably ~1s) but they would consume very little cpu when there are no events.

    My thinking is to implement it as an option in ER4 to poll for events itself or getting events from a "master" ER4

     

    Then you can have an ER4 with low latency rules (doing its own polling)  and other QAs that don't mind a bit higher latency and receiving events from the master QA.

     

     

     

    My reason for having more EV4 is structure - by rooms or functions.

    What Could work for me as well is having more files where i can build the structure and just having one EV4

    LIke -

    rules_Bathroom

    rules_Marius

    rules_eg

     

    Please login or register to see this image.

    /monthly_2022_07/2022-07-14_09-45-04.png.d149fcb1371190064d0f49662779b897.png" />

     

     

     

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)
    16 minutes ago, ChristianSogaard said:

     

    My reason for having more EV4 is structure - by rooms or functions.

    What Could work for me as well is having more files where i can build the structure and just having one EV4

     

    Please login or register to see this link.

     

     

     

    That's a good idea. You can do it already today.

     

    Create new file(s) and in each file add the content

    Please login or register to see this code.

     

    The in your main file inside main() you do

    Please login or register to see this code.

     

    Edited by jgab
    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

    15 minutes ago, jgab said:

    That's a good idea. You can do it already today.

     

    Create new file(s) and in each file add the content

    Please login or register to see this code.

     

    The in your main file inside main() you do

    Please login or register to see this code.

     

    you are a true mastermind ?

    Link to comment
    Share on other sites

    27 minutes ago, jgab said:

    That's a good idea. You can do it already today.

     

    Create new file(s) and in each file add the content

    Please login or register to see this code.

     

    The in your main file inside main() you do

    Please login or register to see this code.

     

    Some Questions

    Should filename and module name be identical (identified with red arrow) ?

     

    i am getting 

    [14.07.2022] [10:21:01] [ERROR] [QUICKAPP1640]: QuickApp crashed
    [14.07.2022] [10:21:01] [ERROR] [QUICKAPP1640]: main.lua:40: attempt to index a nil value (global 'self')

     

    rules look like this 

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    No they don't need to have the same name.

    But it's important that you have the loop that loads the modules inside

    Please login or register to see this code.

    in your main file as it needs the variable self.

     

    You could have your QuickApp:main() only to setup hometables etc and then have all the rules in the modules - or have some main rules (like updater) in the  QuickApp:main()

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Ah!, Please halt the exercise!!! I just realised that this will not play so well with the QAUpdater that will remove your extra files.

    I will need to build in support in ER4/QAUpdater to allow for this - will have a look at it.

    Edited by jgab
    Link to comment
    Share on other sites

    1 minute ago, jgab said:

    Ah!, Please halt the exercise!!! I just realised that this will not play so well with the QAUpdater that will remove your extra files.

    I will need to build in support in ER4/QAUpdater to allow for this - will have a look at it.

    LOL - I was just going to write that to you ? i found out already

     

    But now the rules are being imported ?

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)
    30 minutes ago, ChristianSogaard said:

    LOL - I was just going to write that to you ? i found out already

     

    But now the rules are being imported ?

     

    Please login or register to see this code.

     

    ...and now I pushed v0.67 of QAUpdater.

    It will leave files untouched that's starts with u_...

    Ex.

    u_Bathroom

     

    "u" stands for user...

    Edited by jgab
    • Like 1
    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    No they don't need to have the same name.

    But it's important that you have the loop that loads the modules inside

    Please login or register to see this code.

    in your main file as it needs the variable self.

     

    You could have your QuickApp:main() only to setup hometables etc and then have all the rules in the modules - or have some main rules (like updater) in the  QuickApp:main()

    Hi Jan

     

    I tried setup hometables in main file

     

    Please login or register to see this code.

     

    But it seems that these rules from my u_ColorProcessor file are missing the data from HTab

    Please login or register to see this code.

    Please login or register to see this code.

     

    i have a Scene that creates the HT

    Please login or register to see this code.

     

    and the Global Variable is updated

    Please login or register to see this attachment.

     

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Yes, you need to put the loop that loads the rules after you define the HT table, otherwise it's not available when they are defined.

    Actually, maybe it's better to put the loop at the end of QuickApp:main() so your main rules load before the modules' rules.

    Edited by jgab
    Link to comment
    Share on other sites

    On 7/9/2022 at 9:25 AM, jgab said:

    New version 0.81 with a new experimental feature - user action events.

     

    When someone interacts with a device in the app there are events emitted with the device and userid.

    Ex. a com.fibaro.multilevelSwitch device with id 756.

    When the user with id 917 turn on, off and changes dimming we get the events

    Please login or register to see this code.

     

    Which means that we can create a rule like

    rule("#user{id=917,value='action',data={id=756,actionName='turnOn'}} => log('Ann turned on the light')")

     

    Beware that the normal event 

    Please login or register to see this code.

    is also emitted.

    Also the order of the events seems to not be predictable. I've seen the #device event being fired after the #user event.

     

    Anyway, will experiment more with it to see how it can be used.

     Ohh this hade been nice too get to work :) 

    Link to comment
    Share on other sites

    HI @jgab

    i found instruction how to use button from another QA to activate rules in ER4 in attached post

    and got this error, will you help me to solve the problem ? thnx:

    [14.07.2022] [22:15:02] [DEBUG] [QUICKAPP22]: onAction:  {"args":[{"type":"morning"}],"deviceId":22,"actionName":"RECIEVE_EVENT"}

    [14.07.2022] [22:15:02] [DEBUG] [QUICKAPP22]: ./include/fibaroExtra.lua:2079: attempt to index a nil value (field 'ev')

    [14.07.2022] [22:15:02] [ERROR] [QUICKAPP22]: QuickApp crashed

    [14.07.2022] [22:15:02] [ERROR] [QUICKAPP22]: Unknown error occurred: handleJsonRpc

     

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • You need to put the event inside an event.

    Please login or register to see this code.

    I will update the post.

    Link to comment
    Share on other sites

    43 minuty temu, jgab napisał:

    thnx @jgab

     

    You need to put the event inside an event.

    Please login or register to see this code.

    I will update the post.

    i'm refering to this ,sorry guys, something goes wrong with the attached link :

    Please login or register to see this code.

     

    Edited by domin12
    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Ok, this is how it works these days.

    You create UI elements but set their onReleased to 'FEventRunner4'

    Whenever you press a button it will fire a ER event of type (ex. with ID='myButton'). ID is the QA ID, name is the UI element ID.

    Please login or register to see this code.

    So your rule becomes

    rule("#UI{name='myButton'} => ...")

     

    If you have a slider you do

    rule("#UI{name='mySlider',value={'$value'}} => log('Values is:',value)")

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