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

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

Edited by petrkl12
Link to comment
Share on other sites

  • Topic Author
  • 1 minute ago, petrkl12 said:

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

    Yes, it's good because the consumer don't have to stress to free mailboxes for the producers.

    I manage to get 200+ messages with 15-20ms delay without "too many instances" (still can do burst of 9 messages). In the past (the benchmark table I did) we needed ~65ms delay to get 100 messages.

    We may have one global just to signal that there is a new event in the log - it may save some CPU (and unnecessary data structure allocation)for the main  instance. It doesn't have to be lock protected - enough that it changes value when the log should be retrieved and checked.

    Link to comment
    Share on other sites

    On ‎2‎/‎21‎/‎2019 at 12:01 PM, jgab said:

    @jgab, got a problem when running HC2.lua and trying to create the HC2.data file.

     

    Program starting as '"C:\Program Files (x86)\ZeroBraneStudio\bin\lua52.exe" -e "io.stdout:setvbuf('no')" "C:\Users\F\AppData\Local\Temp\.C978.tmp"'.
    Program 'lua52.exe' started in 'C:\Program Files (x86)\ZeroBraneStudio\myprograms' (pid: 89276).
    Debugging session started in 'C:\Program Files (x86)\ZeroBraneStudio\myprograms\'.
    #[HC2]08:35:25, Thu Mar 14: HC2 SceneRunner v0.5 
    #[HC2]08:35:25, Thu Mar 14: Reading configuration from H2C...
    #[HC2]08:35:25, Thu Mar 14: HC2 returned error '302 ' - URL: 'http://192.198.1.118/api/globalVariables/'.
    Program completed in 14.74 seconds (pid: 89276).
    Debugging session completed (traced 0 instructions).

     

    Link to comment
    Share on other sites

  • Topic Author
  • 36 minutes ago, FrankT said:

    @jgab, got a problem when running HC2.lua and trying to create the HC2.data file.

     

    Seems like the emulator can't connect to the HC2. The first thing it tries to do is to read the global variables and it times out and you get an error. Guess it hangs for a while before you get the error?

     

    Link to comment
    Share on other sites

    On ‎2‎/‎21‎/‎2019 at 12:01 PM, jgab said:

    @jompa68 and @jgab

    I have set the ip and HC2_user and HC2_pwd

    _HC2_FILE = "HC2.data"

    _HC2_IP="192.198.1.118"       -- HC2 IP address
    _HC2_USER="xxx@telia.com"     -- HC2 user name
    _HC2_PWD="Hxxxxxxxx"            -- HC2 password

    --local creds = loadfile("credentials.lua") -- To not accidently commit credentials to Github...
    --if creds then creds() end

    --------------------------------------------------------
    -- Main, register scenes, create temporary deviceIDs, schedule triggers...
    --------------------------------------------------------
    function main()

      HC2.setupConfiguration(true,true) -- read in configuration from stored local file, or from remote HC2

      if not _REMOTE or _RUNLOCAL then -- If we are remote don't try to access resources on the HC2
        HC2.localDevices(true) -- set all devices to local
        HC2.localGlobals(true) -- set all globals to local
        HC2.localRooms(true)   -- set all rooms to local
        HC2.localScenes(true)  -- set all scenes to local
      end

    ANd yes it may be a timeout, it hangs for approx 3-4 seconds.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 4 minutes ago, FrankT said:

     

    Can you paste

    Please login or register to see this link.

     into your browser as see if you get a json with your globals back?

     

    Link to comment
    Share on other sites

    3 hours ago, jgab said:

    Yes, it's good because the consumer don't have to stress to free mailboxes for the producers.

    I manage to get 200+ messages with 15-20ms delay without "too many instances" (still can do burst of 9 messages). In the past (the benchmark table I did) we needed ~65ms delay to get 100 messages.

    We may have one global just to signal that there is a new event in the log - it may save some CPU (and unnecessary data structure allocation)for the main  instance. It doesn't have to be lock protected - enough that it changes value when the log should be retrieved and checked.

     

    I’m worry only about potential regular cleaning of log ... some messages could be lost ...

    Link to comment
    Share on other sites

    33 minutes ago, jgab said:

    Can you paste

    Please login or register to see this link.

     into your browser as see if you get a json with your globals back?

     

    Tried it before posting the question to you, works ok without delay.

    Link to comment
    Share on other sites

  • Topic Author
  • 24 minutes ago, petrkl12 said:

     

    I’m worry only about potential regular cleaning of log ... some messages could be lost ...

    Yes, I'm aware of that and will runs some tests to see what's happening when it rolls over. Maybe if the consumer reads often enough? Or if the producer could verify that it was read?

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, FrankT said:

    Tried it before posting the question to you, works ok without delay.

    Can you try this?

    In HC2.lua approx. line 551:  "local vars = api._get(false,"/globalVariables/")"

    If you comment out that line will it succeed with the rest?

     

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Can you try this?

    In HC2.lua approx. line 551:  "local vars = api._get(false,"/globalVariables/")"

    If you comment out that line will it succeed with the rest?

     

    Commented out also line 552 -- --  for _,v in ipairs(vars) do rsrc.globalVariables[v.name] = v c1=c1+1 end

    but the same error 

    [HC2]14:23:29, Thu Mar 14: HC2 SceneRunner v0.5 
    #[HC2]14:23:29, Thu Mar 14: Reading configuration from H2C...
    #[HC2]14:23:29, Thu Mar 14: HC2 returned error '302 ' - URL: 'http://192.198.1.118/api/sections'.
    Program completed in 3.88 seconds (pid: 117700).

     

    Please login or register to see this link.

    pasting in a browser (Opera and Edge) worked ok again.

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Can you try this?

    In HC2.lua approx. line 551:  "local vars = api._get(false,"/globalVariables/")"

    If you comment out that line will it succeed with the rest?

     

    I noticed when I write http://192.168.1.118/api/sections in the Browser it works ok, but when I copied the text

    Please login or register to see this link.

    from ZBS Output window and paste it into the browser it fails with Certificate error 

    Please login or register to see this link.

    (Why HTTPS ?)

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Can you try this?

    In HC2.lua approx. line 551:  "local vars = api._get(false,"/globalVariables/")"

    If you comment out that line will it succeed with the rest?

     

    I'm deeply sorry, my fault. Missed IP-adress !

    Link to comment
    Share on other sites

    2 minutes ago, FrankT said:

    'm deeply sorry, my fault. Missed IP-adress !

    What i did write as answer after your first post. Good that it works now

    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, FrankT said:

    I'm deeply sorry, my fault. Missed IP-adress !

    I was worried there for a while... :> 

    Link to comment
    Share on other sites

    Hi guys 
    Can someone help me integrate miflora with ER  by using NODE RED.

    so far I have flow which produces a message and sends to ER, and it looks like :

    Please login or register to see this code.

    Please login or register to see this image.

    /monthly_2019_03/image.png.57bec3c227e412fd1d90c8d38af2916c.png" />

    in ER I created function based on telegram function :

     

    Please login or register to see this code.

     

     and the rule to see what is comming from nodered:

    Please login or register to see this code.

    but only what i see is 

    [DEBUG] 15:14:00: Flora content:table: 0x86b2858

    how to get values for ex battery from this table ? 

     

    i'm realy appriciated for any help

     

    Edited by domin12
    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, domin12 said:

    Hi guys 
    Can someone help me integrate miflora with ER  by using NODE RED.

    so far I have flow which produces a message and sends to ER, and it looks like :

    Please login or register to see this code.

    Please login or register to see this link.

    in ER I created function based on telegram function :

     

    Please login or register to see this code.

     

     and the rule to see what is comming from nodered:

    Please login or register to see this code.

    but only what i see is 

    [DEBUG] 15:14:00: Flora content:table: 0x86b2858

    how to get values for ex battery from this table ? 

     

    i'm realy appriciated for any help

     

     

    Hi, I pushed a new version of HC2.lua because I may have broken the POST command that node-red uses to post events to the emulator.

    Try that one and we take it from there.

    /J

    3 minutes ago, jgab said:

     

    Hi, I pushed a new version of HC2.lua because I may have broken the POST command that node-red uses to post events to the emulator.

    Try that one and we take it from there.

    /J

    You know that the node-red has changed a bit with the emulator? 

     

    Link to comment
    Share on other sites

  • Topic Author
  • 17 minutes ago, jgab said:

     

    Hi, I pushed a new version of HC2.lua because I may have broken the POST command that node-red uses to post events to the emulator.

    Try that one and we take it from there.

    /J

    You know that the node-red has changed a bit with the emulator? 

    Sorry, pushed wrong version

    Should be "0.5","fix2"     

     

    Link to comment
    Share on other sites

    2 godziny temu, jgab napisał:

    Sorry, pushed wrong version

    Should be "0.5","fix2"     

     

    1

    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 :

    Please login or register to see this code.

    ps. using HomeTable variable

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