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

Opene/close Blinds Same Scene


Question

Posted

Hi, im trying to set a scene to open or close my blinds so i can tell alexa to activate that scene in order to close/open that particular blind.

i cant find the way to make a scene where yo can say "if opened- then close and if closed-then open". i hope someone can help me.

1 answer to this question

Recommended Posts

  • 0
Posted

Hi,

I have a create a scene to have a "button" on/off.
First create a global variable with true/false value.

I use this scene:

--[[
%% properties
%% weather
%% events
%% globals
IN_CASA -- Global Variable
--]]


local myVar
local startSource = fibaro:getSourceTrigger();
myVar = fibaro:getGlobalValue("IN_CASA")


if 
    ( myVar == 'false'  ) -- Test

then
    fibaro:setGlobal('IN_CASA', 'true') -- Imposto la variabile globale a True
    fibaro:call(28, "pressButton", "1") -- Imposto Cam Kitchen In Casa
    fibaro:call(29, "pressButton", "1") -- Imposto Cam UnderStair In Casa
    fibaro:call(30, "pressButton", "1") -- Imposto Cam Leaving In Casa
    fibaro:call(31, "pressButton", "1") -- Imposto Cam External In Casa
    fibaro:call(32, "pressButton", "1") -- Imposto Cam Office In Casa
    fibaro:call(6, "sendDefinedPushNotification", "219") -- Invio Notifica su iPhone
    fibaro:call(33, "sendDefinedPushNotification", "219") -- Invio Nnotifica su iPAd
    api.put('/scenes/9', {iconID=1002}) -- Cambio l'icona della scena in ON

elseif  
    ( myVar == 'true'  ) -- Test

then
    fibaro:setGlobal('IN_CASA', 'false') -- Imposto la variabile globale a False
    fibaro:call(28, "pressButton", "4") -- Disattivo Cam Kitchen
    fibaro:call(29, "pressButton", "4") -- Disattivo Cam UnderStair
    fibaro:call(30, "pressButton", "4") -- Disattivo Cam Leaving
    fibaro:call(31, "pressButton", "4") -- Disattivo Cam External
    fibaro:call(32, "pressButton", "4") -- Disattivo Cam Office
    fibaro:call(6, "sendDefinedPushNotification", "222") -- Invio Notifica su iPhone
    fibaro:call(33, "sendDefinedPushNotification", "222") -- Invio Notifica su iPad
    api.put('/scenes/9', {iconID=1001}) -- Cambio l'icona della scena in OFF

  
else 
    fibaro:debug("Condizioni non verificate")

end

 

Condition: if myVar is "false", then I arm my alarm, webcam, send notification, change icon and change the value of GV to true. Else if myVar is "true" I disarm all and set GV to false.

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