Jump to content

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!



Smart Home Forum by FIBARO Team

  • 0

HC3 LUA Remotes Scene



I have moved to the HC3 and trying to work out how the LUA programming works. 


The HC2 programming seemed a lot more logical and I am struggling to work out how to convert some of my old routines over.


One of the first routines is remotes. Setting this up by blocks wouldn't work as it looks like I'd have to setup a scene for each button for each remote. 


Could someone help tell me how to convert this simple program into a HC3 computable version?


%% properties

13 sceneActivation

%% globals

local buttonPressed = fibaro:getValue(13, "sceneActivation")

if ( tonumber(buttonPressed) == 1) then
fibaro:debug("MiniMote button 1 pressed")
elseif ( tonumber(buttonPressed) == 2) then
fibaro:debug("MiniMote button 2 pressed")
elseif ( tonumber(buttonPressed) == 3) then
fibaro:call(4, "turnOn")
fibaro:debug("MiniMote button 3 pressed - Light ON")
elseif ( tonumber(buttonPressed) == 4) then
fibaro:call(4, "turnOff")
fibaro:debug("MiniMote button 4 pressed - Light OFF")
elseif ( tonumber(buttonPressed) == 5) then
fibaro:debug("MiniMote button 5 pressed")
elseif ( tonumber(buttonPressed) == 6) then
fibaro:debug("MiniMote button 6 pressed")
elseif ( tonumber(buttonPressed) == 7) then
fibaro:debug("MiniMote button 7 pressed")
elseif ( tonumber(buttonPressed) == ? then
fibaro:debug("MiniMote button 8 pressed")
fibaro:debug("No response")


Thanks :)

Link to comment
Share on other sites

1 answer 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.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...