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 (edited)
 
 rule([[Livingbath_door:safe =>||inlivingBathroom==true & Livingbath_Temp:temp >= 22 & Livingbath_sensor:last<=3 >> wait(00:00:20); Livingvent:on]])   
 
Not working
 
 rule([[Livingbath_door:safe =>||inlivingBathroom==true & Livingbath_Temp:temp >= 22 & Livingbath_sensor:last<=3 >> Livingvent:on]])   
 
wait(00:00:20);

Wait delete to work

 

 

Edited by minsad79
Posted (edited)
 
 rule([[Livingbath_door:safe =>||inlivingBathroom==true & Livingbath_Temp:temp >= 22 & Livingbath_sensor:last<=3 >> wait(00:00:20); Livingvent:on]])   
 
Not working
 
 rule([[Livingbath_door:safe =>||inlivingBathroom==true & Livingbath_Temp:temp >= 22 & Livingbath_sensor:last<=3 >> Livingvent:on]])   
 
wait(00:00:20);

Wait delete 

work

 

 rule("Livingbath_door:breached =>||inlivingBathroom==false >> wait(00:03); Livingvent:off"
 
Not working
 
 
Not displayed but an error
 
 
Edited by minsad79
Posted
On 2020. 3. 11. at 오전 10시 50분, minsad79 said:
 
 
[DEBUG] 14.03.2020 01:59:50: [L] Rule:65[615:central.keyId=='3' & Tablelight:isOn => MealTime =false;  Tablelight:off] = OK
[DEBUG] 14.03.2020 01:59:50: [L] Rule:66[#UI{name='$name'} => log('Clicked:%s',name)] = OK
[DEBUG] 14.03.2020 01:59:50: --------------------------------------------- Running  ---------------------------------------------
[DEBUG] 14.03.2020 01:59:50: [Sys] Polling for triggers..
Program completed in 1.69 seconds (pid: 5883).
EventRunner4.lua:2733: attempt to index upvalue 'EventCache' (a nil value)
stack traceback:
    EventRunner4.lua: in function 'pollEvents'
    EventRunner4.lua:2749: in function '_pollForTriggers'
    EventRunner4.lua:2780: in function 'cont'
    EventRunner4.lua:2787: in function 'cont'
    EventRunner4.lua:1450: in function 'installExternalModules'
    EventRunner4.lua:2768: in function 'initEventExtension'
    EventRunner4.lua:2792: in function 'onInit'
    fibaroapiHC3.lua:1085: in function 'fun'
    fibaroapiHC3.lua:538: in function 'start'
    fibaroapiHC3.lua:2981: in function 'start'
    EventRunner4.lua:2797: in main chunk
Debugging session completed (traced 0 instructions).
 
 
 
 

er4 in use

Error content here

Can you fix it?

 

 

  • Topic Author
  • Posted
    40 minutes ago, minsad79 said:

     

    Weekend coming up - will look at it ?

    Guest kallecux
    Posted

    Hello @jgab can you please give me the information how to react on pushing the walli switch in the different ways (1x, 2x, 3x, etc.)?

    Corona-Free Greetings!

     

  • Topic Author
  • Posted
    12 minutes ago, kallecux said:

    Hello @jgab can you please give me the information how to react on pushing the walli switch in the different ways (1x, 2x, 3x, etc.)?

    Corona-Free Greetings!

     

    I believe that the Walli switches sends a 'CentralSceneEvent' when you interact with them. I don't have or have seen a Walli so this is guessing.

    If so, try this.

    In the header declare the id of the wall switch under %% events (replace 5 with your id)

    Please login or register to see this code.

    Make a rule that looks like this

    Please login or register to see this code.

    Have a look at the log when you click various keys.

    I believe that there should be a field 'keyId' and a field 'keyAttribute'

    Ex. If there is a keyId==2 then you can do a rule like below to turn on a another lamp when key 2 is pressed-

    Please login or register to see this code.

    etc.

    Let me know if it works.

    Guest kallecux
    Posted (edited)

    Thank you @jgab - this was the perfect hint!

     

    Here are the different results:

    [DEBUG] 15.03.2020 13:04:44: [D] [{"keyId":1,"deviceId":279,"keyAttribute":"Pressed"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:04:47: [D] [{"keyId":1,"deviceId":279,"keyAttribute":"Pressed2"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:04:50: [D] [{"keyId":1,"deviceId":279,"keyAttribute":"Pressed3"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:04:53: [D] [{"keyId":1,"deviceId":279,"keyAttribute":"HeldDown"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:04:55: [D] [{"keyId":1,"deviceId":279,"keyAttribute":"Released"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:04:58: [D] [{"keyId":2,"deviceId":279,"keyAttribute":"Pressed"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:05:00: [D] [{"keyId":2,"deviceId":279,"keyAttribute":"Pressed2"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:05:03: [D] [{"keyId":2,"deviceId":279,"keyAttribute":"Pressed3"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:05:06: [D] [{"keyId":2,"deviceId":279,"keyAttribute":"HeldDown"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

    [DEBUG] 15.03.2020 13:05:08: [D] [{"keyId":2,"deviceId":279,"keyAttribute":"Released"}]>>'Rule:37[279:central => log('Walli clicked:%s',279:central)]'

     

    Different reaction on specific click:

    rule("279:central.keyId==2 & 279:central.keyAttribute=='Pressed2' => log('Doppelt')")

     

    Thank you very much for your good work!

    Karl Heinz 

    Edited by kallecux
    Guest kallecux
    Posted

    Hello @jgab do you have some short information how to react with nodered to ER4 on HC3?

    Greeting!

  • Topic Author
  • Posted (edited)

    Small update on ER4

    Please login or register to see this attachment.

    and a note on Nodered.

    In ER4 there are example rules

    Please login or register to see this code.

    It connects to the flow at /ER_HC3 (should probably be ER4 :-) )

    and sends an event of type echo1.

    Then a rule is defined to trigger on the receiving event coming back from Nodered (echo1 again)

    The flow on Nodered looks a bit different than with HC2.

    Please login or register to see this attachment.

    Flow:

    Please login or register to see this spoiler.

     

    This is a test flow and we only use the "async" flow currently with ER4.

    The example flows answers to {type='echo1'} and {type='echo2'}

    There is also a manual test to send directly to ER4 - remember to set IP address.

     

    The way we interact now with QA's from Nodered is to call POST on  "/devices/<deviceID>/action/fromNodeRed" and event

     

    Edited by jgab
    Guest kallecux
    Posted

    This is OK:

    Nodered.post({type='echo',value=42})

     
    this is not OK:
    rule("@@00:00:10 => Nodered.post({type='echo',value=42})")
     
    i get:
    [DEBUG] 17.03.2020 12:56:54: [ERROR] in 'Rule:26[@@00:00:10 => Nodered.post({type='echo',value=42})]': {"msg":"Error executing instruction:'["%aref",1,"post"]'","src":"Rule:26[@@00:00:10 => Nodered.post({type='echo',value=42})]","ERR":true,"err":"./quickApp.lua:2083: attempting to index non table with key:'post'"}

     

  • Topic Author
  • Posted
    7 minutes ago, kallecux said:

    This is OK:

    Nodered.post({type='echo',value=42})

     
    this is not OK:
    rule("@@00:00:10 => Nodered.post({type='echo',value=42})")
     
    i get:
    [DEBUG] 17.03.2020 12:56:54: [ERROR] in 'Rule:26[@@00:00:10 => Nodered.post({type='echo',value=42})]': {"msg":"Error executing instruction:'["%aref",1,"post"]'","src":"Rule:26[@@00:00:10 => Nodered.post({type='echo',value=42})]","ERR":true,"err":"./quickApp.lua:2083: attempting to index non table with key:'post'"}

     

    Sorry, 

    in the beginning of the code there are lines

    Please login or register to see this code.

    Remove the last ,Nodered from the local declaration and it should work. Will fix in next version.

    Guest kallecux
    Posted

    OK - it works! Thank you!

    Guest kallecux
    Posted

    Hi @jgab, sometimes i get this error on HC3 with ER4:

     

    Error in setTimeout (line:460): attempt to index a nil value (field 'caccessControlEvent')

     

    I can not identify why. Maybe in this context:

    rule("trueFor(00:15,Badezimmer.MS_Bewegung:safe) => fibaro.call(Badezimmer.Lampe,'turnOff'); log('Badezimmerlicht ausgeschaltet.')")

     

    Greetings

  • Topic Author
  • Posted
    14 minutes ago, kallecux said:

    Hi @jgab, sometimes i get this error on HC3 with ER4:

     

    Error in setTimeout (line:460): attempt to index a nil value (field 'caccessControlEvent')

     

    I can not identify why. Maybe in this context:

    rule("trueFor(00:15,Badezimmer.MS_Bewegung:safe) => fibaro.call(Badezimmer.Lampe,'turnOff'); log('Badezimmerlicht ausgeschaltet.')")

     

    Greetings

    Ouch, some spelling errors... Do you have any locks or keyboard panels? accessControlEvents usually come from them.

    Anyway, I fixed it and uploaded to my GitHub (EventRunner4.lua - fix 7) 

    ER4 is still in a flux so I'm not doing any "official release" yet, but I will upload fixes to my GitHub as they evolve during the week.

    My 'fibaroapiHC3.lua' project is becoming stable enough to support debugging and development of EventRunner4 so I expect it to pick up speed now...

    Guest kallecux
    Posted

    Yes, i have an intercom - thats the reason - thanks for your response!

     

    Posted

    Hi jgap

    Thanks for your update

    I have another problem

    Please login or register to see this attachment.

     

    Please login or register to see this attachment.

     

     

    The rule is this

     

    Rule.load([[ 
    -- fibaro swipe
     
    831:central.keyId=='1'  => log('Key 1 pressed')
     
    831:central.keyId=='2'  =>  log('Key 2 pressed')
     
    831:central.keyId=='3'  => httpGet('http://12.10.79.115/apps/api/1484/devices/1831/open?access_token=a421fe15-5f3a-466b-a039-ea13a9272f1f'); log('Key 3 pressed'
     
    831:central.keyId=='4'  => httpGet('http://12.10.79.115/apps/api/1484/devices/1831/close?access_token=a421fe15-5f3a-466b-a039-ea13a9272f1f'); log('Key 4 pressed')]]) 
     
     
    Thanks

     

    Guest kallecux
    Posted

    Hi @jgab - i think about logging the debug information and some individual information into a database or textfile via nodered.

     

    So i can check what is happening in  my house over a long time. Is there a way to extend your debug function with something like a hook to an individual function to handle the debug information if wanted?

     

    Maybe the information can be structured like CSV to import in EXCEL or so.....I could also cut up the data to prepare it as a CSV like this:

    [DEBUG];19.03.2020;08:13:57;[L];Rule:16;[@sunset-00:15 => fibaro.call(Haus.Lichtsteuerung, 'Abend','On')];OK

     

    What do you think about it - could it be a useful extension? 

     

    Greetings!

    Karl Heinz 

  • Topic Author
  • Posted
    3 minutes ago, kallecux said:

    Hi @jgab - i think about logging the debug information and some individual information into a database or textfile via nodered.

     

    So i can check what is happening in  my house over a long time. Is there a way to extend your debug function with something like a hook to an individual function to handle the debug information if wanted?

     

    Maybe the information can be structured like CSV to import in EXCEL or so.....I could also cut up the data to prepare it as a CSV like this:

    [DEBUG];19.03.2020;08:13:57;[L];Rule:16;[@sunset-00:15 => fibaro.call(Haus.Lichtsteuerung, 'Abend','On')];OK

     

    What do you think about it - could it be a useful extension? 

     

    Greetings!

    Karl Heinz 

    External logging could be a useful extension. I haven't looked into it yet - and there are many options.

    Yes, you can patch ER4's Log function.

    It looks like

    Please login or register to see this code.

    So, it returns the string that it prints out.

    So the way to do it is to write something like (you could also only save logs with a specific flag)

    Please login or register to see this code.

     

     

     

     

  • Topic Author
  • Posted
    3 hours ago, minsad79 said:

    Hi jgap

    Thanks for your update

    I have another problem

    Please login or register to see this attachment.

     

    Please login or register to see this attachment.

     

     

    The rule is this

     

    Rule.load([[ 
    -- fibaro swipe
     
    831:central.keyId=='1'  => log('Key 1 pressed')
     
    831:central.keyId=='2'  =>  log('Key 2 pressed')
     
    831:central.keyId=='3'  => httpGet('http://12.10.79.115/apps/api/1484/devices/1831/open?access_token=a421fe15-5f3a-466b-a039-ea13a9272f1f'); log('Key 3 pressed'
     
    831:central.keyId=='4'  => httpGet('http://12.10.79.115/apps/api/1484/devices/1831/close?access_token=a421fe15-5f3a-466b-a039-ea13a9272f1f'); log('Key 4 pressed')]]) 
     
     
    Thanks

     

    Is it your own provided httpGet function? Can you post the definition?

    Posted
    5 minutes ago, jgab said:

    Is it your own provided httpGet function? Can you post the definition?

     

    Hi gap

    I got it from er3

    under 

     

     

    function httpGet(url)
      local http = net.HTTPClient()
      http:request(url, {
          options = { method = 'GET' },
          success =function() fibaro:debug(url.." ,done."end,
          error = function(errorcode) fibaro:debug("error=" .. errorcode) end
        })
    end
     
     

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