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

Question
karaokek 3
Again, looking for a bit of basic help.
I have a variable “sunrise”
2 values, sunrise and sunset
2 time based scenes –
one to set variable value to sunrise
and the other to set variable value to sunset
1 Alarm scene – Breached and Safe
This runs when alarm is armed or unarmed
1 scene, only a test at the moment hence the 5 sec turn off option, which will be run when the alarm is safe/unarmed
i.e. when we come home
Want this scene to switch a light/plug, 8, on – but only if it is after sunset and before sunrise.
Made the scene using graphic blocks – as below
Please login or register to see this image.
/monthly_2018_01/image.png.489e5bb292dc931b9aaabd5db41a24ac.png" width="371" alt="image.png.489e5bb292dc931b9aaabd5db41a24ac.png" />It does not seem to work - light comes on whatever the time is.
LUA code for this
--[[
%% properties
%% weather
%% events
%% globals
sunrise
--]]
local startSource = fibaro:getSourceTrigger();
if (
( fibaro:getGlobalValue("sunrise") == "sunset" )
or
startSource["type"] == "other"
)
then
fibaro:call(8, "turnOn");
setTimeout(function()
fibaro:call(8, "turnOff");
end, 5000)
end
If I delete
or
startSource["type"] == "other"
from the above code the scene works as I would expect.
I have had the same problem, same piece of code, with other Variable based scenes.
I am aware that this is pretty basic stuff but, for a newcomer, pretty confusing.
Thanks, in advance, for any help.
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.