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
Deivydas 4
Hello,
I'm new in LUA, but with some Experience in other programming languages.
I'm almost completing my first Quick App for Fibaro which allows to control GREE AC Units. To make completed this Quick App I need advices from other developers how to make changes in the code, how to organise the LUA code that it will use less RAM, CPU and other gateway resources.
The main Quick App Goals should be:
1. To Send commands to Gree AC Unit (turn on, off and etc). It's working right now2. Get the statuses from Gree AC Unit after each 5 minutes and update it to dashboard, history logs. And at this point I have some issues:
2.1 How to make loop which will be trigered in each X minutes? The problem is with correct loop function how to make it work.
How to get statuses is not a problemI have made a loop, but need that someone review it. Maybe @lazer you?
3. How to make default ON, OFF relay switch work in QuickApp? At the moment I have 2 functions Quickapp:on / Quickapp:off, but these functions should be trigered via default relay buttons.Answer: To make working default TurnOn, TurnOff buttons, functions should be named: Quickapp:TurnOn, Quickapp:TurnOff4. How should I organise the code? At the moment it's just 2 files: main file and aes library. It's doesn't look ok for me, because all the stuff is in the same file, this code is hard to read and understand
5. How can I have just 1 function with paramater, and this param should be passed when button is Click. For example I have function mode(which_mode) and there are 5 modes: auto, cool, dry, fan, heat. I would like to do that when button is clicked it trigger function mode ant pass the param for example - cool. Have no Idea How to Do
And at this moment that's all. After receiving advices, I'll keep this quickapp developing and when result will be fine, I'll share it with all of you
6. When I click On image, device doesnt turn on or off
7. How to save all actions to Fibaro History?Please login or register to see this attachment.
Edited by DeivydasUpdated
6 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.