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

How is a time based scene triggered?


Question

Posted

Hi,

 

I've created a number of scenes in blocks and lua on my HC2 but i'm always having a hard time with time/date triggered scenes and i'm using blocks for this and just convert them to lua.

 

The question I have. When creating a scene it should be triggered by something. For example a device like:

 

--[[
%% properties
86 value
%% events
%% globals
--]]
 
But when I'm triggering a scene based on a time/date there isn't any trigger defined(code is converted from blocks).
 
--[[
%% properties
%% events
%% globals
--]]
 
How does it know the scene should start at a given time? Asfar as I understand a scene is only triggered if any of the situations between the --[[ and --]] is matched but for times this is never the case as there are none.
 
Or is it just started when home center starts and looping all the time till it matches a configured time?
 
I hope someone can clarify this to me.

 

5 answers to this question

Recommended Posts

  • 0
Posted

Please login or register to see this attachment.

Please login or register to see this attachment.

Hi Im not an expert, but I use a variable to trigger my scenes,

just made a variable with the text active, and u should make one inavcitve as well.

  • 0
Posted

I am also facing a similar problem HC-4.09, earlier time based scenes were triggered automatically. Now they have stopped triggering. I you find any solution for this please share. It will be of great help.

  • 0
Posted

I am also facing a similar problem HC-4.09, earlier time based scenes were triggered automatically. Now they have stopped triggering. I you find any solution for this please share. It will be of great help.

Sorry, but did you see my reply?, I believe this is a solution?

  • 0
Posted

Time based scenes that don't have any other triggers are usually started when HC starts or when they are saved and loop indefinitely. To keep them running all the time "Do not allow alarm to stop scene while alarm is running" must be ticked otherwise they will stop at first alarm breach and will not start until box is rebooted or scene is saved.

 

Scenes in LUA must have this statement in the header:

 

%% autostart

 

While block scenes must have ticked option "Start when Home Center starts".

 

It is therefore good practice to have only one scene in LUA that loops indefinitely and take care of all time based actions either starting other scenes directly or through changing some global variables like Darkness, TimeOfDay, SeasonState, AlarmClock, etc. If you use BLOCK scenes then you will probably have to make several scenes for the same purpose since BLOCK scenes cannot be complex like scenes made in LUA.

 

For example, if you want some lighting to turn on at sunset, then scene that takes care of time based events will change Darkness global variable at sunset from 0 to 1. This change will trigger other scene(s) that have Darkness for trigger and will turn lighting on. At sunrise this scene will change Darkness from 1 to 0 and scene that is triggered by this change will for example raise all blinds, turn on radio on your favorite station and can wish you good morning and tell you weather forecast for that day.  

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

  • 0
  • Inquirer
  • Posted

    Thank you for the clear explanation. I will try your suggestions in my scenes.

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