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!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Minimote to press a button in a virtual device


Question

Guest Eduardo
Posted

I´m trying to make my minimote to control my TV. I´ve already managed to activate the scene to turn on and off the TV, but the comand to change the channel on the button 1 at the minimote doesn´t work. I just receive this message: line 19: attempt to call method "presButton" (a nil value).

This is the minimote config.

%% properties

114 sceneActivation

%% globals

--]]

local ButtonPressed = fibaro:getValue(114, "sceneActivation")

if ( tonumber(ButtonPressed) == 1) then

fibaro:pressButton("button_2_0")

fibaro:debug("MiniMote button 1 pressed - ch mais")

elseif ( tonumber(ButtonPressed) == 2) then

fibaro:call(17, "close")

fibaro:call(64, "turnOff")

fibaro:call(67, "turnOff")

fibaro:debug("MiniMote button 2 pressed - lab all off")

elseif ( tonumber(ButtonPressed) == 3) then

fibaro:call(87, "turnOn")

fibaro:debug("MiniMote button 3 pressed - alarme on")

elseif ( tonumber(ButtonPressed) == 4) then

fibaro:call(87, "turnOff")

fibaro:debug("MiniMote button 4 pressed - alarme off")

elseif ( tonumber(ButtonPressed) == 5) then

fibaro:call(85, "turnOff")

fibaro:debug("MiniMote button 5 pressed - sirene off")

elseif ( tonumber(ButtonPressed) == 6) then

fibaro:debug("MiniMote button 6 pressed")

elseif ( tonumber(ButtonPressed) == 7) then

fibaro:startScene(22)

fibaro:debug("MiniMote button 7 pressed")

elseif ( tonumber(ButtonPressed) == 8) then

fibaro:startScene(23)

fibaro:debug("MiniMote button 8 pressed")

else

fibaro:debug("No response")

end

2 answers to this question

Recommended Posts

  • 0
Posted

command is:

fibaro:call(ID, "pressButton", "BUTTONNR")

ID is ID of your virtual device

BUTTONNR is NR of the button you want to press (so you have to count, the name is not working!)

example:

fibaro:call(23, "pressButton", "4")

  • 0
Guest Eduardo
  • Inquirer
  • Posted

    Thanks a lot boerremk!!!!! Never thought that I have to count the buttons.

    Regards

    Eduardo

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    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...