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


Question

Posted (edited)

Check status of doors and windows v1.0

 

This simple scene will send push message every time when door or window is opened if global Variable DoorWinCheck is set to "Yes". Usage, we are sitting in garden on the opposite side of our house main entrance door. Turning this scene on and we will be informed every time when somebody opens main door

Please login or register to see this image.

/uploads/emoticons/default_smile.png" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" /> If scene is started manually with RUN button or by other scene or VD then it will check all doors and windows (or just those we put in the list) and will send popup message with the list of opened doors and windows. The rest is up to you. Here is scene code:

Please login or register to see this code.

global variable DoorWinCheck can be changed by virtual device which have one label and one button. Here is code that goes to button:

Please login or register to see this code.

And if you want you can add this code to Main loop:

Please login or register to see this code.

Don't forget to change name for label from label1 to lblDoorWinCheck or vice-versa. Here is also picture of DV and icons to use for scene and VD:

 

Please login or register to see this attachment.

   

Please login or register to see this attachment.

   

Please login or register to see this attachment.

 

EDIT :

New version 1.0 with some changes for users to easier setup. Now you can use existing variable and values you just need to enter name of your variable and map your values to Yes and No for checking and sending push notification when door or window is opened.

 

Also changed push notifications so that users are defined in table variable userID. userFlag defines if user will get notification set by 1, or not set with 0. You can add your part of code to change flags, see example:

Please login or register to see this code.

Enjoy coding! :)

Edited by Sankotronic
Release new version of code

Recommended Posts

  • 0
Posted

A bunch of reboots fixed the issue.

The open door script:

Please login or register to see this link.

  • 0
Posted (edited)

Does this if-VD to change the variable not work anymore? Have tried many many times, both 4.092 and 4.100. Would love to get it to work on my change variable silent/with ring doorbell-variable too. 

My door-wincheckVD:

Please login or register to see this code.

Main loop

Please login or register to see this code.

Doorbell VD

Please login or register to see this code.

Main loop

Please login or register to see this code.

Edit 4/10-16:

Sankotronic pointed out that I had mixed the variables, and I see I´ve missed a some code too. Corrected, and both VD´s working:

Doorbell:

Please login or register to see this code.

Main loop

Please login or register to see this code.

Translation:

Ringeklokke=Doorbell

Stille=Silent

Lyd=Sound

I´ve connected a FGS221 to my doorbell alarm. When the variable is set to "Lyd", the doorbell makes a chime and I get a push message when the doorbell is pushed.  

When the variable is set to "Stille" I get a push message to my phone.  Most of the code is copied from LUA-guru Sankotronic´s work.

My Ringeklokke-Lyd-Scene:

Please login or register to see this code.

My Ringeklokke-Stille-scene:

Please login or register to see this code.

These two are just Block-scenes converted, I know they are not efficient and that they could have been in the same scene :) 

Learning more of the logic in Lua every day... I´m an Auditor, not a developer...

Edited by Gullfrode
  • 0
Posted

Hey @Sankotronic can you please add the following if you update this scene again:

If a door or window is already open before the check is set to "Yes" that the push is send when checked to "Yes"? 

This would be a nice feature when setting the alarm.

 

Have a good new year!!

  • 0
  • Inquirer
  • Posted
    6 minutes ago, jimicr said:

    Hey @Sankotronic can you please add the following if you update this scene again:

    If a door or window is already open before the check is set to "Yes" that the push is send when checked to "Yes"? 

    This would be a nice feature when setting the alarm.

     

    Have a good new year!!

     

    @jimicr,

     

    This scene I wrote on one of users request. It is standalone scene. For alarm I have completely different solution but also with checking status of the sensors before arming. I still have to do some adjustments and will release it as soon as I test it thoroughly. Happy New year to you and your family!!!

    • 0
    Posted

    Thanks @Sankotronic, after seeing what you have done for this forum, I strongly suggest Fibaro sends you a free module( switch, dimmer ect) every time you share one of your scene's or VD's. 

    Using some of your scripts has made my home a lot smarter and is an advertisement for Fibaro every time we have a visitor!

    • 0
  • Inquirer
  • Posted
    33 minutes ago, jimicr said:

    Thanks @Sankotronic, after seeing what you have done for this forum, I strongly suggest Fibaro sends you a free module( switch, dimmer ect) every time you share one of your scene's or VD's. 

    Using some of your scripts has made my home a lot smarter and is an advertisement for Fibaro every time we have a visitor!

     

    @jimicr,

     

    Thank you for your kinds words and that is the best award for my work. Fibaro really doesn't have to do that, but I will not complain if they do :D

    • 0
    Posted

    Hi @Sankotronic,

     

    Thanks for the script, I have implemented the script, but if I run the scene manually I don't get an overview of open and closed doors. It does send a notification if the door is opened but not if I manually request it. Any ideas about what could be wrong? I'm on version HC2 4.110.

     

    Please login or register to see this code.

     

    • 0
  • Inquirer
  • Posted

    @Landshark,

     

    sometimes app doesn't show popup message even it is received. Try  to restart mobile app and then see if it will show up. I don't see any other reason why popup notification is not received by mobile app.

    • 0
    Posted

    @Sankotronic, I have got it working. The only thing which doesn't work is that you don't get a message if all doors are closed (foundAllClosedMessage). Any ideas?

     

    • 0
  • Inquirer
  • Posted
    3 minutes ago, Landshark said:

    @Sankotronic, I have got it working. The only thing which doesn't work is that you don't get a message if all doors are closed (foundAllClosedMessage). Any ideas?

     

     

    If manually executed scene should send popup message even if all doors and windows are closed. I don't use it very often but it was working fine. I'm not at home to test it but if you have open mobile app and you start this scene from mobile app then popup message should show up.

    • 0
    Posted

    I do get a popup on my phone if I run the scene manually but only if doors are open, not if they are closed?

    • 0
    Posted

    @Sankotrovic Same behavior than Landshark on my side.

    Do we need to change something on the VD configuration?

    • 0
  • Inquirer
  • Posted

    Hello @Landshark and @Arbu-jl,

     

    I'm not at home at the moment to test, but find this line in code (it is almost at the end of code):

    Please login or register to see this code.

    and add this line before:

    Please login or register to see this code.

    and then try again. It is possible that popup message will not show up if any of body parts are empty strings.

    • 0
    Posted

    Hi @Sankotronic, not working....

     

    here you have my code...

    Please login or register to see this code.

    What i'm doing wrong?

    • 0
  • Inquirer
  • Posted

    Hello all,

     

    I manage somehow to test this scene on remote connection and I did some minor changes in code that are updated in my first post. Besides adding this line before calling function sendPopup:

    Please login or register to see this code.

    I also removed local statement in function sendPopup to be as following code:

    Please login or register to see this code.

    Scene tested and now should work as expected also sending popup notification when all doors and windows found closed.

     

    • 0
    Posted

    no change for me

    • 0
    Posted (edited)

    @Sankotronic, it works now thanks!

     

    @Arbu-jl, did you test it on your mobile phone by running the scene manually?

    Edited by Landshark
    Typo
    • 0
    Posted

    Yes, works fine on iOS. But honestly I would have wanted to have a push notification in fact....

    • 0
  • Inquirer
  • Posted
    1 hour ago, Arbu-jl said:

    Yes, works fine on iOS. But honestly I would have wanted to have a push notification in fact....

     

    Hi @Arbu-jl,

     

    This scene will send PUSH message whenever door or window is opened if ID is added to scene header and global variable DoorWinCheck is set to Yes. If you run scene manually or if it is started by another scene or VD then it will send POPUP message with list of all doors and windows found opened or that all is closed.

     

    So what is the third option that you want?

    • 0
    Posted

    Hi, I just want the push message when door is opened or closed. Currently I have only push message when door is opened, but not when is closed. Very strange, I cannot understand why. 

    ID is already added in scene header and global variable DoorWinCheck is set to Yes.

    When I run scene manually, I don't have push message even if window is already opened...

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