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

CentralSceneEvent trigger in LUA


pineautomacao

Question

I have been trying to create the following scene in LUA:
When i double click the light switch (Fibaro Switch 2), i want to turn all the room lights on. I have set the switch's parameters 28 and 29 to enable 2x click.

Please login or register to see this image.

/monthly_2023_12/image.png.87b258d819daed1cd0612773486d11ac.png" />
I have also set the parameter 20 to the correct switch type.
image.png.cf89d5f3ef0d4e4b28f1a49ce5738dc9.png
This is my object IDs:
image.png.7a88341da5a779f4ab9d93f09e3db744.png
This is my LUA scene code (I have used this code as a template, since i don't know much about lua

Please login or register to see this link.

😞

Please login or register to see this code.


So the idea would be: if key is pressed 2x, the variable "Home" gets 1 (and trigger sceneID 68 - turn all on) or 0 (and trigger sceneID 69 - turn all off)
The issue is that i don't know which "CentralSceneEvent" ID to use, i tried 109.0.1 (remote controller) but it didn't work. How does these IDs work exactly for this type of event call? What should i point the id to?

Another thing i would like to know: Here i use a single ID that would call to both S1 and S2 of one switch. Can i insert more CentralSceneEvent IDs into this code, so that more switches can trigger the same scene, or i should copy this scene and create a new one for each switch?

 

EDIT: So i figured i was not using the correct ID's to trigger the scene. The 109.0 is actually 110, which made the scene work. Now i just have to figure if i can use more than one ID in the same scene, or if I have to duplicate the scene and switch the ID to the other switch that needs to trigger too. Does anyone know that?
 

Edited by pineautomacao
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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