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

Motion sensor scene triggering


WiYantra

Question

Hi Forum,

We have installed Fibaro Motion sensor on HC2, we would like to know how efficiently we can use the motion sensor in different scenarios

We have a scenario like

When someone enters in Living room motion sensor has to detect the motion and trigger the lights ON and if there is no motion detected, then it should turn OFF the lights. How efficient can the motion sensor will work with this scenario.

How can we create a scene for the above scenario.

In the advanced settings we have noticed there are plenty of parameters, can anyone give us some shortcuts on how to make use of those parameters to make automation more effective.

Link to comment
Share on other sites

Recommended Posts

  • 0
Great, glad to hear that!

@Dalle1985

Just a quick note. After playing with the scene, i noticed that when the scene is active, my dimmer does not report energy usage anymore? As soon as i stop the scene and switch the light on normaly it reports energy ussage again.

A second thing i noticed is that i can't manually DIM the light anymore from my HC2 while the scene is active. It will just jump back to the set value in the LUA script.

Any fixes or work arounds for this?

Link to comment
Share on other sites

  • 0

The energy reporting, I have no idea why isn't working... Perhaps the system doesn't update quickly enough. I don't use it as it is simply a calculated value and it doesn't reflect true consumption.

As to the second issue regarding not being able to control dimming while the scene is active, a workaround could be to insert below code just after "fibaro:sleep(1000)":

Please login or register to see this code.

Change the value in killScenes to whatever is the id of your scene. What that will do is to check if the dimlevel of the dimmer varies by more than 2 from the current dimlevel and if that is the case, it will kill itself keeping the light level at the setting you've chosen (unless it is the same as the current dimlevel in which case it is quite a bit more difficult to kill the scene).

Next time you turn off the light in the room manually, the scene will be ready again and will work next time you walk into the room.

This should work, however, I haven't tested it as my philosophy is that everything should work on full auto. So most of my rooms are controlled by modes, meaning that the light in the living room will react differently if the mode is set to cleaning (activated by i.e. The vacuum cleaner being turned on, which will turn off all radiators, set color temperature (of hue lamps) to a colder tone and increase startdim to 100) or set to "movie mode" activated by activity in my home theater which will set the startdim lower and change the hue bulb color temperature to a warmer glow. Modes can of course be chosen manually on my tablet interface, but the philosophy is that my house should adapt to what we are doing automatically... I'm not there yet, but we are getting there.

Link to comment
Share on other sites

  • 0
The energy reporting, I have no idea why isn't working... Perhaps the system doesn't update quickly enough. I don't use it as it is simply a calculated value and it doesn't reflect true consumption.

As to the second issue regarding not being able to control dimming while the scene is active, a workaround could be to insert below code just after "fibaro:sleep(1000)":

Please login or register to see this code.

Change the value in killScenes to whatever is the id of your scene. What that will do is to check if the dimlevel of the dimmer varies by more than 2 from the current dimlevel and if that is the case, it will kill itself keeping the light level at the setting you've chosen (unless it is the same as the current dimlevel in which case it is quite a bit more difficult to kill the scene).

Next time you turn off the light in the room manually, the scene will be ready again and will work next time you walk into the room.

This should work, however, I haven't tested it as my philosophy is that everything should work on full auto. So most of my rooms are controlled by modes, meaning that the light in the living room will react differently if the mode is set to cleaning (activated by i.e. The vacuum cleaner being turned on, which will turn off all radiators, set color temperature (of hue lamps) to a colder tone and increase startdim to 100) or set to "movie mode" activated by activity in my home theater which will set the startdim lower and change the hue bulb color temperature to a warmer glow. Modes can of course be chosen manually on my tablet interface, but the philosophy is that my house should adapt to what we are doing automatically... I'm not there yet, but we are getting there.

Hi Dalle1985,

Thank you for that. It works as intended but n i realise that is not exactly what i want.

Still new at LUA (Just got my HC2 2 Day's ago)

How do you change the "StartDim" value for your modes? Do you create a script for each mode with diffirent "StartDim" value or does it get changend in one script automatically?

Is it possible for you to share your scripts with me? I just learn quicker if i see how something is done and what it does.

Tnx again for all your help.

Link to comment
Share on other sites

  • 0

I have all my modes in one script. The script changes a multitude of sliders and global variables based on the value of a global value. So in the script I use, startdim is equal to a global variable which is then changed by the modes script.

Link to comment
Share on other sites

  • 0

Hi Everyone.

I need some help please. I am using the XBMC plugin to DIM my light when starting a movie, PAUSE and END. What i want to do though is that when i watch a movie during the day, the lights shouldn't DIM or turn on when my motion sensor detects it's light.

In other words, Lights should only start when it's dark enougth and the scene should also check first if the light is allready on?

I am stil trying to figure out the LUS scripting.

So if anyone can assist me i will be very greatfull. Here is the code....

Please login or register to see this code.

[ Added: 2014-05-15, 20:54 ]

Anyone?

Link to comment
Share on other sites

  • 0

I tried your script as well and it worked well. It´s great, because it is the first working LUA script for me

Please login or register to see this image.

/emoticons/default_icon_biggrin.gif" alt=":-D" />

But I´m not sure, if I can use it permanetly, because I don´t have a dimmer, I only have a normal micro switch without any dimmer functionality. Do I have to change parts of the code (which one?) or can I still use it?

Thanks a lot...

Link to comment
Share on other sites

  • 0
I tried your script as well and it worked well. It´s great, because it is the first working LUA script for me

Please login or register to see this image.

/emoticons/default_icon_biggrin.gif" alt=":-D" />

But I´m not sure, if I can use it permanetly, because I don´t have a dimmer, I only have a normal micro switch without any dimmer functionality. Do I have to change parts of the code (which one?) or can I still use it?

Thanks a lot...

Hi jojo1967,

You can just replace this line - fibaro:call(35, "setValue", "40");

with this - fibaro:call(35, "turnOn"); where 35 is the ID of your light switch.

Below is my LUA code now working 100% and will only start lights if LUX is under 30

Please login or register to see this code.

[/code]

Link to comment
Share on other sites

  • 0

Thanks Valken for your fast response, but my question was mistakable. I used the LUA script from Dalle1985 and I wasn´t sure if I can use it with a normal micro module switch.

Do you know what I have to change in this script too?

Please login or register to see this image.

/emoticons/default_icon_rolleyes.gif" alt=":roll:" />

Link to comment
Share on other sites

  • 0
Thanks Valken for your fast response, but my question was mistakable. I used the LUA script from Dalle1985 and I wasn´t sure if I can use it with a normal micro module switch.

Do you know what I have to change in this script too?

Please login or register to see this image.

/emoticons/default_icon_rolleyes.gif" alt=":roll:" />

Hi jojo1967,

Which script is that? I am using this one (

Please login or register to see this link.

)

It is easy to set multiple lights with diffirent times - and easy to configure for non-dimable lights.

Let me know if you dont come right.

Link to comment
Share on other sites

  • 0

Hi guys,

Sorry for not responding sooner I had missed the new posts. I'll post something for you later jojo... But the code should work with a micro switch, however not perfectly. I'll just update the code to fit your purpose (it is quite a bit simpler if it just needs to turn it on and off directly without dimming).

[ Added: 2014-05-26, 19:42 ]

Okay, so as promised, the scene which will do the same for a switch:

Please login or register to see this code.

This has not been tested, but it should work for the switch. [/code]

Link to comment
Share on other sites

  • 0

Dear Dalle1985! That´s so nice of you, to change the script for my micro switch. Thanks a lot for this.

Please login or register to see this image.

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

Yesterday I had only a few minutes to try it, but unfortunately it didn´t work (that´s strange because your oiriginal script for the dimmer worked fine). I´ll have to try it this evening again.

Is it possible that I made a stupid mistake with using your script? I opened the old scene with your script for the dimmer, clicked on advanced settings, deleted the old script and copy/pasted the new one. Then I changed the ID´s to my motion sensor, my lux sensor and my micro switch and the correct ID of the scene at the end and saved it with the save-button on the right. I waited a few hours (because I didn´t know if the scene needs a new wake-up of the devices) but it didn´t work. But when I pressed the Run-Button on the scene, the light went on immedeatly...

BTW: Do I only have to change the value "local starttimer =60" to "30" if I want to reduce the light on - time to 30 seconds?

Link to comment
Share on other sites

  • 0

Yes, just change it to 30 to get 30 sec. Do you get any error messages if you press start manually on the scene?

And did you change:

24 value

27 value

To the id of your motion detector and the lux sensor?

Link to comment
Share on other sites

  • 0

YES - it works perfectly. Many thanks! How stupid - I forgot to change the values in the first lines (24, 27)

Please login or register to see this image.

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

Link to comment
Share on other sites

  • 0

Your welcome... Honest mistake.those two values are easy to miss, but what they actually do is to trigger the scene on change of either the motion sensor or the light sensor. So when you didn't change those two, hc2 don't know to listen to the two values and trigger the scene if one changes.

Link to comment
Share on other sites

  • 0

Sorry, but I still have one problem with the script. Allways in the morning the motion triggering doesn´t work anymore. After switching the micro switch manually via the Iphone App it works well again for the whole day. Do you now what could be wrong?

(I checked the box "active scene")

Link to comment
Share on other sites

  • 0

That is very strange... I don't think it has anything to do with the scene as it doesn't know time. So it literallt won't know what is morning and what is evening. Have you checked in the fibaro web interface that it doesn't mark the device as dead every night? The app might auto wake up the device in case it has been marked as dead. Above script won't do that. Or do you have some sort of night mode which forces the light off at night? That might also block this scene from working?

Link to comment
Share on other sites

  • 0

I tested some alarm scenes and alarms in the evening. Could this be responsible for killing the script?

Link to comment
Share on other sites

  • 0
Hi guys,

Sorry for not responding sooner I had missed the new posts. I'll post something for you later jojo... But the code should work with a micro switch, however not perfectly. I'll just update the code to fit your purpose (it is quite a bit simpler if it just needs to turn it on and off directly without dimming).

[ Added: 2014-05-26, 19:42 ]

Okay, so as promised, the scene which will do the same for a switch:

Please login or register to see this code.

This has not been tested, but it should work for the switch. [/code]

@ Dalle1985 ..Could it be possible to modify the code for manual override from the wall button of the switch/dimmer ? I mean if we press the wall button (ON/OFF/ON) to disable the scene running and let the light stay ON or OFF(as we desire) for a specified amount of time(let's say for 4 hours) and after that to resume (activate) the scene for automatic light again.

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