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

Aeotec Wallmote Quad integration with HC2 lua script check


wospital

Question

Goodmorning i am trying to created a script but i don't know whats wrong.

 

--[[
%% properties
%% weer
747 CentralSceneEvent
%% events
%% globals
--]]

if (fibaro:countScenes()>1) then
  fibaro:abort();
  end

    local startSource = fibaro: getSourceTrigger ();

    local button = startSource ["event"] ["data"] ["keyId"];
    local keyAttribute = startSource ["event"] ["data"] ["keyAttribute"];
 
    fibaro: debug ('key' ..button .. 'en' ..keyAttribute .. 'was ingedrukt');
 

    if (keyAttribute == 'Pressed' and button == 1) then
          fibaro:call(685, "turnOn");
          fibaro:debug('turn on central lights...');
      elseif (keyAttribute == 'Pressed' and button == 2) then
          fibaro:call(688, "turnOn");
        fibaro:debug('turn on dressing lights...');  
    elseif (keyAttribute == 'Pressed' and button == 3) then
        fibaro:call(731, "close");
          fibaro:call(736, "close");
        fibaro:debug('closing all blinds...');  
    elseif (keyAttribute == 'Pressed' and button == 4) then
        fibaro:call(726, "close");
        fibaro:debug('closing overflow blinds...');  
    elseif (keyAttribute == 'HeldDown' and button == 1) then
        fibaro:call(685, "turnOff");
        fibaro:debug('turn off central lights...');  
    elseif (keyAttribute == 'HeldDown' and button == 2) then
           fibaro:call(688, "turnOff");
        fibaro:debug('turn off dressing lights...');  
    elseif (keyAttribute == 'HeldDown' and button == 3) then
        fibaro:call(731, "open");
          fibaro:call(736, "open");
        fibaro:debug('opening all blinds...');  
    elseif (keyAttribute == 'HeldDown' and button == 4) then
        fibaro:call(726, "open");
          fibaro:debug('opening overflow blinds...'); 
    end

 

thanks a lot for your help.

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello,

 

you have to look at this:

 

--[[
%% properties
%% weer        <---   %%weather
747 CentralSceneEvent
%% events
%% globals
--]]

 

Hope this helps

Link to comment
Share on other sites

  • 0
  • Inquirer
  • seams that the problem is somewhere in this line

     

     

    local button = startSource["event"]["data"]["keyId"];
    local keyAttribute = startSource["event"]["data"]["keyAttribute"];

    Link to comment
    Share on other sites

    • 0

    I use these to get the scene started:

     

    Please login or register to see this code.

     

    Key can after this be used to check which key is pressed, the mode checks for helddown.

    Link to comment
    Share on other sites

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