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

Scene with door/window sensor not working


Fabian78

Question

Hi,

 

I've got two Fibaro windowsensors in my house.

When I go to bed, I press the "Go to bed" button in my living room and then the lights go off etc.

It also starts a block scene which checks if those windows are closed: if one or more windows are open, it gives a message in the Fibaro app "Windows are open". When the windows are cloes: The sensor gives the right ("Not Breached") status.

 

But the block scene always sends the message that the window(s) is/are open.

Alo if I change "Open" to "Closed" to check what's going wrong.

 

What am I doing wrong? Please help me.

Thank you!

 

Please login or register to see this attachment.

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

I think, if you force the scene to run, it bypasses the condition. It will be the same as if you hit the “run” button?

 

There is a slightly similar discussion here, but not with a solution yet: 

 

 

Edited by SmartHomeEddy
  • Like 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • Yes, I think I've tried everything, that I know (I am not an expert yet ;-)).

    I saw that discussion too. Very strange that you can't read out the status like the way I want it to. Was that possible with HC2?

    Link to comment
    Share on other sites

    • 0

    I am not an expert either.
     

    It should be possible to read out the status of all alarm sensors if you define the specific ID’s in Lua code with an array and send a message if not ready. 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Yes, I think so, but it didn't work out yet... :-(

    If anyone can help: please help :-)

    Link to comment
    Share on other sites

    • 0

    I have made a very simple Quickapp that checks the specified sensors if they are still open (so you don't want to arm the alarm yet). The Quickapp makes somes debug lines and sends a push message to a specified user ID. 

     

    Maybe this can be the start of something ....

     

    Please login or register to see this code.

     

     (Just to give it a try, I am not an expert on this)

     

     

    Please login or register to see this attachment.

    Edited by SmartHomeEddy
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thank you @SmartHomeEddy

    Hi I am using HC3, so can't use this LUA scene I guess

    Link to comment
    Share on other sites

    • 0

    I added the name of the sensor in the notification. (And also simplified some code, I copied too much ?)

     

    Please login or register to see this code.

     

    Just code the code from " --- No edit below this line " to keep your sensor en user ID's. 

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thank you. It works great!

    I made some changes (added roomname)

     

    -- Fill in the ID's of the sensors you want to test if they are open
    -- Fill in the user ID's to who you want to send the push notification
     
    local sensorIDs = {44,258-- ID's of the sensors you want to test if they are open
    local userIDs = {2-- User ID's where to send the push notification 
     
    -- No edit below this line
    local b = false
        local msg = ""
        fibaro.debug("","--------- BEGIN ---------"-- Begin of the debug lines
        for i in pairs(sensorIDs) do
          b = fibaro.getValue(sensorIDs,"value")
          fibaro.debug("",tostring(sensorIDs),b) -- status of the sensor
          if b then
            msg = fibaro.getName(sensorIDs) .. " " .. fibaro.getRoomNameByDeviceID(sensorIDs) .. " staat nog open"
            fibaro.debug("",msg) -- message if sensor is open
            fibaro.alert("push", userIDs, msg) -- send push notification to userID 
          end
        end
        fibaro.debug("","---------- END ----------"-- End of the debug lines
    Link to comment
    Share on other sites

    • 0

    That ain’t gonna work. SensorIDs is an array, it needs to know what sensor ID you want to work with, the first or second in your case. That is why [ i ] is behind it. i counts from 1 to the amount of sensors you filled in the sensorIDs. 
     

    Did you check the debug window?

    Edited by SmartHomeEddy
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • It works right now. I've got the [ i ] behind it.

    But if I copy paste and save this message here at the forum, it deletes [ i ] ?!

     

    -- Fill in the ID's of the sensors you want to test if they are open
    -- Fill in the user ID's to who you want to send the push notification
     
    local sensorIDs = {44,258-- ID's of the sensors you want to test if they are open
    local userIDs = {2-- User ID's where to send the push notification 
     
    -- No edit below this line
    local b = false
        local msg = ""
        fibaro.debug("","--------- BEGIN ---------"-- Begin of the debug lines
        for i in pairs(sensorIDs) do
          b = fibaro.getValue(sensorIDs,"value")
          fibaro.debug("",tostring(sensorIDs),b) -- status of the sensor
          if b then
            msg = fibaro.getName(sensorIDs) .. " " .. fibaro.getRoomNameByDeviceID(sensorIDs) .. " staat nog open"
            fibaro.debug("",msg) -- message if sensor is open
            fibaro.alert("push", userIDs, msg) -- send push notification to userID 
          end
        end
        fibaro.debug("","---------- END ----------"-- End of the debug lines
    Edited by Fabian78
    Link to comment
    Share on other sites

    • 0

    Oh, that is possible. ?
     

    Btw you can copy code in the message via the <> button (and select LUA as language). Then no problem with the fornatting. 
     

    It would be perfect if there was a way to auto select the right devices based on there function. But that is apparently not possible. 
     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Please login or register to see this code.

    That's the right one

    Link to comment
    Share on other sites

    • 0

    ?
     

    I assume you have only one sensor in a room. Otherwise it would be better to use the name of the sensor and not the name of the room. 

    Edited by SmartHomeEddy
    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...