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

Light Automation based on Head Counts


billykwan88

Question

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

  • 0

A good solution would be if there existed a thermographic network camera with a good API. Ask the API for objects within camera range that has a heat signature. Then you would know realtime if the room had living souls in it or not. But I guess the search for such a camera would be endless, and if one were to find a camera... the price would probably kill you.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Yes skoTner! I guess that might be quite expensive and some may find it insecure to have so many IP cameras across the house, including washrooms.

    Please login or register to see this image.

    /emoticons/default_icon_razz.gif" alt=":-P" />

    Link to comment
    Share on other sites

    • 0
    Yes skoTner! I guess that might be quite expensive and some may find it insecure to have so many IP cameras across the house, including washrooms.

    Please login or register to see this image.

    /emoticons/default_icon_razz.gif" alt=":-P" />

    A hackers dream?

    Please login or register to see this image.

    /emoticons/default_icon_evil.gif" alt=":evil:" />

    Link to comment
    Share on other sites

    • 0

    Nice idea. It seems you are not really counting "heads" but "entrances": what if two heads enter exactly at the same time, and just one leave the room?

    Or while one enters, another exits?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks umbex! You are right! It gets complicated if there are more than one person. Adding below might help a bit

    - If HEAD=0 and PIR2=ON, then HEAD=1

    - If HEAD>0 and PIR2=OFF for maybe 30 mins, then HEAD=0

    Link to comment
    Share on other sites

    • 0
    Guest Kuuno

    my personal opinion is that it might be cool but probably is little "over automation"

    most precise things would be cameras looking or some rfid/nfc counting probably like mentioned earlier?

    Link to comment
    Share on other sites

    • 0
    Would it actually work?

    Could you find any bugs in there?

    It's diffucult to say since algorythm is quite complicated. It's best if you implement it and try. But it can be really tricky in situations that umbex mentioned:

    what if two heads enter exactly at the same time, and just one leave the room? Or while one enters, another exits?

    I personally don't have a solution for "light on presence" and reading this post with a high interest. Nevertheless I have one scene that I use in my bathroom - I use both door and motion sensors there to control lights. The light will never turn off if the door is closed and motion is detected inside. But this will work only for bathroom where people usually close the door, so not an option for other rooms. Code is available here if you are curious but it is not so good:

    Please login or register to see this link.

    Finally I think the easiest solution for "light on presence" problem will option 1 in your list:

    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.

    To avoid turning off whlie your are lying on a bed, put a much bigger timeout (=30 min). Not so energy efficient but the comfort is more important!

    Please login or register to see this image.

    /emoticons/default_icon_cool.gif" alt="8-)" />

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