-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path188. Yellow button
68 lines (50 loc) · 1.97 KB
/
188. Yellow button
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--[[
%% properties
%% events
503 CentralSceneEvent
%% globals
--]]
local button_source = fibaro:getSourceTrigger()["event"]["data"]
if (tostring(button_source["keyAttribute"]) == "Pressed") then
-- Nattstilling
fibaro:startScene(100);
elseif (tostring(button_source["keyAttribute"]) == "Pressed2") then
-- slår av og på lyset i foreldresoverom
if tonumber(fibaro:getValue(255, "value")) > 0
then
fibaro:call(255, "turnOff")
else
fibaro:call(255, "turnOn")
end
elseif (tostring(button_source["keyAttribute"]) == "Pressed3") then
fibaro:debug('Fibaro Button 3x gedrückt.')
elseif (tostring(button_source["keyAttribute"]) == "Pressed4") then
fibaro:debug('Fibaro Button 4x gedrückt.')
elseif (tostring(button_source["keyAttribute"]) == "Pressed5") then
-- slår av innbruddsalarm
fibaro:call(641, "setArmed", "0");
fibaro:call(210, "setArmed", "0");
fibaro:call(771, "setArmed", "0");
fibaro:call(745, "setArmed", "0");
fibaro:call(24, "setArmed", "0");
fibaro:call(430, "setArmed", "0");
fibaro:call(639, "setArmed", "0");
fibaro:call(422, "setArmed", "0");
fibaro:call(444, "setArmed", "0");
fibaro:call(601, "setArmed", "0");
elseif (tostring(button_source["keyAttribute"]) == "HeldDown") then
if fibaro:getGlobalValue("Panikkalarm") == "false"
then
local subject = "Rabakken5" -- passord SMS
local message = "Panikkalarm er utlost hos Hamran/Nordhagen i Rabakken 5, 0880 Oslo."
fibaro:debug(message)
fibaro:call(710, "sendPush", message) -- HOs mobil
-- fibaro:call(711, "sendPush", message) -- marits mobil
fibaro:call(2, "sendEmail", subject, message); -- Mail Hans Olav
fibaro:call(515, "sendEmail", subject, message); -- SMS Nokas
fibaro:call(516, "sendEmail", subject, message); -- SMS Hans Olav
fibaro:setGlobal("Panikkalarm", "true")
end
elseif (tostring(button_source["keyAttribute"]) == "Released") then
fibaro:setGlobal("Panikkalarm", "false")
end