LUA: Fibaro Swipe

LUA: Fibaro Swipe

In the next part we will show you the LUA script that can be used for Fibaro Swipe and thus you will not need a separate Magical Scene for each gesture. This can be useful for those users who prefer the LUA scripts to the graphic creation of scenes.

The LUA script:

In the particular script it is necessary to change 583 in row 4 to the ID of your Fibaro Swipe. Then you must modify SceneID to the ID of the scene that you want to trigger after the particular gesture, and the scene is completed.

--[[
%% properties
%% events
583 CentralSceneEvent
%% globals
--]]
 
local swipe_source = fibaro:getSourceTrigger()["event"]["data"]
 
-- fibaro:debug("Key " .. swipe_source["keyId"] .. " Attr " .. swipe_source["keyAttribute"])
 
if (swipe_source["keyId"] == 1) then
 fibaro:debug('Zo spodu hore')
 fibaro:startScene(sceneID)
elseif (swipe_source["keyId"] == 2) then
 fibaro:debug('Z hora dole')
 fibaro:startScene(sceneID)
elseif (swipe_source["keyId"] == 3) then
 fibaro:debug('Sprava do ľava')
 fibaro:startScene(sceneID)
elseif (swipe_source["keyId"] == 4) then
 fibaro:debug('Zľava doprava')
 fibaro:startScene(sceneID)
end
Štítok: lua, HC2, swipe

Related articles

Using Aeon Labs Minimote in Fibaro HC2

Using Aeon Labs Minimote in Fibaro HC2

LUA Script: Battery check - Fibaro Home Center 2

A simple LUA script to check the status of battery devices.

Zanechajte nám Váš názorZanechajte odpoveď

Vyhľadávanie v blogu

Najnovšie názory

Recently Viewed

No products

Menu

Compare 0