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


Recommended Posts

Posted

 

Based on the article

Please login or register to see this link.

, it was decided to automate this process in the same way on fibaro. Experts, tell me where errors were made in the code? Thanks in advance. 

 

Please login or register to see this code.

 

Posted

@[email protected]

Please login or register to see this code.

 

Posted (edited)

You have too many errors in IF statement, but I think it's too complicate solution.

It should be very simple based on door and lights state (no need to count door cycles...I think)

try that:

Please login or register to see this code.

The idea is very simple...

When door opens for the first time the lights are off, so you turn lights ON

When door opens again and lights are ON, means this is the second time and you are leaving. Turn lights off.

Try it... and I believe you'll be supersized.

 

Edited by cag014
Posted (edited)
46 minutes ago, cag014 said:

You have too many errors in IF statement, but I think it's too complicate solution.

It should be very simple based on door and lights state (no need to count door cycles...I think)

try that:

Please login or register to see this code.

The idea is very simple...

When door opens for the first time the lights are off, so you turn lights ON

When door opens again and lights are ON, means this is the second time and you are leaving. Turn lights off.

Try it... and I believe you'll be supersized.

 

I started with something like this to, but when someone opens the door and closes it without entering the light will stay on. I have migrated all these kinds of scene’s to nodered / homeassitant and have an almost perfect flow now. Maybe you can use it for your code. I have a motion sensor and a door sensor.

 

 

The light turns on when the door opens or when movement is detected and turns off when the door closes. It turns of immediately when no movement is detected and after a minute if movement is detected. The timer of the motion sensor clears after 10 second and can be retriggered. If you retrigger it in the remaining 50 seconds it will almost never turn of until the door is opened and cloed again. The light can also be turned off when no motion is being detected. This will happen after 2 minutes if the door is open (small children in the house which leave the door open a lot) and after 9 minutes with the door closed (almost impossible to end up in the dark when watching YouTube on the toilet). The motion sensor is below the sink so it will see the movement of just 1 finger. Opening the door and new motion detected will reset all timers and stop the flow at that point.

 

Please login or register to see this attachment.

Edited by Jeroen_
Posted (edited)

OK... now we have motion sensor, that's different story...

By the way you can use timeout, so even someone not entering the lights will turn OFF eventually.

The best way to have it working perfectly is to have two motion sensors. Inside and outside.

Edited by cag014
Posted
1 hour ago, cag014 said:

OK... now we have motion sensor, that's different story...

By the way you can use timeout, so even someone not entering the lights will turn OFF eventually.

The best way to have it working perfectly is to have two motion sensors. Inside and outside.

I have outside motion sensors (2x, 1 in both ends of the hallway) and thought about adding these, but they will not bring anything in my setup. The timeout function is something I used in the beginning in my code, but I don't want the light on unneeded and also the ventilation is triggered by the light. It turns on when the light is on and if the light is on more than 4 minutes it turns to the high setting (you can guess why ?). After the light is turned off timers will set it to low and off again. Ventilation setup is till running in LUA on my HC2.

 

Many things can be done easily, but when you want it to work exactly as you which, it gets "complex" very fast.

 

I don't want to highjack this topic, but just share my input on it after having modified the code (in the beginning) and flow (now) many times because I was not satisfied with the results.

Posted

To my opinion the best idea is to use curtain sensor which defiantly recognized presence in the toilet, bath and etc.  even when no motion detected.

They comes NO/NC relay that could be connected to any Z-wave device  (like wall switch, implant...).

For example

Please login or register to see this link.

 

As you mentioned, simple solution becomes "complex" when think through 

Posted (edited)
20 minutes ago, cag014 said:

To my opinion the best idea is to use curtain sensor which defiantly recognized presence in the toilet, bath and etc.  even when no motion detected.

They comes NO/NC relay that could be connected to any Z-wave device  (like wall switch, implant...).

For example

Please login or register to see this link.

 

As you mentioned, simple solution becomes "complex" when think through 

 

These are nice sensors, but I don't understand how these will benefit in the toilet or bathroom. Setting these up on eater side of the toilet is visually not a nice solution and 1 motion event after closing the door is enough for a reliable solution. For the bathroom I'm, still trying to perfect my setup. Showering, going to the toilet and doing things behind the sink works perfect with 2 motion sensors in the room, but when in bath the light can turn off unwanted. I now use the humidity sensor to prevent the lights going off, but this has the effect that the lights also stay on when the bathroom isn’t being used anymore. A working solution is to set a variable on my HC2 through google assistant present on my sonos speaker in the bathroom. This works great but isn't fully automatic. I don't see any use of the mentioned sensors for detecting me in bath. Do you have a suggestion for that?

 

The problem for the bathroom compared with the toilet is that the door is being used by other household members when in bad or showering, which for the toilet isn't the case when somebody is using it.

Edited by Jeroen_

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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