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] Check status of doors and windows {v1.0}


Sankotronic

Question

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
Link to comment
Share on other sites

Recommended Posts

  • 0
  • Inquirer
  • 11 hours ago, Arbu-jl said:

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

     

    Hi @Arbu-jl,

     

    Scene is made to send push message only when door or window is open. When manually run then it sends only popup message. If you want you can change that and add more functions to it or wait for me to release next version.

     

    Link to comment
    Share on other sites

    • 0
    10 hours ago, Sankotronic said:

     

    Hi @Arbu-jl,

     

    Scene is made to send push message only when door or window is open. When manually run then it sends only popup message. If you want you can change that and add more functions to it or wait for me to release next version.

     

    Ok, thanks for your explanations 

    get it now...

    i will try something, but if you have time to rework on this scene, it could be useful and sure better than me 

    thank you again for your support.

    Link to comment
    Share on other sites

    • 0

    Goodmorning all,

     

    I'm planning to create a scene that will warn me when a window or door is open and rain is expected (using this VD to get the forecast: 

    )  and this scene as a base.

    But I only want to be notified when the door is open for longer than a minute, I don't want a notification if I go out just to trow something in the bin.

    Can some one please help me how to get this done?

     

    Jim

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 hour ago, jimicr said:

    Goodmorning all,

     

    I'm planning to create a scene that will warn me when a window or door is open and rain is expected (using this VD to get the forecast: 

    )  and this scene as a base.

    But I only want to be notified when the door is open for longer than a minute, I don't want a notification if I go out just to trow something in the bin.

    Can some one please help me how to get this done?

     

    Jim

     

    Purpose of this scene is to be run manually to check what doors and windows are opened. Additionally can inform you when somebody open door or window when you are in back yard making barbecue with your family and nobody is watching front door for example. :-) 

     

    What you want is something that is time related so can't be done with this scene (at the moment anyway). This scene runs only when triggered by door/window sensor sends notification and then stops. To measure how much time passed from some action like window opened then you need loop that will check that and then send notification, but also make sure that it will send that notification only once until state of the door/window changes again to closed. But to be honest I really don't see any purpose in that. :-P  Still, if something else happened like rain, strong wind or alike, then I see purpose to check if any door/window is opened to send notification to close them, or for lucky ones that have motorized windows to close them automatically.

     

    I want first to sort out basic stuff like Main scene, VSL scene, TTS and other notifications, (Weather is done :-) ) and then I will start dealing with next level which includes some kind of decision making and higher level of control. If basic stuff is not done properly, then everything else that depends on this basic stuff can't be good as it should :-) 

     

    It takes some time to achieve this because I'm also trying to make it usable by other users.

    Link to comment
    Share on other sites

    • 0

    Thanks for your reply,

     

    I allready have a script that checks doors and windows before arming the alarm. I'll use that as a base.

    Only thing it doesnt have is the time delay if something is open.

     

    Well I'm from the Netherlands and we can have a lot of rain sometimes, also we always have our windows wide open :)

     

    Now gotta go out for an egghunt with the girls. will try to put something together when I get home

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 13 minutes ago, jimicr said:

    Well I'm from the Netherlands and we can have a lot of rain sometimes, also we always have our windows wide open :)

     

     

    I know! I spent lot of time in Rotterdam and Amsterdam in the past and I'm aware of the weather conditions there. Last trip I was working on installation on the open  with winds non-stop blowing carrying rain and snowflakes :-( 

    Link to comment
    Share on other sites

    • 0

    I found a cheap way to automaticly open and close windows... the motors i found have a discound up to 50% and can open more then current 15cm of the zwave motors... I use the motors with the rollershutter module from fibaro , so i can use the slider and have an easy install...

     

    If anyone want me to post my solutions i will... but dont know where to post it :-) 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 12 minutes ago, Ibie said:

    If anyone want me to post my solutions i will... but dont know where to post it :-)

     

    Hi @Ibie,

     

    You are very welcomed to post your solution here. I believe that many users will find it interesting (me too)!

    if it is complete solution then you can post it under Crowd's solutions -> Other solutions. It will have to wait for administrator approval but now they are every day here so waiting will not be long.

     

    If it is partial solution or if you don't want to wait for approval then you can post it under Community Support -> Other devices

     

    Link to comment
    Share on other sites

    • 0

    Ok i will try to throw something togetter... For me its a complete solution (also working without HC2) and with your weahter scenes and VD... :-) 

     

    Update: Finaly i have posted my Window Automotion... waiting for aproval

    Edited by Ibie
    Link to comment
    Share on other sites

    • 0

    Dear,

     

    I have an alarm system and all the sensors of my home (doors and windows) are part of this alarm system.

     

    I would be really grateful if you could add functionality to your script to use the Global variables of the alarm system (as you do for the Very Smart Lights scene, where you use the GV to check motion) to execute the same functionality.

     

    THANK YOU in advance!!!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @Miltos and welcome to Fibaro forum!

     

    I can add global variable to the scene, but can you elaborate on your request, please?

     

    I don't understand if you want scene to be triggered by global variable or you want this scene to set some value to global variable depending on status of the doors and windows? Some details will be most appreciated.

     

    Link to comment
    Share on other sites

    • 0

    Hi again.

     

    Wow this was quick!

     

    i want the scene to check the windows and doors not as ids but as  values of  relevant global variables.

     

    i have in fibaro e.g. a global variable called gpc_area_1_1 which represent a window in my house , which is open if its value is “OPEN”.

     

    You have done something similar in the super smart lights scene, where you check the motion sensor triggering the lights, not only as an Id, but also as the value of a global variable, set by an alarm system and representing the motion detector value of the alarm systems motion detector.

     

    hope this helps.

     

    Thanks!

    Miltos

    Link to comment
    Share on other sites

    • 0

    Hello Sankotronic,

     

    I am a bit late to the party as i am just getting ready to implement your code to my HC2 :P.

     

    I have just one question.

     

    After creating a global variable with the name doorWinCheck

    And a predefined variable with the name: doorWinMapping

    And the 2 values set at Yes and No i get this error on debug:

     [ERROR] 17:02:52: line 69: attempt to call method 'getSourceTrigger' (a nil value)

     

    Do you have any advice on the this matter?

     

    Thank you in advance

     
    Link to comment
    Share on other sites

    • 0

    @Sankotronic ,   this scene used to work perfectly but I now get the following error and no popups on my phone, any ideas?

     

    HC2 version 4.510

     

     

    [DEBUG] 11:12:25: It is open: Eetgedeelte DC Serredeur
    [DEBUG] 11:12:25: [1;31m2018-10-14 11:12:25.564024 [ error] API: Not found
    [DEBUG] 11:12:25: It is open: Keuken DC Keukenraam oprit

    Edited by Landshark
    Added information
    Link to comment
    Share on other sites

    • 0

    Hello Sankotronic,

    I have implemented your great scene and it shows me the open doors/windows.

    However I do not get popup message, not a problem for me if I (read you) can change as follows:

    I would like that if I for example arm my house it will run automaticly your scene and if no error no action at all.

    if one of the listed sensors is open I would like that my Sonos yell at me something as he mister pay attention sensor xxx is not safe. On this way it will be in my opinion also much easier for the other family members to use.

    remark: my Sonos plays music according playlist if doorbell is pushed. I also can not get it worked to play a specific file, my TTS is not working at the moment because I did something wrong. I must try to solve this.

    Thanks in advance

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