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


  • 0

Scene converted from blocks to LUA stopped working


Question

Posted

Hello

 

Can someone tell why scene #1 works but not scene #2? Both are made as block scenes and both worked but after converting them to LUA #2 stopped working. 

I tried to add this to make sure I didn´t have to many instances without luck.

Please login or register to see this code.

Scene #1 working

Please login or register to see this code.

Scene #2 not working

Please login or register to see this code.

 

10 answers to this question

Recommended Posts

  • 0
Posted

May I ask you what is device number 13 in your system (switch, sensor?)

 

  • 0
  • Inquirer
  • Posted

    13 is a switch and 155 is a dimmer, both Fibaro

    Please login or register to see this image.

    /monthly_2019_11/image.png.f5aef8d468b0c3e41da9e1ee5f420a77.png" />

     

     

    155 is Toalett: Toa spotlights

    • 0
    Posted (edited)

    Honestly, I don't know how your first scene works, it shouldn't.

    But it's doesn't matter... I think you have change another line

    was  end, 1800000)   to   end, 10000)   , right?

    You must set this line at least for the same time period, deviceLastModification0) >= 1800  that you're looking for, otherwise the scene stops before that (in your case 10000 mSec. or 10 sec.)

    Please change the line back to ( 30 minutes)

    end, 1800000) 

    in both scenes and it should work.

    By the way there is no reason to limit the scene to one instance. It should be 2 instances as created by block scene.

    But it's not makes big different.

    Please let me know it it works?

     

     

    Edited by cag014
    • 0
  • Inquirer
  • Posted (edited)

    No, I haven't changed anything but the first lines about not starting another instance if one is already running and the 10000 is set in both scene ? but I have now removed my extra lines and changed the 10000 line to 1800000.

    Edited by storskogen
    • 0
  • Inquirer
  • Posted (edited)

    Sorry, did a copy-paste error. Pasted the same scene twice. It should be two different scenes. But also found that it had 13 and not 155 in this line.

    Please login or register to see this code.

    My memory must be failing me because I can´t remember that I wrote this scene (copy, paset, change), maybe if I copied the scene as a block, changed the "turn off-device" to 155 but not the initiating device. 

    I now remember that I have had similar problems with another device (1x3kw switch) when switching to LUA. I will investigate that later but for this scene i changed to 1800000 and the line above to 155. Keeping the "countScenes".

    Edited by storskogen
    • 0
    Posted

    Great job, so, everything works as designed?

     

    • 0
  • Inquirer
  • Posted
    On 11/4/2019 at 9:24 AM, cag014 said:

    Great job, so, everything works as designed?

     

     

    No, it did not :( I will erase the LUA scene and create a new blockscene for now. 

    • 0
    Posted (edited)

    Strange, have copied your scene and it works (with different devices IDs)

    Instead of having endless block scene you could try to use All-in-One Scene... as you wish

    Edited by cag014
    • 0
  • Inquirer
  • Posted

    No, I haven´t tried that but I was thinking about starting with a new LUA scene and write everything from scratch, no conversion.

     

    I have thought about a all-in-one-scene but I don´t know how to do that yet and I don´t have the time to learn that right now.

    • 0
  • Inquirer
  • Posted

     

    11 hours ago, cag014 said:

    Strange, have copied your scene and it works (with different devices IDs)

    Instead of having endless block scene you could try to use All-in-One Scene... as you wish

     

    I made a last try, I copied the working scene and changed the device id and now its working :) why didn´t I do that before ?

    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
    Answer this question...

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