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 runs constantly instead of once at sunset


patfel

Question

This scene keeps running when I don't expect it to. Within 1 minute after I switch off all lights, this scene runs and the lights (devices 11 and 35) turn on. Very frustrating. It is supposed to run once per day at sunset. I use the following graphical block code, and have ticked the "Autorun when HC2 starts" option.

 

The auto generated Lua code looks like this: It appears as if the second block might be executing as it checks for day of the week, but not the time of day? Any ideas what is going on here? Why is this scene running all the time?

 

Thanks for your help!

Please login or register to see this code.

 

 

Please login or register to see this attachment.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

yeah, did this LUA come from converting from Blocks? Its written quite odd.

this script will run from autostart, and also with any other trigger like the button press and then turn lights on..

Link to comment
Share on other sites

  • 0

Hi @patfel

 

The problem is caused by the "or  true" that has been added to the end of the If statements, and as a result the code will always run every minute.  To my mind, this looks like a bit of a bug in the block scene generator, but @Fibaro may disagree.

 

What I suggest you do is to write two block scenes: one triggered by sunset, and the other triggered by the remote control button.  That way there won't be any conflict between the two.

 

Dave

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Yes @shaunfrost the code is autogenerated. Thanks @Dave Harrison, I will try your suggestion.

    Yes that solved the problem. Here is the new auto generated code. What is the "StartSource == other" code at the end? Will this turn the lights on when the HC2 restarts? That would be unwanted behaviour also.

     

    Thanks again for your help.

    Please login or register to see this code.

     

    Edited by patfel
    Link to comment
    Share on other sites

    • 0

    the

    Please login or register to see this code.

    block is auto-generated to permit the start of the scene using the "play" button in the interface. So you can run the scene manually if you want to. Otherwise the scene will run the tempFunc() if started with the autorun.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 8 hours ago, redsave said:

    the

    Please login or register to see this code.

    block is auto-generated to permit the start of the scene using the "play" button in the interface. So you can run the scene manually if you want to. Otherwise the scene will run the tempFunc() if started with the autorun.

     

    thanks @redsave. It's a pity the graphical code is buggy. Perhaps I should invest the time to learn Lua and code it myself. Look at the Lua code auto generated for the remote button 3!

     

    Please login or register to see this code.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Yes you should learn LUA :) I don't have any block scene, it's a mess... LUA is not so difficult to learn, you can do it!

    Link to comment
    Share on other sites

    • 0

    I had similar problems with a scene this weekend (behaved like the useless machine ;-) ).

    I created a variable and have a scene, setting this variable at noon (can be any time) to the value 0 (meaning scene has not been executed). The scene being run once only (90 min before sunset) checks the variable for the value 0 and only then does the "then" and sets the variable to 255 ( any value other than 0 would work).

    I also tried with the predefined variables, having a variable with values 0 and 1 but somehow this did not work. Should basically be the same, but behaved identical to the useless machine.

    I hope you get the point.

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