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

Question

Posted (edited)

Dear All,

 

I guess it is simple, but I\m stack wit it.

 

I like to make very simple script to activate light when door is open and motion sensor detect movement and then light should be off after 30 seconds. It is working fine, bur I like to get possibility to discover when light was switched on manually and than switch it off after 30 minutes when no movement is detected.

 

Problem is only one - how to know that light was switched on manually (I get switch in area where it is detected by motion detector and I need to open doors before.

 

It mens scene is triggered but I like to "override" it when manually light is on.

 

For light start I\m using dimer module with two switches connected.

 

Thanks 

 

Piotr Br

Edited by T.Konopka
Wrong category. Moved from Crowd's Solutions.

4 answers to this question

Recommended Posts

  • 0
Posted

Actually this is not so complicated to implement.

You need to define one global variable.

In your scene you know what was the trigger to turn the light ON, so update the variable accordingly.

Now when you checking the time w/o movement you need to check the variable and to decide when to turn the light off.

 

There are two option to solve the problem that motion will be detected before you have the chance to turn light on manually. 

1. To add few seconds delay before turning light ON by motion detection, it gives a chance to you to turn light manually.

2. After the light turned ON by motion w/o delay, you will need to switch light off and on manually.

 

to make the code simple I think will be better to define 30 seconds timeout as part of motion parameter. Send safe state after 30 seconds. 

If you need further help, please share your code and I'll update it as an example for you.

  • 0
Posted

Please update the following piece of code as  following:

define global variable lightAct (at variables panel)

change every 169 number in code  to your real switch device ID

change every 170 number in code to your real sensor ID

The code includes 5 seconds delay before turning light ON and based on sensor setup of back to safe parameter after 30 seconds.

In case you have decided not to use delay or past over 5 sec. before your reached the switch then  the scene will turn the light ON, so you'll need to turn Off/On the switch to set manual mode. 

Note: you have mention something about door is open... do you have sensor on door and want to include it as well?

Door action doesn't included in code below.let me know if you need it and what exactly your scenario for door sensor.

Please login or register to see this code.

Now you need another scene (or VD) to count the 30 minutes timeout if no motion detected and light turned ON manually. Again please change 169 and 170 to your real IDs.

I suggest to use this scene for any other timeouts that you might need. Just add more devices.

Please login or register to see this code.

I wrote the code from top of my head, hope no errors and it works as expected. (in case you decided to use it)

One question if you don't mine : why you need to keep the light ON for 30 minutes if no motion detected?

 

  • 0
  • Inquirer
  • Posted

    Cag014,

     

    Thank you for great idea - switch off and on to trigger it manually and then use Global variable -

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />:)

     

    Some how your code is not working - but I think I will update mine

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> and all should be great.

     

    One more time thank for great idea,

     

    BR

     

    PBr

    • 0
    Posted

    You're welcome.

     

    Strange it should work if you changed the IDs to real numbers, but anyhow I glad that you understood the idea.

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