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

Auto light in Bathroom [LUA] [READY SOLUTION]


Question

Posted

Have fun!

Please login or register to see this code.

Recommended Posts

  • 0
Posted

I changed it for global variable

Please login or register to see this code.

Seems to work, I don't know what it will do when:

Please login or register to see this code.

  • 0
Posted
rafal.m,

I removed my doors from Alarm panel, but I still get notify on HC2 when it's disarmed. Any solution?

I also have the same problem, sensors removed from the 'alarm panel' keep notifying when they breach.

  • 0
Posted

Change into a global variable and working perfectly.

  • 0
Posted

can you post the version that use global variables here

  • 0
Posted

Please login or register to see this code.

But is not working perfectly, I don't have time to work correctly on it.

  • 0
Posted

I think that global variable can hold only binary values - is this right ?

the script use

lastArmed = fibaro:get(doorID, 'armed');
which is a build-in function of fibaro I assume - it looks like that it return a date / time variable that is been used in the timeout calculation
(os.time()-lastArmed)>=timeToEnter)

is there a way to log the door close event and get the time stamp of it without to use the 'armed' functions

anyone ?

  • 0
Posted
I think that global variable can hold only binary values - is this right ?

No you can set string value but the variable panel interface has "issues"

You can monitor the "Value" property in a scene to be notified and get timestamp. 0 == closed 1 == open.

  • 0
Posted

changed - using now Global variables and not 'Armed' System

enjoy

Nadav

Please login or register to see this code.

  • 0
Posted

have this codes working for few weeks, loved it.

Now i update to latest beta version and its broken..

can sombody help me with the code, and settings of the door sensor and light dimmer ?

Please login or register to see this code.

lots of problems with the latest beta this is almost my last issue

thanks already

  • 0
Posted

if (fibaro:countScenes()>1) then

should be

if (tonumber(fibaro:countScenes())>1) then

  • 0
Posted

hmmm change the line but stil no luck.

complete delete the scene , ad the scene again nothing...

Please login or register to see this image.

/emoticons/default_icon_sad.gif" alt=":-(" />

also nothing in the debug.

checked the ID's they are 100% okay.

on arming or disarm the door ID switch to it.

[ Added: 2014-09-07, 13:13 ]

Went back to good old firmware again.

copy the code into it and scene is working like a sharme.

something is just wrong with the new beta. send it to a member of fibaro group hope they fix it soon

[ Added: 2014-09-07, 13:13 ]

Went back to good old firmware again.

copy the code into it and scene is working like a sharme.

something is just wrong with the new beta. send it to a member of fibaro group hope they fix it soon

[ Added: 2015-01-08, 14:09 ]

a.socha helped with the code.

Please login or register to see this code.

  • 0
Posted

But what iff the door opens my child is sitting but not closed the door. She is finished goes out en closed the door. does the light stays on?

thanks

  • 0
Posted

No problem, test the code of rafa half year now. It's perfect.

Your situation with child and door still open. Code see it as "cleaning" because a time of 10 seconds or longer the door is open.

when closing the door lights go out

one of the reason i called support , can't live without it

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

  • 0
Posted

Top works great. only one issue more

what iff someone goes to the bathroom closes the door, finished, opens the door en whitout closing the door someone else goes in. then the lights goes off. do we nead a motion sensor.

thanks, also the children says thanks

  • 0
Posted

That is indeed the situation, and i think only that the light go off, you always can toggle it manually for that time.

I have this scene, ground floor with our dutch small toilet

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" /> . It normal never happens except if some waiting while other comes out. But that is 1 of 100 for us.

It is also mind step, always close the door when walking outside.

Upstairs with our shower , in combination of toilet I got stevend smart lights, with motion (for me Aeon labs multi, i run nother scene also for a fan) and a dimmer.

That's a outstanding code. Use it with 3 scene's in the house

Then always light trigger on motion. I have several day type, and depending on that the light set's a dimm level. (handy for middle of night).

I'm just few months on the way with fibaro with small amount of devices but these scene's makes my day

Please login or register to see this image.

/emoticons/default_icon_smile.gif" alt=":-)" />

  • 0
Posted

This scene does not work anymore with 4.031

Do i mis something?

[ Added: 2015-01-13, 23:35 ]

Sorry, i use the new code writen by D-Vine and a.socha and now everything is ok again

Please login or register to see this image.

/emoticons/default_icon_redface.gif" alt=":oops:" />

  • 0
Posted
Have fun!

Please login or register to see this code.

Have applied the above mentioned code in HC2 version 4.032. But not working

Any suggestions??

  • 0
Posted

read page 3 good , you will find your solution

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

  • 0
Posted

Hello,

 

Have two lights in bathroom.

With door sensor want to operate each lights but individually in day and in night.

Ex. Morning 6am to 12am(First light) and Midinight 12 am to 6 am(Second Light).

Any suggestions??

  • 0
Posted

Hi,

 

at first I want to thank the topic-starter rafal.m for his code. Works very good

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" /> But I have a child at home, so the door sometimes not being closed. So I decide to add a motion-sensor in the bathroom in the code. I remove the manuel-switch. (The light doesn't switch off, when somebody is inside the room. Have fun

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" />

Please login or register to see this code.

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