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

@jgab

Could be possible to add support for “Initial events”?

Sometimes there is need to have initial value for triggers (mainly “For” statement)

 

I can do it via getvalue but direct support could be even better. I think it could be possible to parse %%properties part of scene if there will be anything then to generate similar event via getvalue after starting scenes and setting all rules. There should be also possibility to switch off this function.

 

Link to comment
Share on other sites

  • Topic Author
  • If I run this offline (can't test on the HC2 at the moment)

    Please login or register to see this code.

    I get this output, which seems ok. Btw, I pushed a new version, which I don't think should affect redaily.

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, petrkl12 said:

    @jgab

    Could be possible to add support for “Initial events”?

    Sometimes there is need to have initial value for triggers (mainly “For” statement)

     

    I can do it via getvalue but direct support could be even better. I think it could be possible to parse %%properties part of scene if there will be anything then to generate similar event via getvalue after starting scenes and setting all rules. There should be also possibility to switch off this function.

     

     

    You have an example?

    I guess there are 'for' rules one would like to trigger so that it realised that the expression was true and started to monitor it. There are ways to do it with trigger variables.

    Please login or register to see this code.

    trigger variables start with '_' and if part of the left-hand side of a rule will trigger the rule when changed. Like fibaro globals, but local to the scene.

    As you say, you don't want to do this always.

    Link to comment
    Share on other sites

  • Topic Author
  • Was it sending events to node-red, or receiving. events from node-red?

    To receive events from node-red the variable _EVENTSERVER has to be true. That changed around that version.

    if it’s sending events to node-red it’s more strange. Will see if I can do some tests tomorrow.

    Link to comment
    Share on other sites

    9 hours ago, jgab said:

    Was it sending events to node-red, or receiving. events from node-red?

    To receive events from node-red the variable _EVENTSERVER has to be true. That changed around that version.

    if it’s sending events to node-red it’s more strange. Will see if I can do some tests tomorrow.

    Yes, _EVENTSERVER is true. it is by default when i check file on github.

    No hurry Jan, take care of your health first.

    Link to comment
    Share on other sites

    Did test with ZBS studio and this is what i got on 1.12

    Please login or register to see this code.

    Should then do this:

    Please login or register to see this code.

    but nothing happens

    Link to comment
    Share on other sites

  • Topic Author
  • 25 minutes ago, jompa68 said:

    Did test with ZBS studio and this is what i got on 1.12

    Please login or register to see this code.

    Should then do this:

    Please login or register to see this code.

    but nothing happens

    That's strange, I repeated your setup and I get the rule triggered.

    For you the event is posted, it looks ok, but it doesn't match the rule. Nothing has happened in that part of the code for a year. Should we suspect some strange characters again? On the other hand you say it works with earlier version of EventRunner...

    Can you do this test? There is a function called self._handleEvent(e) that you could put a debug line into. It will print the event, and the rule it is matching against, and the result. If we condition that on only "alexa" events we can see what happens. The result should be an empty table '{}'. If it fails the result is 'false'

    The line to add is "if e.type=='alexa' then Log(LOG.LOG,..."

    Please login or register to see this code.

    I'm slowly recovering and have stopped hallucinating about EventRunner :) 

    Link to comment
    Share on other sites

    W dniu 29.01.2019 o 09:32, jgab napisał:

    If I run this offline (can't test on the HC2 at the moment)

    Please login or register to see this code.

    I get this output, which seems ok. Btw, I pushed a new version, which I don't think should affect redaily.

    Please login or register to see this code.

     

    1

     

    tested, works great with new fix:) 

    Edited by domin12
    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    That's strange, I repeated your setup and I get the rule triggered.

    For you the event is posted, it looks ok, but it doesn't match the rule. Nothing has happened in that part of the code for a year. Should we suspect some strange characters again? On the other hand you say it works with earlier version of EventRunner...

    Did start from new fix3 now and that does work with my rules, strange....

    So case closed, sorry Jan if i did stress you this morning :-)

    Link to comment
    Share on other sites

    Hi @jompa68

    Are you still using IOSLocator ? 

    I have some problems with this, on ZBS works fine, but on HC2 I've got an error:

    [DEBUG] 09:44:32: 2019-01-30 09:44:32.501455 [ error] timer handler failed with error: /opt/fibaro/scenes/398.lua:117: attempt to index field 'result' (a nil value)

    Have You met with this? 

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, domin12 said:

    Hi @jompa68

    Are you still using IOSLocator ? 

    I have some problems with this, on ZBS works fine, but on HC2 I've got an error:

    [DEBUG] 09:44:32: 2019-01-30 09:44:32.501455 [ error] timer handler failed with error: /opt/fibaro/scenes/398.lua:117: attempt to index field 'result' (a nil value)

    Have You met with this? 

     

     

    You seem to be getting some strange result back. Try to uncomment the Log line in iOSLocator

    Please login or register to see this code.

    ..and see what result you get. The code that breaks assume there is a result field and somehow it seems to be nil...

    Can you also verify that line 117 is the second line in

    Please login or register to see this code.

     

    Edited by jgab
    • Thanks 1
    Link to comment
    Share on other sites

    Hi @jgab
    Thanks for the quick answer,

    in the script, is "local _test = true                -- use local HomeTable variable instead of fibaro global"

    if I have true then HomeTable will be taken from the script in HC2 (from scene)?

    checked this what You propose, and my hometable is empty. :( 

     

    Edited by domin12
    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, domin12 said:

    Hi @jgab
    Thanks for the quick answer,

    in the script, is "local _test = true                -- use local HomeTable variable instead of fibaro global"

    if I have true then HomeTable will be taken from the script in HC2 (from scene)?

    checked this what You propose, and my hometable is empty. :( 

     

    Do you get the configuration data (hometable) from the local in the script or from a fibaro global?

    In the latter case did you set _deviceTable to the name of the fibaro global ?

    • Thanks 1
    Link to comment
    Share on other sites

    Teraz, jgab napisał:

    Do you get the configuration data (hometable) from the local in the script or from a fibaro global?

    In the latter case did you set _deviceTable to the name of the fibaro global ?

     

    I'd like to get it from local, but it does not work from HC2.

    this is my setup:

     

    Please login or register to see this code.

    and in debug, windows got this 

     

    [DEBUG] 11:57:02: 2019-01-30 11:57:02.739062 [ error] timer handler failed with error: /opt/fibaro/scenes/398.lua:141: attempt to index global 'LOG' (a nil value)

    Link to comment
    Share on other sites

  • Topic Author
  • 12 minutes ago, domin12 said:

    and in debug, windows got this 

     

    [DEBUG] 11:57:02: 2019-01-30 11:57:02.739062 [ error] timer handler failed with error: /opt/fibaro/scenes/398.lua:141: attempt to index global 'LOG' (a nil value)

     

    Sorry, EventRunnerLite that this scene is based on doesn't have Log().

    Please login or register to see this code.

    It should be Debug(). I have changed it in the previous post.

     

    Right after function main(sourceTrigger)

    there is the part that gets the config data, try adding a debug line there too to see what you get.

    Please login or register to see this code.

     

    • Thanks 1
    Link to comment
    Share on other sites

    12 minut temu, jgab napisał:

     

    Sorry, EventRunnerLite that this scene is based on doesn't have Log().

    Please login or register to see this code.

    It should be Debug(). I have changed it in the previous post.

     

    Right after function main(sourceTrigger)

    there is the part that gets the config data, try adding a debug line there too to see what you get.

    Please login or register to see this code.

     

    I built additional hometables only for the location, I added the same entries as in the scene and it works, I don't know why this works but with local hometable not .

    but if we are talking about it, how to get location from it and put to VD, is there a simple way ?

    Link to comment
    Share on other sites

  • Topic Author
  • 5 minutes ago, domin12 said:

     

    but if we are talking about it, how to get location from it and put to VD, is there a simple way ?

     

    IOSlocator will only send events to other EventRunner scenes that subscribe on the events. I guess the easiest way is to have an eventrunner scene that triggers on location events and update a VD label or labels.

    Edited by jgab
    • Like 1
    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...