Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- %% properties
- %% weather
- %% events
- xxx CentralSceneEvent
- %% globals
- --]]
- local startSource = fibaro:getSourceTrigger();
- local rollo_device_id = 'xxx';
- local button = startSource["event"]["data"]["keyId"];
- local keyAttribute = startSource["event"]["data"]["keyAttribute"];
- fibaro:debug('Taste '..button..' und '..keyAttribute..' wurde gedrückt');
- if (keyAttribute == 'Pressed' and button == 1) then
- -- Hier Button 1 & gedrückt
- fibaro:call(rollo_device_id, "open");
- elseif (keyAttribute == 'Pressed' and button == 2) then
- -- Hier Button 2 & gedrückt
- if(tonumber(fibaro:getValue(rollo_device_id, "power")) >= 5)
- then
- fibaro:call(rollo_device_id, "stop");
- else
- fibaro:call(rollo_device_id, "open");
- end
- elseif (keyAttribute == 'Pressed' and button == 3) then
- -- Hier Button 3 & gedrückt
- fibaro:call(rollo_device_id, "close");
- elseif (keyAttribute == 'Pressed' and button == 4) then
- -- Hier Button 4 & gedrückt
- if(tonumber(fibaro:getValue(rollo_device_id, "power")) >= 5)
- then
- fibaro:call(rollo_device_id, "stop");
- else
- fibaro:call(rollo_device_id, "close");
- end
- elseif (keyAttribute == 'HeldDown' and button == 1) then
- -- Hier Button 1 & gehalten
- elseif (keyAttribute == 'HeldDown' and button == 2) then
- -- Hier Button 2 & gehalten
- elseif (keyAttribute == 'HeldDown' and button == 3) then
- -- Hier Button 3 & gehalten
- elseif (keyAttribute == 'HeldDown' and button == 4) then
- -- Hier Button 4 & gehalten
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement