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

scripting wakeUp scene


Question

Posted

Hi all,

I've been spending some time scripting a scene that starts my devices in the morning, one by one, each with a time delay so it turns on at exactly the right time.

Here are some of my questions/problems I'm encountering while scripting (this and other) scripts:

My script will get started based on a time (wakeUpTime), but other than that there's an "autostart" and "other" trigger mechanism, can anyone explain me what it does exactly, can't seem to find a conclusive answer for this.

And following this question, are they essential?

Because of these different start mechanisms, I've tried to construct my action in a function(). To prevent repeating a lot of code within each trigger.

This function also gives me some problems, the function wakeUp() ... end works fine when it gets called indicated with the ******* in the script.

Then the function executes without problems, but if I try to use this function later on where the trigger is "other" I get an error: [ERROR] 15:38:47: line 32: attempt to call global 'wakeUp' (a nil value)

And my last question for now is about the tempFunc, is this just to restart the scene each 60s?

I hope someone can clarify some of my questions for me...

Thanks anyway;)

Please login or register to see this code.

3 answers to this question

Recommended Posts

  • 0
Posted

sourceTrigger["type"] tells you about the action that triggered scene - for example other will apply when you started it manually and autostart is true if you choose to run scene at the boot of controller.

tempFunc() is empty and it will not took any effect in the given timeout, so it is quite pointless if I did not miss anything. You should simply start your scene at boot of controller, then get all the actions into one function with 60s timeout. Inside check for the proper hour.

  • 0
Posted

Please login or register to see this code.

Please login or register to see this code.

What for is this line?

  • 0
Posted

Lesław, In the pietervanstee code, used in the wakeUp function to compare day...

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