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


  • 4

HC3 no motion for X time = lights off, how to?


Question

Posted

Hi,

 

How do you configure a scene that will turn on lights when motion and does not turn off until motion sensor has been safe for X time?

I am looking for both Lua and block options, if available.

Until now I have only found option for "delay" meaning lights will turn off after given time no matter if there has been motion during "delay" period.

 

Hope someone has found a solution for this.

Recommended Posts

  • 0
Posted
Quote

You could combine them in the same scene.

 

@jgab i tried combing the two but i'm pretty sure i've got it totally wrong, any pointers? (getting this error [ERROR] [SCENE62]: (load):59: 'end' expected (to close 'if' at line 43) near)

 

Please login or register to see this code.

 

Quote

That table could use sunset or global variables to define the times.

 

I tried to understand this but couldn't, i wanted to use this as the times:

 

Please login or register to see this attachment.

  • 0
Posted
2 hours ago, theuksbest said:

 

Does that mean you cannot include the Lux level as a condition on a binary switch, to simplify the scene?

 

So the device is only triggered when there's motion and the light threshold is met

In theory you could but I guess we are becoming philosophical now...

I believe it's strange with a binary switch that does nothing when I click on it because it has decided not to turn on because of the current lux level. Imagine if it was your physical switch on the wall and nothing happens when you click it because it's too bright. 

A multiLevel switch that adjust the level depending on the lux level and time of day could make more sense I guess. However, a dimmer wall-switch should dim up and down when pressed and hold without any limits.

I think it makes more sense then to add these extra conditions in scenes that are typically run automatically without human interaction. 

3 minutes ago, theuksbest said:

 

@jgab i tried combing the two but i'm pretty sure i've got it totally wrong, any pointers? (getting this error [ERROR] [SCENE62]: (load):59: 'end' expected (to close 'if' at line 43) near)

Missing and 'end' at the end.

Also remove the second copy of 'toTime'.

 

Ok, your variable 'DayNight' can have different values like 'Day', 'Night' etc. but what does that mean in actual time?

  • 0
Posted (edited)

Now I get it. Ok, you can make the scene much simpler.

Please login or register to see this code.

You still have a table where you map DayNight value to a dim value.

Edited by jgab
  • 0
Posted

@jgab Thanks, it's running and no errors so far so i'll monitor the behaviour and feedback. Thank you! Ow I've assumed i don't need to include my Lux sensor in the declarations, just my new binary sensor, hope thats correct. The device ID for it in the Actions is correct.

 

@Bodyart, @jgab - is there a QuickApp to view the variables i've setup, so i can see the current state - is there a file you can link me too like last time if there is?

  • 0
Posted (edited)
31 minutes ago, theuksbest said:

@jgab Thanks, it's running and no errors so far so i'll monitor the behaviour and feedback. Thank you! Ow I've assumed i don't need to include my Lux sensor in the declarations, just my new binary sensor, hope thats correct. The device ID for it in the Actions is correct.

 

@Bodyart, @jgab - is there a QuickApp to view the variables i've setup, so i can see the current state - is there a file you can link me too like last time if there is?

IMHO you don't need a QA to see them... Just go to Settings -> General -> Variables to see them..

If you want to read or manipulate them, then you need some coding.

 

Enjoy coding :-D

 

Please login or register to see this attachment.

Edited by Bodyart
  • 0
Posted

@Bodyartah yes you're probably right, it reduces a few clicks here and there but hopefully once setup i don't need to worry about it anyway! :) 

 

 

  • 0
Posted

@jgab I don't think it's working for me, the lights do not come on. I have seen a few errors [12.07.2020] [07:07:32] [ERROR] [SCENE62]: (load):18: attempt to perform arithmetic on a boolean value. However i think that went away when i added the Lux sensor to the declaration.

 

anything obvious i'm doing wrong?

 

Declaration:

Please login or register to see this code.

 Action

Please login or register to see this code.

 

  • 0
Posted

The error on line 18 (boolean) means that your lux sensor returned true/false for it's value - that should not happen if you had the ID of a lux sensors - you mixed it up with the motion sensor?

Otherwise there were an 'end' in the wrong place that made the code not work too. Added som log statements too.

Please login or register to see this code.

 

  • 0
Posted

@jgab 

Quote

you mixed it up with the motion sensor

 

I think that's probable as i was setting it up, that error has gone away now it seems.

 

I pasted in the code, but lights still not coming on and i don't see any errors appearing (current Lux 124)

 

Did i have the Decelerations setup correctly?

  • 0
Posted

Well, in the doc they don't explicitly say that we can use "anyValue" with booleans ?

I assume that 277 is your motion sensor? 

Please login or register to see this code.

You should not trigger on the lux sensor. The scene assumes that it's the motion sensor that have triggered it.

In case anyValue doesn't work for booleans try 

Please login or register to see this code.

 

  • 0
Posted

@jgab - i'll try plugging that in now - also noticed this though, the new device (ID 277) seems like it was an hour (57 Minutes) ago that it tripped, where the main device tripped more accurately recently

 

 

Please login or register to see this attachment.

  • 0
Posted
1 minute ago, theuksbest said:

@jgab - i'll try plugging that in now - also noticed this though, the new device (ID 277) seems like it was an hour (57 Minutes) ago that it tripped, where the main device tripped more accurately recently

 

 

Please login or register to see this attachment.

Can you see in the log window if it's crashed? Mine been running for weeks now.

Sometimes the UI "hangs" for me and I have to reload to get the current icon rendering.

  • 0
Posted

@jgab Not sure how to check the logs, is it the same as the debug screens?

 

I tried both actions above and doesn't seem to be triggering, i also refreshed the screen to make sure. It is counting up since the last detection but not re-detecting. It has been working so i don't know if i crashed it by using its ID in place of the Lux sensor by mistake.

 

how do i get it to restart, refresh, reload whichever it is? :)

 

Please login or register to see this attachment.

  • 0
Posted
19 minutes ago, theuksbest said:

I tried both actions above and doesn't seem to be triggering, i also refreshed the screen to make sure. It is counting up since the last detection but not re-detecting. It has been working so i don't know if i crashed it by using its ID in place of the Lux sensor by mistake.

how do i get it to restart, refresh, reload whichever it is? :)

QAs restart themselves every minute if they crash.

So I just looked at my QA and the UI had got "stuck". No matter of reloading the web UI helped. However, it still triggered in the background. 

Can you try this version that prints out log statements when its beached/safe etc, 

Please login or register to see this attachment.

 Don't forget to set the quickAppVariables.

If the QA works then there is something with your scene and/or condition.

 

 

  • 0
Posted

I tried this lua code, and it worked, though I tried associations in stead, and I cannot figure out why I shouldn't just use these?
Parameter 6 in the Fibaro Motion Sensor sets the timer for which the sensor will have to stay safe before "motion" is cancelled, this can also be utilized in LUA (no need for timer or even sleep)
Associating with a device (e.g. a Dimmer 2) in Group 2 (motion) will turn on the light on that dimmer, and turn it off again when the associated motion sensor did not discover motion with a period of time set in Parameter 6.
I also edited Parameter 3 to make it turn on instantly (first move), as I use it to turn on the light in our walk-in closet

  • Like 1
  • 0
Posted
6 hours ago, BrianDS said:

I tried this lua code, and it worked, though I tried associations in stead, and I cannot figure out why I shouldn't just use these?
Parameter 6 in the Fibaro Motion Sensor sets the timer for which the sensor will have to stay safe before "motion" is cancelled, this can also be utilized in LUA (no need for timer or even sleep)
Associating with a device (e.g. a Dimmer 2) in Group 2 (motion) will turn on the light on that dimmer, and turn it off again when the associated motion sensor did not discover motion with a period of time set in Parameter 6.
I also edited Parameter 3 to make it turn on instantly (first move), as I use it to turn on the light in our walk-in closet

If associations works for you its best (even the box doesn't have to be on). It's only if you need a bit more flexibility in how to group sensors/lights.

  • 0
Posted
15 hours ago, jgab said:

If associations works for you its best (even the box doesn't have to be on). It's only if you need a bit more flexibility in how to group sensors/lights.

Sure, if associations doesn't permit to add the needed flexibility, then the scenes in LUA are to be prefered, though I discovered a lot of settings directly at the sensor parameter to adjust in many given scenarios.

And I also recon that some times it would be easier to program it in LUA, even if it is possible in associations and parameters ;)

 

 

  • 0
Posted

@BrianDS I use a mixture of scenes and associations. Associations work faster in my experience and have some failsafe but limited in functionality, especially with some sensors. The Fibaro sensors are pretty good compared to the Aeotec MS6 for example. 

 

I recommend setting Parameter 9 as well which determine night and day from the lux level - that way you can control when the lights turn on at least.

 

cool stuff.

  • 0
Posted
12 hours ago, theuksbest said:

@BrianDS I use a mixture of scenes and associations. Associations work faster in my experience and have some failsafe but limited in functionality, especially with some sensors. The Fibaro sensors are pretty good compared to the Aeotec MS6 for example. 

 

I recommend setting Parameter 9 as well which determine night and day from the lux level - that way you can control when the lights turn on at least.

 

cool stuff.


I agree - though most simple applications can be solved by associations - I didn't set the lux level, as it is in a walk-in closet without windows - meaning, we would almost always want the lights to turn on anyway.

Only problem I have is that I get push notifications from the motion sensor several times a day, telling motion is detected, even though no one is in the room, and it didn't trigger to turn on the light - I have turned off the push notifications, and I know it is false motion alerts, due to the facts stated above - I still haven't solved that issue, but I have close to 100 notifications in 2-3 days.

 

  • 0
Posted
On 7/26/2020 at 12:08 AM, theuksbest said:

@BrianDS I use a mixture of scenes and associations. Associations work faster in my experience and have some failsafe but limited in functionality, especially with some sensors. The Fibaro sensors are pretty good compared to the Aeotec MS6 for example. 

 

I recommend setting Parameter 9 as well which determine night and day from the lux level - that way you can control when the lights turn on at least.

 

cool stuff.

 

Unfortunately, association didn't work for me in this case.

As soon as the lights turn on after a detected movement, the measured LUX-level increases above the value I inserted in Parameter 9 (due to all the lights that are on).

As a result the motion sensor will not detect a movement anymore, always resulting in switching off the lights after the delay I set in Parameter 6.

And when I increase the LUX detection value to a level above "all-lights-on-LUX-value", the lights will come on way too early during the day.

 

Making a Block scene was the only solution for me.

 

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