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?


Pete123

Question

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.

Link to comment
Share on other sites

Recommended Posts

  • 0
2 minutes ago, jgab said:

It was a rewrite of the original example where I have 

Please login or register to see this code.

:-)

When we can use the tag for something I will revert :-) Now every HC2 coder including myself forgets the tag...

 

 

Absolutely, happens to me all the time.

Link to comment
Share on other sites

  • 0
7 minutes ago, cag014 said:

Absolutely, happens to me all the time.

 

I get an 501 when doing 

Please login or register to see this code.

but I guess that is something that will come?

It would be cool if the tag replaced the standard [DEBUG] we get now...

Link to comment
Share on other sites

  • 0
1 minute ago, jgab said:

 

I get an 501 when doing 

Please login or register to see this code.

but I guess that is something that will come?

It would be cool if the tag replaced the standard [DEBUG] we get now...

Yes

Currently there is a bug in that, should be fixed on next release.

All scenes debug info goes to same debug output and makes a huge mess.

Link to comment
Share on other sites

  • 0
22 minutes ago, cag014 said:

Yes

Currently there is a bug in that, should be fixed on next release.

All scenes debug info goes to same debug output and makes a huge mess.

 

...and why don't they then add a tag to the QuickApp's self:debug too?

I would prefer that they implemented logger.* that there seems to be left-overs of in the QuickApp environment and let the debug functions default to logger.info() or logger.log()

We also have logger.error() and logger.trace()...  and logger would tag the debugMessages accordingly...

 

...but now we our getting outside the topic of the thread.

Edited by jgab
Link to comment
Share on other sites

  • 0
Guest rafal_ll
W dniu 16.02.2020 o 13:22, jgab napisał:

 

This was a half-joke but it actually works. If you set "Allow to restart a running scene" to 'no' (similar to "if fibaro:countScenes() > 1 then fibaro:abort() end") 

you can code like this (almost like in the old days).

Please login or register to see this code.

In practice the fibaro.sleep loop should be changed to a setTimeout loop to adopt the new coding style imposed, because sleep is a bit heavy on the system...  - but that's left as an exercise to the reader.

The condition sections to trigger on motion sensor with id 32 being breached should be:

Please login or register to see this code.

 

 

 

Hello after the update has stopped working
I get the message "attempt to compare string with boolean"

 

 

Link to comment
Share on other sites

  • 0
33 minutes ago, Tony270570 said:

hi @rafal_ll the old getvalue on motion /widows sensors/ returns now a bolean , try this:

Please login or register to see this code.

 

 

Yes, it's a moving target. With the support for fibaro.sleep the scene looks like this now.

Please login or register to see this code.

The conditions part looks the same.

  • Thanks 3
Link to comment
Share on other sites

  • 0
10 hours ago, jgab said:

 

Please login or register to see this code.

The conditions part looks the same.

 

Thank you, @jgab!

 

I've been testing this scene, but the light always turns off after 5 seconds (probably due to the default setting of 5 seconds of the Parameter 6 "Motion detection - alarm cancellation delay" of the Fibaro Eye), but keeps counting to 60. Even if I do motion within 60 seconds it does not turn on.

Link to comment
Share on other sites

  • 0
8 minutes ago, robw said:

 

Thank you, @jgab!

 

I've been testing this scene, but the light always turns off after 5 seconds (probably due to the default setting of 5 seconds of the Parameter 6 "Motion detection - alarm cancellation delay" of the Fibaro Eye), but keeps counting to 60. Even if I do motion within 60 seconds it does not turn on.

 

-Have you set the scene's  "Allow to restart a running scene" to 'no' ?

-When it turns off after 5s is it the scene that does it? , Do you see the log output from fibaro.debug("","Turning off") ? If not you have another scene that turns it off - or an association?

--Try setting down 'sleepTime' to 3s

Link to comment
Share on other sites

  • 0
4 minutes ago, jgab said:

 

-Have you set the scene's  "Allow to restart a running scene" to 'no' ?

-When it turns off after 5s is it the scene that does it? , Do you see the log output from fibaro.debug("","Turning off") ? If not you have another scene that turns it off - or an association?

--Try setting down 'sleepTime' to 3s

@jgab

Thank's! You have my permission to hit me in the head with a large cup of coffee! :) My apologies, it was another scene that I forgot to turn off, that turned off the light. Everything is working now! Thank you again!

Link to comment
Share on other sites

  • 0
On 2/16/2020 at 1:22 PM, jgab said:

 

This was a half-joke but it actually works. If you set "Allow to restart a running scene" to 'no' (similar to "if fibaro:countScenes() > 1 then fibaro:abort() end") 

you can code like this (almost like in the old days).

...

 

Thanks jgab. Thanks to this kind of ideas I can make my HC2 to HC3 working again. 

 

(btw my HC3 doesn't like the single quotes, I had to use double quotes)

Link to comment
Share on other sites

  • 0
On 3/1/2020 at 7:32 AM, jgab said:

 

-Have you set the scene's  "Allow to restart a running scene" to 'no' ?

-When it turns off after 5s is it the scene that does it? , Do you see the log output from fibaro.debug("","Turning off") ? If not you have another scene that turns it off - or an association?

--Try setting down 'sleepTime' to 3s

 

Today these scenes just stopped working.

 

Edit: It was a variable crash. Everything is working now.

Edited by robw
Link to comment
Share on other sites

  • 0

I am getting an error and the scene does not work. Whath am i doing wrong.

[ERROR] 05.03.2020 20:27:54: (load):8: unexpected symbol near '<\226>'

Link to comment
Share on other sites

  • 0
W dniu 5.03.2020 o 20:29, marius de jong napisał:

I am getting an error and the scene does not work. Whath am i doing wrong.

[ERROR] 05.03.2020 20:27:54: (load):8: unexpected symbol near '<\226>'

 

I have this same error message.

 

EDIT:

Copy and paste this script and delete quotes and insert manually.

Works.

Edited by motyk123
Link to comment
Share on other sites

  • 0
On 3/5/2020 at 8:29 PM, marius de jong said:

[ERROR] 05.03.2020 20:27:54: (load):8: unexpected symbol near '<\226>'

 

16 minutes ago, motyk123 said:

 

I have this same error message.

 

 

Look at the last line of your scene - look carefully at the single quotes... See something strange? No? they are "angled" and that does not work, it causes "unexpected symbol near '<\226>'"

 

Please login or register to see this code.

So fix that line, instead write:

 

Please login or register to see this code.

 

EDIT: forgot to mention... There is onother one to fix on line 8, fibaro.call(light,'turnOn') - check all quotes

 

On 3/1/2020 at 7:20 AM, robw said:

Thank you, @jgab!

 

I've been testing this scene, but the light always turns off after 5 seconds (probably due to the default setting of 5 seconds of the Parameter 6 "Motion detection - alarm cancellation delay" of the Fibaro Eye), but keeps counting to 60. Even if I do motion within 60 seconds it does not turn on.

 

@robw the code with wrong kind of quotes is in your post because you've quoted a version with that error, can you please fix that? Jgab already fixed his version here...

 

 

 

 

Edited by petergebruers
Link to comment
Share on other sites

  • 0
2 hours ago, jimicr said:

Hi guys, I edited the scene and runs for me (see code below).

I added check against lux, manual override and check if light is on or off all ready.

It runs like a charm but I think the pro's here can clean the code to make it better.

 

maybe this helps someone.

 

Jim 

 

Thank's, Jim! Do you have a Hometable script for the HC3? Would you mind sharing it here?

 

Have a nice day!

Edited by robw
Link to comment
Share on other sites

  • 0

@robw No problem:

 

You'll have to create the variable manual as standard variable.

Please login or register to see this code.

 

  • Like 1
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...