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
alkorsi 1
Hi all,
I really would need your help. I have a keyfob with 4 keys. If key 1 is pushed a global variable is set to "On" that triggers a scene to arm some window sensors. If key 3 is pushed this global variable is set to "Off" that triggers a scene to disarm these sensors. For the first time it seems to work as expected but all following pushes (doesn´t matter if 1 or 3) don´t set the global variables accordingly and therefore arming and disarming doesn´t work. Do I have to "close" or "end" this LUA based scene anyhow at the end? Or is something else wrong?
here is my code:
--[[
%% properties
133 sceneActivation
%% globals
--]]
local id= 133; -- Doppeltaster
local name = fibaro:getName(id);
fibaro:debug(name);
ActiveSceneId =tonumber(fibaro:getValue(id, "sceneActivation"));
fibaro:debug(ActiveSceneId);
if ( tonumber(fibaro:getValue(id, "sceneActivation")) == 11)
-- button 1, single press - Activate AlarmModus Stufe 1
then
fibaro:setGlobal("AlarmModus", "An");
fibaro:setGlobal("AlarmModusStufe1", "An");
end
if ( tonumber(fibaro:getValue(id, "sceneActivation")) == 31)
-- button 3, single press - Deactivate AlarmModus Stufe 1
then
fibaro:setGlobal("AlarmModus", "Aus");
fibaro:setGlobal("AlarmModusStufe1", "Aus")
end
local alarmModus = fibaro:getGlobalValue("AlarmModus");
fibaro:debug(alarmModus);
local alarmModusStufe1 = fibaro:getGlobalValue("AlarmModusStufe1");
fibaro:debug(alarmModusStufe1);
thanks and cheers,
alkorsi
4 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.