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
amatt 5
before upgrading to the latest Beta I had a simple scene that turned on and off my desk light whenever I sat down or got up (see below). this does have Hue light Bulbs.
if
tonumber(fibaro:getValue(189, "value")) == 0
then
fibaro:call(118, "setSlider", "2", "100")
fibaro:debug("Desk Light on");
elseif
tonumber(fibaro:getValue(189, "value")) == 1
then
fibaro:call(118, "setSlider", "2", "0")
fibaro:debug("Desk Light off");
end
since upgrading now when I sit down the light does not come on ( I did not change any code). so I changed the code to this to make the light come on every 10 seconds. I don't want it to check every 10 seconds I want it to be instant like before I upgraded. Can anyone help? ps. if this code can be redone entirely please let me know how I am not the best at coding yet I am trying my best. thank you!
--[[
%% autostart
%% globals
--]]
fibaro:debug("Waiting...")
while true do
if
tonumber(fibaro:getValue(189, "value")) == 0
then
fibaro:call(118, "setSlider", "2", "100")
fibaro:debug("Desk Light on");
fibaro:sleep(10000);
elseif
tonumber(fibaro:getValue(189, "value")) == 1
then
fibaro:call(118, "setSlider", "2", "0")
fibaro:debug("Desk Light off");
fibaro:sleep(10000);
end
end
Link to comment
Share on other sites
16 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.