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

[SOLVED]Presence Scene strange behavior


Question

Posted (edited)

Please login or register to see this code.

This is just a simple scene that sends push message by "pressButton" of individual VD.  With below..

 

local trigger = fibaro:getSourceTrigger()
if (trigger['type'] == 'property') then
    fibaro:debug('Source device = ' .. trigger['deviceID'])
elseif (trigger['type'] == 'global' ) then
    fibaro:debug('Global variable source = ' .. trigger['name'])
elseif (trigger['type'] == 'other') then
    fibaro:debug('Other source')
end

 

I can see which global variable triggers the scene.  However, strange thing is that no matter which Global variable triggers the scene (Only 1 var trigger I can see in debug window),  I always see the message from isAHome, for example:

 

if B is home, it presses a button of its VD so message is sent my mobile, I know B is now home.  But, I for some reason also the push message related to isAHome , the debug message only shows "Global variable source = isBHome"

 

My Mobile receives:

A is Home -> next push  -> B is Away (debug: "Global variable source = isBHome)

or.. another example

A is away -> next push -> D is away (debug: "Global variable source = isDHome)

 

is it programming logic issue or it is a bug?

 

Thanks...

Edited by Sirhideo

2 answers to this question

Recommended Posts

  • 0
Posted

As I myself absolutely love the effort of introducing a bit of humour into our forum, I have to ask you to change the title so that it indicates what the scene is about ;)

  • 0
  • Inquirer
  • Posted

    fixed by adding if (  trigger['name'])  == "corresponding_globalvar" )  before every if condition.

     

    if (  trigger['name'])  == "isAHome" ) then

    if (fibaro:getGlobalVAlue('isAHome') == "true" then

    blah blah blah

    end

    end

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