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

Easy LUA Scene


Question

Posted

Hello, i'd like a manual LUA scene that when started (manually started) turns on a device and after 1 minute it switch it off and send a notification, then stop till next time i manually launch it.

 

I was thinking about something like this but ... something missed :P

 

--[[
%% properties
77 value
%% globals
--]]
local  schukoID= 77;

fibaro:call(schukoID, "turnOn");
fibaro:sleep(1*60000); -- wait 1 minute
fibaro:call(schukoID, "turnOFF");
end

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

modified the lua for you :

 

--[[
%% properties
%% globals
--]]
local  schukoID= 77;

fibaro:call(schukoID, "turnOn");
fibaro:sleep(1*60000); -- wait 1 minute
fibaro:call(schukoID, "turnOFF");
 

the "end" statement and "77 value" shouldnt be there

 

what about the notification, where should it go to ?

Edited by diedvdyk
  • 0
  • Inquirer
  • Posted

    It starts, but it does not stop (shuko keep running)

    • 0
    Posted

    example: hope it helps

    --[[
    %% properties
    194 value
    %% globals
    --]]
    if 
     fibaro:getValue(194, "value") == '0' 
    then
        fibaro:call(194, "turnOn")
         fibaro:call(196, "turnOn")
          fibaro:call(197, "turnOn")
           fibaro:call(306, "turnOn") -- Kettle socket
            fibaro:call(175, "setProperty", "currentIcon", 191);
    else
        fibaro:call(194, "turnOff")
         fibaro:call(196, "turnOff")
          fibaro:call(197, "turnOff")
           fibaro:call(306, "turnOff") -- Kettle socket
             fibaro:call(175, "setProperty", "currentIcon", 190);
    end

     

    • 0
    Posted
    On 4-11-2016 at 1:30 PM, diedvdyk said:

    modified the lua for you :

     

    --[[
    %% properties
    %% globals
    --]]
    local  schukoID= 77;

    fibaro:call(schukoID, "turnOn");
    fibaro:sleep(1*60000); -- wait 1 minute
    fibaro:call(schukoID, "turnOFF");
     

    the "end" statement and "77 value" shouldnt be there

     

    what about the notification, where should it go to ?

    should be turnOff instead of turnOFF

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