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)

@jgab this trigger does't work

Please login or register to see this code.

used  58%

buffer 6%

Cache 26%

free 10%

present in use 89 %

With those numbers it should restart?

Edited by Sjakie
add %
  • Topic Author
  • Posted
    8 hours ago, Sjakie said:

    @jgab this trigger does't work

    Please login or register to see this code.

    used  58%

    buffer 6%

    Cache 26%

    free 10%

    present in use 89 %

    With those numbers it should restart?

    No, .used is 58

     

    Cache and buffer should not be counted as the system at any time can release it if it needs more memory.

    The gauge in the web UI shows used+buffer+cache but clearly marks out what part of that is actually used (58)

    • Like 1
    Posted

    Hello jgab,

    I transferred my rules from ER4 to ER5. In ER4 I had

    Please login or register to see this code.

    to calculate the average outside temperature of my 3 sensors. This rule no longer works in ER5.

    What am I doing wrong?

     

    Thanks for help 😀

  • Topic Author
  • Posted (edited)
    3 hours ago, KaWi said:

    Hello jgab,

    I transferred my rules from ER4 to ER5. In ER4 I had

    Please login or register to see this code.

    to calculate the average outside temperature of my 3 sensors. This rule no longer works in ER5.

    What am I doing wrong?

     

    Thanks for help 😀

     

    Hi, thanks for finding this out. In ER5 '@' and '@@' has higher priority than '+' (and other arithmetic operators) so you need to put it in parentheses , like this

    I have to think about it, if I'm changing it... However, the error message we got was bad so that I will improve to next release.

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

     

    Hi, thanks for finding this out. In ER5 '@' and '@@' has higher priority than '+' (and other arithmetic operators) so you need to put it in parentheses , like this

    I have to think about it, if I'm changing it... However, the error message we got was bad so that I will improve to next release.

    Sorry, this is not the problem and it works like before...

    @KaWi

    So, I can't see the problem.

    In what way doesn't it work?

    crash or calculating the wrong value or ?

    Posted

    I tested it a long time ago in a early version of ER5. At that time the rule was not initialized and I continued to run it in ER4.

    Now it seems to be running in ER5 too. Why? I have no idea.

    But it works. That's what counts.

     

    Thanks for testing anyway

     

    • Like 1
    Posted
    On 12/14/2023 at 3:26 PM, jgab said:

    Please login or register to see this code.

    @jgab Jan is this "ask" function built in already?

    Posted (edited)
    On 11/17/2023 at 7:23 AM, jgab said:

    Please login or register to see this code.

    @jgab Jan please, help

    me out..How to formulate a HTTP post in ER5? I cant find what syntax should be used for data. How to form this http call below please?

     

     

     

    Please login or register to see this code.

     

    how to understand this part

     

    Please login or register to see this code.

     

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

    @jgab Jan please, help

    me out..How to formulate a HTTP post in ER5? I cant find what syntax should be used for data. How to form this http call below please?

     

     

     

    Please login or register to see this code.

     

     

     

    net.post(<url>,<options>,<data>)

    and data is the Lua table - resquestStr in your case.

    Ex.

    rule("local res, stat = http.post('http://192.168.100.178:1880/cast',{},{text = message_to_sent, targetip = tostring(value),volume = local_volume,language = local_language})

    Posted
    4 minutes ago, jgab said:

     

    net.post(<url>,<options>,<data>)

    and data is the Lua table - resquestStr in your case.

    Ex.

    rule("local res, stat = http.post('http://192.168.100.178:1880/cast',{},{text = message_to_sent, targetip = tostring(value),volume = local_volume,language = local_language})

    Ahh okay you had a typo in description, btw i got still an error

     

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

  • Topic Author
  • Posted
    5 minutes ago, Neo Andersson said:

    Ahh okay you had a typo in description, btw i got still an error

     

    Please login or register to see this code.

     

    Please login or register to see this attachment.

     

    Please login or register to see this code.

     

    Posted
    7 minutes ago, jgab said:

    Please login or register to see this code.

     

    Still errors, now in Nodered..

    "SyntaxError: Unexpected token o in JSON at position 1"

     

    Outside of ER5 i always use the json encoded requeststring, so I though that can be the problem..I tried with the encoded string, but then nodered does not even get the call

  • Topic Author
  • Posted
    6 minutes ago, Neo Andersson said:

    Still errors, now in Nodered..

    "SyntaxError: Unexpected token o in JSON at position 1"

     

    Outside of ER5 i always use the json encoded requeststring, so I though that can be the problem..I tried with the encoded string, but then nodered does not even get the call

    Unsure were the problem is - 

    in the file builtins at line 583

    Please login or register to see this code.

    put some debug statements before to see what the json encoded data looks like. See if it looks strange.

    What status do you get back from

    Please login or register to see this code.

    stat is the status value.

    4 minutes ago, jgab said:

    Unsure were the problem is - 

    in the file builtins at line 583

    Please login or register to see this code.

    put some debug statements before to see what the json encoded data looks like. See if it looks strange.

    What status do you get back from

    Please login or register to see this code.

    stat is the status value.

    debug on Nodered's side to see what the payload is before decoding.

    Posted (edited)
    10 minutes ago, jgab said:

    Unsure were the problem is - 

    in the file builtins at line 583

    Please login or register to see this code.

    put some debug statements before to see what the json encoded data looks like. See if it looks strange.

    What status do you get back from

    Please login or register to see this code.

    stat is the status value.

    Please login or register to see this code.

    This is the encoded requeststring

     

    stat is 400 when using the encoded string and 200 if using the single requestString..but even with 200 i am getting the error from nodered. I am using the same data when posting simply with fibaro net.HTTPClient

     

     

    4 minutes ago, Neo Andersson said:

    Please login or register to see this code.

    This is the encoded requeststring

     

    stat is 400 when using the encoded string and 200 if using the single requestString..but even with 200 i am getting the error from nodered. I am using the same data when posting simply with fibaro net.HTTPClient

     

     

    @jgab Jan can it be that mp3name=nil is not posted in ER5 because its nil?

     

    UDATE: i tested it with not nil mp3name, still the same

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

    Please login or register to see this code.

    This is the encoded requeststring

     

    stat is 400 when using the encoded string and 200 if using the single requestString..but even with 200 i am getting the error from nodered. I am using the same data when posting simply with fibaro net.HTTPClient

     

     

    Show me the whole code including the definition of requestStr. What do you mean by "encoded string" vs "single requestString" ?

    Posted
    Just now, jgab said:

    Show me the whole code including the definition of requestStr. What do you mean by "encoded string" vs "single requestString" ?

     

    Please login or register to see this code.

     

     there is a variable

    Please login or register to see this code.

    it is just the encoded requestString. This is how it needs to be called. And it is working.

     

    For some reason, in ER5 it gets some strange Json formatted output. This is my guess, becuase regularly its working

  • Topic Author
  • Posted
    6 minutes ago, Neo Andersson said:

     

    Please login or register to see this code.

     

     there is a variable

    Please login or register to see this code.

    it is just the encoded requestString. This is how it needs to be called. And it is working.

     

    For some reason, in ER5 it gets some strange Json formatted output. This is my guess, becuase regularly its working

    mp3name = nil will just remove that entry from the table.

     

    http.post is equivalent to the lua code you show me.

    Can you post the rule you call too?

    Posted
    1 minute ago, jgab said:

    mp3name = nil will just remove that entry from the table.

     

    http.post is equivalent to the lua code you show me.

    Can you post the rule you call too?

    I have tried with mp3Name not nil version, but still the same, here is my test call

    Please login or register to see this code.

     

  • Topic Author
  • Posted

    I've been running this to other servers and identical code is used in the ER5 Nodered integration.

    I'm just testing it against another server and it works well - I think the problem is on the Nodered side - how do you decode the data?

    Please login or register to see this code.

    Please login or register to see this code.

     

    Posted (edited)
    6 minutes ago, jgab said:

    I've been running this to other servers and identical code is used in the ER5 Nodered integration.

    I'm just testing it against another server and it works well - I think the problem is on the Nodered side - how do you decode the data?

    Please login or register to see this code.

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    I cant get it..I am using this code years, without a problem..How is this possible

    Edited by Neo Andersson

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