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!



Smart Home Forum by FIBARO Team

dimmer 2 script lua


Recommended Posts

Hello everyone,


Today I installed my first dimmer 2 and it is working very well ( I'm so proud of me, lol ). Also I configured it to start when I open the door but I think I need some help configuring it with the motion eye.

I tried with this LUA script and it is working ok but I'm looking for some improvement.

Please login or register to see this code.

I want to make the motion eye a bit faster and how can I insert a wait command after the "else" ?

I mean, I want to close the bulb after 5 minutes. 


PS. I have the standard value at the parameters.

PS2. I also tried the association between motion eye and dimmer but it is not working.


Thank you!

Link to comment
Share on other sites

To make it faster, you need to configure your motion eye device. Honestly it usually doesn't help much.

To turn OFF the bulb after 5 minutes is a little bit  tricky to implement in scene. The problem when you start the delay for 5 minutes and then the motion eye is triggered again, so you need to restart the delay. But it is doable

Since you didn't post your entire code, I use as an example for your motioneye = 400 and BULB=200

In general %% killOtherInstances will kill all previous scene instances and will start the 5 minutes again and again...

In addition I have added state verification for BULB before sending command. I'm strongly recommending to verify device state before sending command. It reduces Z-wave traffic significantly, otherwise you may have delays and freezes in your system

Please login or register to see this code.



Link to comment
Share on other sites

  • 7 months later...



You mention to verify device state before sending command - is fibaro:getValue() not checking via the z-wave network for the state? That would actually increase the traffic, right?


Secondly, from time to time I have some problems with dead devices - after sending the fibaro:call(id, "wakeUpDeadDevice") command the connection is restored and it works again.


Is there like a little "perfect" fibaro:call() function that not only checks for the value (first example) to reduce traffic and also checks for the dead-status of the device and wakes it up again?



Link to comment
Share on other sites

No, fibaro:getValue() function gets the value already stored in the system.

Regarding dead traffic, it's a little bit complicate to catch the problem, but it possible using refresh API.

I have released All-in-One Scene, which can show your dead traffic... please downloaded and run it as is just to check how often your device id dead.

If you have too much dead traffic, I suggest to relocate the device (sometime few millimeters makes the different)

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.

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