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
  • Posted (edited)
    12 hours ago, domin12 said:

    ok, will test it after upgrade, i'm still using old version _version,_fix = "1.15","fix12"

    o my..... so many things was happend here , how to quickly upgrade my old version ?

    trying move to new version, but after moving my rules got this error :

    ps. using HomeTable variable

     There should be no changes to your rules so the upgrade is not that difficult.

    It seems like you don't get to initialise your hometable and it becomes nil

     

    The hometable setup in beginning of EventRunner.lua is bit different.

    The variable pointing to your FibaroSceneAPI hometable variable is named '_homeTable' now...

    ...and you need to uncomment the line "local HT = type..."  in the beginning of your main()

    Please login or register to see this code.

    ..and then HT is used for the table (you can delete the inline HT example).

    Note that I call Util.defvars and Util.reverseMapDef on HT.dev as I have the device id's in the .dev "branch" of the hometable. There could be other branches in the hometable that is not nodes ending with device numbers (like the "other":"other" in the example) and calling defvars/reverseMapDef may cause some confusion.

    You are of course free to change it so it fits your hometable structure. 

    Otherwise it should be no changes - except if you run the emulator and talk to node-red - then you need to update the node-red flow a bit.

    Let me know how it goes 

     /J

     

     

    Edited by jgab
    • Thanks 1
  • Topic Author
  • Posted
    23 hours ago, petrkl12 said:

    it looks that it will be really clever :) without dependency on Fibaro:setGlobal and getGlobal ;D

     

    I see one potential problem and it's a automatic delete of log ...

     

    When it resets the log (every ~250 entry), it sets it back to the last 3-7 entries - it varies. Unfortunately, that means that the consumer can lose events if it doesn't read them fast enough... experiments seems give 1-2 lost events at every turnover if producer is twice as fast as consumer.... so back to square one.

    • Thanks 1
    Posted
    4 godziny temu, jgab napisał:

    The hometable setup in beginning of EventRunner.lua is bit different.

    The variable pointing to your FibaroSceneAPI hometable variable is named '_homeTable' now...

    ...and you need to uncomment the line "local HT = type..."  in the beginning of your main()

    Please login or register to see this code.

    i have change it before, so the error is still the same 

    Please login or register to see this code.

    Does this mean that my HomeTable structure is wrong?

  • Topic Author
  • Posted
    4 minutes ago, domin12 said:

     

    Does this mean that my HomeTable structure is wrong?

    Do you have a ’dev’ key at the top level of your home table with all your devices?

    otherwise change defvars and reversemapdef to only get HT as argument and not HT.dev etc

    • Thanks 1
    Posted (edited)
    10 minut temu, jgab napisał:

    Do you have a ’dev’ key at the top level of your home table with all your devices?

    otherwise change defvars and reversemapdef to only get HT as argument and not HT.dev etc

    Exactly at the same moment in which you wrote the message. I understood what I did wrong, it looks like everything will be fine

     

    --update 

    Works great

    Please login or register to see this image.

    /monthly_2019_03/image.png.189f343e1d6b663e9e5f2a4f9c8f007a.png" alt="image.png.189f343e1d6b663e9e5f2a4f9c8f007a.png" />

     

    how to put the percent symbol to this rule after moisture value 

    Please login or register to see this code.

    I'm trying 

    Please login or register to see this code.

    but as You probably know, it does not work.

    Edited by domin12
  • Topic Author
  • Posted
    18 minutes ago, domin12 said:

    how to put the percent symbol to this rule after moisture value 

     

    You need a %% to print a % with string.format

    Please login or register to see this code.

     

    • Like 1
    Posted
    8 minut temu, jgab napisał:

     

    You need a %% to print a % with string.format

    Please login or register to see this code.

     

    Thank You

  • Topic Author
  • Posted
    42 minutes ago, domin12 said:

    Thank You

    string.format has a lot of useful formatting directives. 

    Please login or register to see this code.

    gives "%3.14"

    and you can do left and right adjustments with padding etc.

    Please login or register to see this link.

     

    Posted (edited)
    11 hours ago, jgab said:

     

    When it resets the log (every ~250 entry), it sets it back to the last 3-7 entries - it varies. Unfortunately, that means that the consumer can lose events if it doesn't read them fast enough... experiments seems give 1-2 lost events at every turnover if producer is twice as fast as consumer.... so back to square one.

     

    it's a pity :(

     

    or you could clear log yourselves and setup some index that you will do it before .... but it will be maybe too slow ...

    Edited by petrkl12
    Posted

    @jgab

    can you see why this is not working? Timer function does not work when using #VirtualSensor

    Please login or register to see this code.

     

    Posted
    On 3/13/2019 at 2:30 PM, jgab said:

    Is this still a problem? I have tested and have no problem on the HC2.  If I in the emulator set "Hc2.remoteDevices(713)" it works from the emulator too.

    On the HC2 does its log the "fibaro:call(713,"setProperty",...)" ?

    I can see that VD slider popups to the value i set but then it goes back to what it was before.
    Looks ok in debug window (setProperty)

     

    When i set value with virtual sonos ID it works.

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    55 minutes ago, jompa68 said:

    I can see that VD slider popups to the value i set but then it goes back to what it was before.
    Looks ok in debug window (setProperty)

    When i set value with virtual sonos ID it works.

    Please login or register to see this code.

     

     

    Do you have some VD loop that sets it back? If you don't see any fibaro:* log in ER it must be someone else that sets the value? Some other scene?

  • Topic Author
  • Posted

    Please login or register to see this code.

    You have the right scene headers? power in the first and value in the second?

    I would make the test >0.5 in the first scene before deciding to publish - that way the second scene get fewer events.

    Posted (edited)

    @jgab

     

    why this condition is also true for value=0 ?

    Please login or register to see this code.

     

    Edited by petrkl12
  • Topic Author
  • Posted
    36 minutes ago, petrkl12 said:

    @jgab

     

    why this condition is also true for value=0 ?

    Please login or register to see this code.

     

    Both rules trigger on 100:value, 101:value and 102:value

    The second rule is only true if the value (of the device that did the trigger) is equal to 1

    The first rule assigns 1 to the value property of 100,101,102 -- which is always true, and thus the right hand side will execute.

    Posted

    Thanks, but it looks that second rule doesn't work and I don't know why ...

  • Topic Author
  • Posted
    27 minutes ago, petrkl12 said:

    Thanks, but it looks that second rule doesn't work and I don't know why ...

    Oh, {100,101,102}:value is the same as {100:value,101:value,102:value} and that is not equal to '1'

    To get the id that triggered the event do

    Please login or register to see this code.

    :dID selects the device id from the table that caused the rule to trigger and returns it, so that :value is applied to the right trigger

    Posted (edited)

    It works :). Thanks

    I think there are a lot of new rules that could be perfect to describe in wiki.

    Edited by petrkl12
    Posted

    still fighting with this...

     

    Please login or register to see this code.

     

    Please login or register to see this attachment.

  • Topic Author
  • Posted

    I assume the rule runs every weekday between 5 and7.30. Do you get the error every day or once a week or?

    I haven't been able to replicate it with a similar rule, so let me think about a better debug statement to capture the bug next time it happens.

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