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

Basic Code Clips for LUA starters


robmac

Question

To help those that are not familiar with LUA a starter library of clips that work in Fibaro.

Please add any you find useful.

Link to comment
Share on other sites

  • Answers 151
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

Recommended Posts

  • 0
Guest fat

Thanks once again for your help with code GG. Should I place it in the place I mentioned above?

Link to comment
Share on other sites

  • 0
Guest Fade2Gray

Hi everyone,

I was wondering if someone could please assist with a Lua script to trigger a device upon HC2 receiving an e-mail

For very simple basic example: If HC2 recieves an e-mail from [email protected] it will then turn on a light.

Thanks in advance, l am hopign this could be achieved

Link to comment
Share on other sites

  • 0

example virtual device who can control heating panelIn zone id 1 I want change temperature for Monday on 12

Please login or register to see this code.

and here you got example for Holiday Mode0 - turn off Holiday Mode>0 turn on Holiday Mode and set that temperature

Please login or register to see this code.

Hello, i have tested this script in my home center with fw 4.040, but doesn't start, the temperature no changed. Why? I'm a new user and i'd like to have support from community.

Best regards

Link to comment
Share on other sites

  • 0

example of Scene activation for dimmer

change 507 for id your device

Please login or register to see this code.

 

Hi,

 

I'm trying to get this working as my first LUA script on 4.040 and a Fibaro dimmer.  I have set the parameter 41 of the dimmer to activate scene and have the scene started. I can see the correct switch name appear in the debug window when I start the scene BUT nothing is written to the debug window when I press the up or down (it is a retractive switch) buttons on the switch.

 

Sorry for the real Newbie question but does this script need to be placed inside a loop?  Is it just running when I press start/run and then finishing when it gets to the end or does it run somehow run from the top every time a switch is pressed.  I'm pretty good at programming so that isn't the problem but trying to understand how to get scenes to fire is!

 

I'm sure once I get one working then it'll all will drop into place but at the moment I could do with some pointers.

 

Of course it could be a 4.040 "thing" as people seem to be saying that breaks everything but as a new (owning HC2 less than a month) I have no frame of reference here on what should work or not.

 

Thanks

 

Julian

Link to comment
Share on other sites

  • 0

hello there I'm a LUA newbie and i would like to ask for something that i still don't know how to do

how to make a specific scene run only between a time interval, say for example from 4 pm till 9 pm

how to make cuz i used every block in there but i cannot manage to make it work

 

Thank you

Link to comment
Share on other sites

  • 0
Guest fat

i do something like that by using a global variable. I have a variable that changes to run a light triggered by motion between 10pm and sunrise

Link to comment
Share on other sites

  • 0

hello there I'm a LUA newbie and i would like to ask for something that i still don't know how to do

how to make a specific scene run only between a time interval, say for example from 4 pm till 9 pm

how to make cuz i used every block in there but i cannot manage to make it work

 

Thank you

 

Two ways to do that - use global variable that will be set on 4pm and cleared on 9pm, or simply check with this line every time scene runs:

Please login or register to see this code.

Link to comment
Share on other sites

  • 0

Hi guys,

 

I openend a new topic already but unfortunately I didn't get much replay yet. Maybe i didn't explain it properly.

I use the fibaro roller shutter 2 to control my venetian blinds. my idea was to ask the HC2 to close the blades (lamella) to 50% if its sunny outside and open them to 100% as soon as its cloudy. this should be done only in the case that my blinds are down. (might be up as its too windy).

So far HC2 closes the blinds to 50% as requested, but the scene starts again and again every  2 or 3 minutes. I suppose that the timeframe when the HC2 get a new weather update via the included weather app.

I tried to set a value for the blades, like start only if the blades are in 100%, but unfortunately that doesn't work neither. I believe HC doesn't know the exact blade position. 

What do i need to type in my lua code to start this specific scene just once and not over an over again.

Any idea?

Link to comment
Share on other sites

  • 0

Is there a way in which I can trigger my scene when any devices' value is changed ?

Instead of writing this

Please login or register to see this code.

do I have to write all my devices' IDs??

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