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

Good morning,

I've noticed that not all regular expressions work correctly in Fibaro HC3 - especially alternations (the | operator). Possibly other features are affected as well. Can anyone share more details about which regex elements are unsupported or behave differently (and why)?

I'd also like to ask about the maximum delay supported by setTimeout on the HC3 (not the Lite version). Is the delay limit 64-bit? I'm planning to trigger an action once a month, but the required millisecond delay exceeds the 32-bit integer limit, so I'm wondering if that's a problem.

Thanks in advance!

Posted

It's not Fibaro's fault - Lua has it's own limited version they call Lua pattern.

See discussion here

Please login or register to see this link.

 

setTimout has some weird limitation on 32bits, which is strange when HC3 Lua is 64bit. - see discussion here

.

My fibaroExtra has a patched setTimeout that allows for 64 bits times...

  • Thanks 1
  • Topic Author
  • Posted

    It's a pity with no regex alternate | in LUA - it helps much. I hope it's not easy to add.

    But it  seems to be easy to fix setTimeout limitation to a ~25 days. Tis is my version which use, however, original setTimeout. 

    It divide whole delay to defined parts of time (chunk_ms). Parameter <chunk_ms> is only for testing. When not passed - it's set to setTimeout maximum.

    Returns a function used to cancel itself when necessary. So, there's no exact clearLongTimeout function. See example.

    Practically eternal delay is allowed (2^53 − 1 ms = ~285 000 years, still not enough?)

    Please login or register to see this code.

     

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