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
FamSetsaas 0
Hi Fibaro experts,
I'm trying to implement error handling for temporary errors in the main loop of a VD, but got stuck.
I've made a setError function, which sets an error icon, and sets the lblStatus text on the VD. Then I want to exit this instance of the main loop of the VD. I've tried fibaro:abort() in the error function, but this seems to permanently stop the VD execution.
This is about what I am trying to achieve
-------------------------------------------
function setError(txt)
-- Set VD icon
-- Set lbl txt
fibaro:sleep(sleep_time)
<Exit this instance> <--- This is what I cannot figure out how to do. I want to exit this instance
end
-- Main code
<do something>
if status ==1 then setError()
<do something else>
if status == 2 then setError()
etc...
fibaro:sleep(sleep_time) <--- Restart the main loop after sleep_time
-------------------------------------------
So whenever the setError() function is called (also within other functions), the main_loop of the VD should exit.
But the main loop shall be restarted again after one second, just as if execution when through to the bottom.
Any ideas?
3 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.