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

Question
Steve 0
Hi,
I'm new to Fibaro and Lua, I have just brought this system for my company and am trying to set it up.
We have a compressor that I wish to control and I'm writing a script in Lua.
I have written a simple procedure to start at a set time based on the day and then to turn off at a set time, however due to overtime requirements some times we want to start and stop at different times and sometimes Saturdays.
I don't want to adjust the times myself, I want other employees to be able to set the times but I don't want them in my program so I am hoping that I can use variables.
Therefore have a start time variable, a stop time variable and a Saturday start and stop time variable.
Can someone advise me the format for the variable - ie would 0700 work and how to use this in Lua
Something like
Varible "StartTime" 0700
then in the program
( ((currentDate.wday == 1) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) ==getGlobalValue("StartTime")) )
Thank you
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.