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
billykwan88 0
Hi everyone, I am still new here so please correct me if I am wrong. I was trying to search about light automation and there are still nothing mature in the market. This is what I found about how people do it now:
1.) Pairing PIR sensors with the light switch, as the sensors are infrared sensors, the lights may turn off while you are sitting still or lying on bed.
2.) Pairing door sensors with lights, this is not quite useful as I don't usually close my door.
3.)
Please login or register to see this link.
, this actually makes more sense but I prefer plug and play solutions.So, I am thinking maybe we can think of a better way to do light automation with current tech based on headcount. If you have a better way, please share. If you are good at coding, please see if you would like to help.
Please login or register to see this image.
/emoticons/default_icon_wink.gif" alt=";-)" />Here is an idea...
- Place one PIR sensor (PIR1) outside the room, and one PIR sensor (PIR2) inside the room, there will be an area that two sensors overlap and both can be on at the same time.
- Set up a counter (HEAD) to count the number of people in the room.
- Set up a variable (STEP) to see whether the person is entering or exiting the room.
- HEAD=0
- Loop for every second
- If PIR1=OFF and PIR2=OFF, then STEP=0
- If STEP=0 and PIR1=ON and PIR2=OFF, then STEP=1
- If STEP=0 and PIR1=OFF and PIR2=ON, then STEP=3
- If STEP=1 and PIR2=ON, then STEP=2 and HEAD=HEAD+1
- If STEP=2 and PIR1=OFF, then STEP=3
- If STEP=2 and PIR2=OFF, then STEP=1 and HEAD=HEAD-1
- If STEP=3 and PIR1=ON, then STEP=2
- If HEAD > 0, then LIGHT=ON, else LIGHT=OFF
- End Loop
Does anyone have comments on above setting?
Would it actually work?
Could you find any bugs in there?
Any expert would like to try to write a set of code that can be copied and pasted and used by everyone?
Any sharing would be appreciated!!
Thanks!!
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.