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

LUA error


Question

Posted

Guys I need some help because I have no clue how to solve.

this is the scene:

If doorbell is pushed>>>>light starts to switched of and on---- Sonos starts to play on a certain volume

Two problems:

- Sonos does not stop, therefor I lower the volume after x time

- error message in debug

--[[
%% autostart
%% properties
64 value
%% weather
%% events
%% globals
--]]
--
function debug(color, message)
     fibaro:debug(string.format('<%s style="color:%s;">%s</%s>', "span", color, message, "span"));
end
--
--------------- Use function----------------------------------------------------
--
debug("red", "Er wordt aangebeld en de Sonos start te spelen op ingesteld volume");
-- Use colours like "white", "orange", "white, "green", "grey", "red", "blue".
--
--------------------------------------------------------------------------------


local startSource = fibaro:getSourceTrigger();
local SpotKastLinks              = 203
local HoofdslaapkamerVerlichting = 117
local OverloopVerlichting        = 121
local Deurbel                     =    64
local GuardDog                   = 209
local SonosPlayer                = 212

debug("orange","scene start")

if (
 ( tonumber(fibaro:getValue(Deurbel, "value")) > 0 )
or
startSource["type"] == "other"
)
then
  local startSource = fibaro:getSourceTrigger();
if (
 ( tonumber(fibaro:getValue(Deurbel, "value")) > 0 )
or
startSource["type"] == "other"
)
then
    fibaro:call(GuardDog, "pressButton", "1");
    fibaro:call(SonosPlayer, "pressButton", "7");
        fibaro:call(SonosPlayer, "setSlider", "15", "55");
    
    setTimeout(function()
--        fibaro:call(SonosPlayer, "pressButon", "9");
fibaro:call(SonosPlayer, "setSlider", "15", "25");
      end, 2*60*1000)
    
--    setTimeout(function()
--        fibaro:call(SonosPlayer, "pressButon", "9");
   --    end, 60*100)
  debug("blue", "volume lager want ik krijg hem niet uit")
end

 


    fibaro:call(SpotKastLinks, "turnOn");
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 2*1000)
  debug("yellow","Licht Knippert! Er belt iemand1")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOn");
    end, 4*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 6*1000)
  debug("yellow","Licht Knippert! Er belt iemand2")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOn");
    end, 8*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 10*1000)
   debug("yellow","Licht Knippert! Er belt iemand3")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOn");
    end, 12*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 14*1000)
   debug("yellow","Licht Knippert! Er belt iemand4")
 
      
    setTimeout(function()
        fibaro:call(SpotKastLinks "turnOn");
    end, 16*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 18*1000)
  debug("yellow","Licht Knippert! Er belt iemand5")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOn");
    end, 20*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 22*1000)
  debug("yellow","Licht Knippert! Er belt iemand6")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks "turnOn");
    end, 24*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 26*1000)
  debug("yellow","Licht Knippert! Er belt iemand7")
 

 
    setTimeout(function()
        fibaro:call(SpotKastLinks "turnOn");
    end, 28*1000)
  debug("green","Licht Knippert! Er belt iemand")
 
    setTimeout(function()
        fibaro:call(SpotKastLinks, "turnOff");
    end, 30*1000)
  debug("yellow","Licht Knippert! Er belt iemand8")
 
 
end
debug("orange","scene beeindigt")
fibaro:debug()

 

Please login or register to see this image.

/monthly_2019_02/image.png.65e3e45b3344d8a9180da191b1d4cb12.png" alt="image.png.65e3e45b3344d8a9180da191b1d4cb12.png" />

2 answers to this question

Recommended Posts

  • 0
Posted

you missed comma in this line

  • 0
  • Inquirer
  • Posted

    Jacek,

    Thanks, I have looked over it several times. Thanks again.

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