Click for more products.
No products were found.
Blog search
Latest Comments

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
Tag: lua, HC2, swipe
Related products
Related articles
Leave a Comment
Leave a Reply
Please login to post a comment.

Menu

Settings

Create a free account to save loved items.

Sign in

Create a free account to use wishlists.

Sign in
News
Packeta - Pickup/Collection points and Z-BOXes
16. 10. 2024

From now on, you can pick up your order in person at pick-up points and Z-BOXes, in different countries, also with Cash On Delivery payment !


15. 10. 2024

After a long time, we have in stock a great 3-phase electricity consumption meter for smart homes based on Z-Wave technology.


Automatic VAT adjustment or removal
10. 10. 2024

The amount of VAT is automatically set according to the country of delivery, or VAT is removed for companies with a valid VAT number.


08. 10. 2024

File a complaint or return request online. How to do it? More info by clicking on More news in the bottom corner.


More news