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
  • 50 minutes ago, Earybeongbeong7 said:

     

    It does not proceed when forced update is performed in my version (0.5fix 23).

    You need fibaroapiHC3.lua v0.135

    and you need to download EventRunner4Engine.lua from my GitHub by hand (It's the version that has DOWNLOADSOURCE() defined )

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

    Guest kallecux

    Hi @jgab i get this errors since update of HC3:

     

    Please login or register to see this code.

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, kallecux said:

    Hi @jgab i get this errors since update of HC3:

     

    Please login or register to see this code.

     

     

    Interesting, they changed the format of centralSceneEvent. Field 'deviceId' changed to 'id'.

    Well  well, I pushed ER4. 0.5fix25 that fixes that. (fibaroapiHC3.lua has also changed)

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, kallecux said:

    Why are they doing this?

    Well,  I don't blame them. The "event format" is (was) not very streamlined with device id being other "id",  "deviceId" etc.

    Most people would not notice because they were already transforming them when they "create" sourceTriggers from the events.

    Edited by jgab
    Link to comment
    Share on other sites

    23 hours ago, jgab said:

     

    Yes,

    rule("@@rnd(00:10,00:30) & $Away & 10:00..15:00 & wday('mon-fri') => lamps[rnd(1,size(lamps))]:toggle") -- toggle a random light every 10-20min

     

     

    Sorry, the length function is called 'size' in ER

    rule("@@rnd(00:10,00:30) & $Home_Away=='Away' & sunrise..sunset => lamps[rnd(1,size(lamps))]:toggle") -- toggle a random light every 10-20min

    So I added some to this and have been able to get in the basic functionality I currently want and need in my remote control. I guess there is a simple answer to this but it looks like the rules I add after the rules where lights are toggled randomly are excluded, that is the two rows below "--Home_Away - Släck huset kvällstid" don't run. Why is that? 

     

    Please login or register to see this code.


      

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, Hans_Raven said:

    So I added some to this and have been able to get in the basic functionality I currently want and need in my remote control. I guess there is a simple answer to this but it looks like the rules I add after the rules where lights are toggled randomly are excluded, that is the two rows below "--Home_Away - Släck huset kvällstid" don't run. Why is that? 

    Please login or register to see this code.

     

     

    There is an error with extra ')' before the '=>' in both rules

    You should have seen the log complaining the rule is wrong - however the error messages are strange sometimes.

    I also like the @time to be to the left in the condition.. :-) 

    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • Juts a reflection. The rules that trigger on the remote becomes long and repetitive.

     

    Quote

    Please login or register to see this code.

      

     

    The ideas is that we create an event of type {type=Remote_entre:central.keyAttribute..Remote_entre:central.keyId} that becomes "Pressed1" if keyAttribute is "Pressed" and keyId is 1 etc. String concatenation in ER4 is the format function that is called fmt().

    Then we post that event. Our other rules can react on these "shorter" events.

    Edited by jgab
    Link to comment
    Share on other sites

    22 hours ago, jgab said:

     

    Yes,

    rule("@@rnd(00:10,00:30) & $Away & 10:00..15:00 & wday('mon-fri') => lamps[rnd(1,size(lamps))]:toggle") -- toggle a random light every 10-20min

     

     

    Sorry, the length function is called 'size' in ER

    rule("@@rnd(00:10,00:30) & $Home_Away=='Away' & sunrise..sunset => lamps[rnd(1,size(lamps))]:toggle") -- toggle a random light every 10-20min

     

    Is it difficult to apply the random function as a string rather than a number?  For example, what about printing a random variable sequentially from a to k??

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, Earybeongbeong7 said:

     

    Is it difficult to apply the random function as a string rather than a number?  For example, what about printing a random variable sequentially from a to k??

    Can you explain with an example?

    Link to comment
    Share on other sites

    45 minutes ago, jgab said:

    Juts a reflection. The rules that trigger on the remote becomes long and repetitive.

     

     

    The ideas is that we create an event of type {type=Remote_entre:central.keyAttribute..Remote_entre:central.keyId} that becomes "Pressed1" if keyAttribute is "Pressed" and keyId is 1 etc. String concatenation in ER4 is the format function that is called fmt().

    Then we post that event. Our other rules can react on these "shorter" events.

    Thanks! Looks much nicer and effective, can you explain what this part of the code means/does?

    Please login or register to see this code.

    Link to comment
    Share on other sites

  • Topic Author
  • 20 minutes ago, Hans_Raven said:

    Thanks! Looks much nicer and effective, can you explain what this part of the code means/does?

    Please login or register to see this code.

    If you know a little Lua I can explain.

    An event in ER is a lua table with a type field.

    Ex.

    Please login or register to see this code.

    Incidentally,  if you code a Lua scene, the sourceTrigger has the same format. In the above case it's a sourceTrigger for device 88 changing it's property 'value' to true. (could be e.g. a sensor)

    ER will pick up the same events from the system so that rules can trigger on them.

    Ex.

    Please login or register to see this code.

    In ER rules we can write event tables a bit shorter. Because we always have a 'type'  field we can leave that out and concentrate on the type value

    Please login or register to see this code.

    it actually saves a couple of characters ;-) 

     

    However, we can also post our own events. (and we can post events that look like device events to trigger our rules)

    If we would like to post the event 

    Please login or register to see this code.

    whenever we click on button 1 of a remote we can do

    Please login or register to see this code.

    which we can shorten to

    Please login or register to see this code.

     

    In the example with the remote in the previous post we need to create the string "Pressed1" so we can create the event.

    We do that by concatenating the keyAtttribute and keyId. value of the central scene event.

    In Lua we can concatenate with '..'  but we can't do that in ER as '..' is used for time intervals.

    What we do is a string.format("%s%s",keyAtttribute,keyId) that is a lua function that returns a string formatted with specified formatting rules. Here just 2 strings '%s' after each other.

    ...and it returns the value.

    In ER, string.format is shortened as the function 'fmt'. So it becomes fmt('%s%s',keyAtttribute,keyId)

    and we create an event from that with 

    Please login or register to see this code.

    which will turn out to 

    Please login or register to see this code.

    if keyAtttribute==1 and keyId=1

    ..and we can trigger on

    Please login or register to see this code.

     

    If you have different remotes, you could add an remote identifier to the event type, like #EntrePressed1,

    or it may be so that you want your different remotes to post same type of events so they can trigger the same rules.

    • Thanks 1
    Link to comment
    Share on other sites

    Hello Jan,

    Some where you have posted:

    rule("373:secure") -- locks
      rule("373:unsecure") -- unlocks
      rule("373:lock") -- same as 373:secure
      rule("373:unlock") -- same as 373:unsecure
      rule("373:isSecure") -- true if locked
      rule("373:isUnsecure") -- true if unlocked
      rule("373:isLocked") -- same as 373:isSecure
      rule("373:isUnlocked") -- same as 373:isUnsecure

    Unfortuanaly they all doest work for me!

    I am on 4.60 and ER the greatest last  V3.0 build 89

    If I create a block scene they use the words opened and closed when I change  the view in LUA >>fibaro:getValue(1153, "secured")) == 0 ) Value 0 or 255

    When I create ER rule I need to use:

    Rule.eval([[hal.voorDeurSlot:isClosed => in real life lock is open or Rule.eval([[hal.voorDeurSlot:isOpen => in real life lock is Closed

    but its reversed???

    Please can you check? Or do I need to go to a medical institute?

    Please advice,

    //Sjakie

    App on phone shows close

    Please login or register to see this image.

    /monthly_2020_10/image.png.2b27a2ddf93d0ddada6dae07e324eeb1.png" />

     

    image.png.7c519f20900ada51f65dafb69cf07eb9.png

    image.png.b1fb433d8d7b1779b5bc84b920582045.png

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 46 minutes ago, Sjakie said:

    Hello Jan,

    Some where you have posted:

    rule("373:secure") -- locks
      rule("373:unsecure") -- unlocks
      rule("373:lock") -- same as 373:secure
      rule("373:unlock") -- same as 373:unsecure
      rule("373:isSecure") -- true if locked
      rule("373:isUnsecure") -- true if unlocked
      rule("373:isLocked") -- same as 373:isSecure
      rule("373:isUnlocked") -- same as 373:isUnsecure

    Unfortuanaly they all doest work for me!

    I am on 4.60 and ER the greatest last  V3.0 build 89

    If I create a block scene they use the words opened and closed when I change  the view in LUA >>fibaro:getValue(1153, "secured")) == 0 ) Value 0 or 255

    When I create ER rule I need to use:

    Rule.eval([[hal.voorDeurSlot:isClosed => in real life lock is open or Rule.eval([[hal.voorDeurSlot:isOpen => in real life lock is Closed

    but its reversed???

    Please can you check? Or do I need to go to a medical institute?

    Please advice,

    //Sjakie

    App on phone shows close

     

    isOpen and isClose is normally used for things like roller shutters and test against the property 'value'. 

    What happens if you instead use

    Please login or register to see this code.

    that test against property 'secured'

    Link to comment
    Share on other sites

  • Topic Author
  • 16 minutes ago, jgab said:

     

    isOpen and isClose is normally used for things like roller shutters and test against the property 'value'. 

    What happens if you instead use

    Please login or register to see this code.

    that test against property 'secured'

     

    Can you help me figure out if 

    fibaro:getValue(1153, "secured") == 0 means that the lock is closed/secured or if it's open/unsecured ?

    Link to comment
    Share on other sites

    Open

     ( tonumber(fibaro:getValue(1153, "secured")) == 0 )

    closed

     ( tonumber(fibaro:getValue(1153, "secured")) == 255 )

    Manual lock, manual unlock, opend pin user all empty

     

    in docs is written unsecure but I cant find in Block scedule

    //Sjakie

    Please login or register to see this image.

    /monthly_2020_10/image.png.86e058d48c188d6118601a5768cae015.png" />

    Link to comment
    Share on other sites

    Hi jgab

     

    I suggest something about Util.dimLight function.

    my dimmer device adjusts percentage ifself when set value.

    I set value 1% on device, device is set as 0%. I set value 2% on device, device is set as 1% ifself. 

    It has 1% lesser value than i set.

     

    i edited function like below.

    if e.v and math.abs(currV - e.v) > 2 then return end -- Someone changed the lightning, stop dimming

     

    or adding function parameter about value difference is better.

    or if you have better way, please improve.

    Link to comment
    Share on other sites

  • Topic Author
  • 17 hours ago, Sjakie said:

    Open

     ( tonumber(fibaro:getValue(1153, "secured")) == 0 )

    closed

     ( tonumber(fibaro:getValue(1153, "secured")) == 255 )

    Manual lock, manual unlock, opend pin user all empty

     

    in docs is written unsecure but I cant find in Block scedule

    //Sjakie

     

    Ok, it seems to be backwards. Usually '0' denotes "closed" and >0 that something is "open". I guess I assumed that secured was the same as closed.

    You still run ER3? I can release an update soon that switches the logic for :isSecure and: isUnsecure

    5 hours ago, luke-js said:

    Hi jgab

     

    I suggest something about Util.dimLight function.

    my dimmer device adjusts percentage ifself when set value.

    I set value 1% on device, device is set as 0%. I set value 2% on device, device is set as 1% ifself. 

    It has 1% lesser value than i set.

     

    i edited function like below.

    if e.v and math.abs(currV - e.v) > 2 then return end -- Someone changed the lightning, stop dimming

     

    or adding function parameter about value difference is better.

    or if you have better way, please improve.

     

    Thanks, 

    I don't think so many devices behave in this way. On the other hand it's probably not a problem to have a small difference as a user interacting with the dimmer switch will change the value more than that.

    I will add the fix in the next release - you are on the HC3 and ER4?

    Link to comment
    Share on other sites

    Jan,

    At this moment my house is on HC2 and ER3

    HC3 I am trying a few things.

    In a few days I am away from home so my arming is happenly on HC2 other whise I should be in shock.

    Options?:

    a) Is it possible to fix in build 89

    b) can you relase a new build?

    c) change next release in HC3,  do nothing on HC2 I will reverse my rules for a proper working and debug.

    I need to prevent that I will adapt on "faulty" rules you change and during my holiday door will open

    Please inform me what you will do or perhaps you have a better idea

    Thanks for your excellent support,

    //Sjakie

    PS; put my heater on hold.

    New system works as in adequate as the old so I need to track the cause first why the RF signal is disapearing sometimes.

    Perhaps I need to change system from RF into Wifi

    Anybody experience with Honeywell T6 wifi?

    Thanks Jan,

    Keep you informed,

    //Sjakie

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