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

Hello 

I wanted a slim one without on keyed function for a script. I have derived some things from the forum and tried but it shows constant gaps in the last number. Example 1,2,4,5, 7 and so on. 

Can anyone send me a post with a reliable radio. 

Die von jgab und cag014 are strongly branched for me. 

Thank you in advance. 

Posted

Sorry, need more info to understand what you want.

Do you have some example code?

  • Topic Author
  • Posted (edited)

    Hello with Google translator the only way to rent me out I hope I can get further.

    I want a simple trigger to then continue on my own.

     

     

    "single instance / event"??? 

    When starting and displaying the last update, it keeps skipping several counters.

     


    [DEBUG] 14:25:43: 17677
    [DEBUG] 14:25:44: 17678
    [DEBUG] 14:25:47: 17680
    [DEBUG] 14:26:00: 17681
    [DEBUG] 14:26:01: 17683
    [DEBUG] 14:26:03: 17685
    [DEBUG] 14:26:04: 17687

     

    [DEBUG] 14:25:35: 17673
    [DEBUG] 14:25:37: 1767

    Please login or register to see this code.

    Thank you in advance. 

    Edited by parip69
    Posted
    36 minutes ago, parip69 said:

    When starting and displaying the last update, it keeps skipping several counters.

    That's normal. You will have multiple results in states.changes

     

    37 minutes ago, parip69 said:

    Please login or register to see this code.

    That won't work, because "lastchanges" only has the last ID of this loop, not every change of the loop:

     

    38 minutes ago, parip69 said:

    Please login or register to see this code.

     

    So I guess what you see PRINTED in debug is correct, but your "if myTrig.id == lastChanges.id then" is not IN the loop so it is not working.

     

    Move your test (and adjust its syntax, to match what you see in the debug window, printed by the "print(json.encode(v))" statement.

     

    This is totally undocumented, that's why you are struggling to make it work. What I am saying is this: you can make it work, but Fibaro might decide to change how it works any time

     

    44 minutes ago, parip69 said:

    Google translator

    Yeah, I thought so.

     

    It is totally unreadable :D

     

    But as soon as you posted "DEBUG] 14:25:43: 17677 [DEBUG] 14:25:44: 17678" I understood what you meant

     

    ?
     

    BTW I posted a similar loop, as demonstration, as a Quick App

     

    Look for the comment

     

    Please login or register to see this code.

    Below that line, you can put your test and decide what to do when that event happens

     

    Hope this helps, at the moment I am unable to try out your code and fix it. Sorry about that.

     

     

     

     

    • Like 1
  • Topic Author
  • Posted (edited)

    Hi.

    I have an HC2. 

    It is working. But I don't get any data out of the for loop. Can you make it a bit more flexible? I wished for a solution for HC3 script.

    Thank you in advance. 

     

     

    Please login or register to see this code.

     

    Edited by parip69
    Posted (edited)
    10 hours ago, parip69 said:

    I have an HC2. 

    I don't have a working HC2 at the moment, it is kind of hard to test.

     

    add a 

     

    print(lc)

     

    after the 

     

    lc = v.data

     

    So we can see if the events have the properties that you expect...

     

    Also a good candidate to add more debugging is in function findID - print everything you get there and tell why it does not match.

     

    BTW what do you want to do? Why use refreshStates? Not many users on this forum do that. I do :D and I have my reasons (a complex lighting scene with lots of conditions.).

     

    If you want to get things done, and learn about "refreshStates" then you can have a look at this scene:

     

     

     

    I do not use the scene myself but I know @cag014well and he has written excellent code that is complex, but readable.

    Edited by petergebruers
    • Thanks 1
  • Topic Author
  • Posted

    Hello petergebruers. 

    That works with the print I get everything. 

    I also know the scene of the @cag14. But don't use it. I would like to code a little myself. That's fun. 

    Unfortunately, I can't write as elaborate code as...... the well-known ones from here. 

    I just need to trigger them and then I'll get along. I also need for a college and it has an HC3 for Scene and not Quick app. 

    Thank you 

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