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
drboss 107
This is modification of old scene used by many person. I need my modification because of many (biggest or smallest) problem each time when I upgrade HC2 with new firmware and the problem not happen direct after upgrade, but hours or days after (like my last problem with corrupt z-wave databases or 503 error after restart) .
I use 2 scenes:
First backup-create.lua for create backup with special description. This scene is called by for ex.
Please login or register to see this link.
one time by week. In this scenes You have parameters:The second scene backup-delete.lua is for management of backups. They check if exist any backups with criteria for delete (created by backup-create.lua or with special symbol in description and with put of defined time for store). After check they call function for delete backup.
In this scenes You have parameters:
Please login or register to see this attachment.
Please login or register to see this attachment.
Please login or register to see this attachment.
I have confirmation from Fibaro Support that "httpClient:request(url..." blocks handle until the scene code is over not only to end of called http work and return results. Because of this and limitation that /api/service/backups/'..id can only be launched once at the same time to delete more than one file, you must call the external scene who delete backups.
In this case the delete function is moved from backup-delete.lua code to backup-batch.lua. All necessary parameters are passed automatically to backup-batch.lua, You only need edit parameters in backup-create.lua and backup-delete.lua.
I added for batch process NotificationService with popups on web page like in situation with to many scenes run at same time
Please login or register to see this attachment.
For restore backup when I have 503 error without chance to login I use REST client for POST http://HC2IP/api/service/backups/ with payload {"action":"restore","params":{"id":928}}. "id" I take form GET http://HC2IP/api/service/backups
Link for source:
Please login or register to see this link.
Structure of backup description used by scenes:
![025] any character/any text
! - first symbol identify backup created and used by scenes, obligatory for treatment by this two scenes
[025] - number of days for store backup, not obligatory, if not exist the backup_stay defined in backup_delete.lua are used.
4 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.