Updated Backup File Anatomy (markdown)

rstrouse 2024-02-24 10:10:35 -08:00
parent 56ca635707
commit be1261035f

@ -5,18 +5,42 @@ ESPSomfy-RTS backup files are assigned a version number so that over time, addit
The backup file has evolved over time but its structure and data layout has remained consistent. It consists of a header on the first line followed by one record per line. All data in the file is represented in text format for easy reading. Each data element is delimited by a comma or end of line to signify the end of the data element with spaces padding numeric values on the left and spaces padding text values on the right. In cases where the strings are variable in length the string is bound by quotes.
```
16, 56, 268, 7, 184, 1, 70, 112, 74,49E4AC
1,false, 3, 215021,My Awning , 0, 0, 56, 10000, 10000, 7000, 100, 4886595, 0, 0, 0, 0, 0, 0, 375, 2, 100.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 1, 0, 0, 0
2,false, 1, 215022,My Blind , 2, 0, 80, 41000, 41000, 3000, 100, 4886595, 0, 0, 0, 0, 0, 0, 820, 2, 100.00000, -1.00000, 0.00000, 0.00000,false,false, 1, 0, 0, 0, 0
3,false, 5, 215024,My Garage , 0, 0, 56, 10000, 10000, 7000, 100, 4886595, 0, 0, 0, 0, 0, 0, 563, 8, -1.00000, -1.00000, 100.00000, 0.00000,false,false, 2, 4, 0, 0, 0
4,false, 1, 215025,My Shade , 3, 8, 80, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 346, 1, 100.00000, -1.00000, 100.00000, 100.00000,false,false, 2, 6, 4, 2, 2
5,false, 8, 515025,Test Drape , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 202, 0, -1.00000, -1.00000, 48.80000, 0.00000,false,false, 0, 2, 0, 0, 0
6,false, 2, 515026,Drapery R , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 117, 0, -1.00000, -1.00000, 100.00000, 0.00000,false,false, 0, 3, 0, 0, 0
7,false, 9, 16148017,Test Dry Contact , 0, 0, 80, 10, 10, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 1566, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 5, 0, 0, 0
1, 0, 215023,Group1 , 0, 56, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0
"v2.1.10","ESPSomfyRTS","pool.ntp.org","PST8PDT,M3.2.0,M11.1.0",true
1,true ,"192.168.1.152","192.168.1.1","255.255.255.0","192.168.1.1","0.0.0.0", 0, 0, 0, 0, -1, 23, 18
true , 0, 56, 18, 5, 23, 19, 13, 12, 433.390, 97.22, 47.60, 10
21, 76, 29, 9, 276, 22, 194, 0, 77, 1, 76, 112, 74,579828
1,Kitchen , 1
2,Living Room , 2
3,Theater , 3
4,Dining Room , 4
5,Garage , 5
6,Patio , 6
7,Master , 7
8,Bedroom 1 , 8
9,Bedroom 2 , 9
1,false, 1, 842461,Over Sink , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 200, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 0, 0, 0, 0, 0, 1
2,false, 1, 842462,Nook Left , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 1, 0, 0, 0, 0, 1
3,false, 1, 842463,Nook Right , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 2, 0, 0, 0, 0, 1
4,false, 1, 842464,Left Side , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 3, 0, 0, 0, 0, 2
5,false, 1, 842465,Right Side , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 4, 0, 0, 0, 0, 2
6,false, 0, 842466,Screen , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 5, 0, 0, 0, 0, 3
7,false, 2, 842467,Blackout Front , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 6, 0, 0, 0, 0, 3
8,false, 7, 842468,Blackout Back , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 7, 0, 0, 0, 0, 3
9,false, 8, 842469,Slider , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 8, 0, 0, 0, 0, 4
10,false, 1, 842470,Side Window , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 9, 0, 0, 0, 0, 4
11,false, 6, 842471,Car 1 , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 10, 0, 0, 0, 0, 5
12,false, 5, 842472,Car 2 , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 11, 0, 0, 0, 0, 5
13,false, 6, 842473,Golf Stall , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 12, 0, 0, 0, 0, 5
14,false, 8, 842474,Slider , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 13, 0, 0, 0, 0, 7
15,false, 1, 842475,Side Left , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 14, 0, 0, 0, 0, 7
16,false, 1, 842476,Side Right , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 15, 0, 0, 0, 0, 7
17,false, 3, 842477,Left Side , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 2, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 16, 0, 0, 0, 0, 6
18,false, 3, 842478,Right Side , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 2, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 17, 0, 0, 0, 0, 6
19,false, 1, 842479,Front Window , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 18, 0, 0, 0, 0, 8
20,false, 1, 842480,Side Window , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 19, 0, 0, 0, 0, 8
21,false, 1, 842481,Front Window , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 20, 0, 0, 0, 0, 9
22,false, 1, 842482,Side Window , 0, 0, 56, 10000, 10000, 7000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.00000, -1.00000, 0.00000, 0.00000,false,false, 0, 21, 0, 0, 0, 0, 9
0, 0, 0, 0, 0, 0, 0
"v2.4.0","ESPSomfyS3-2","pool.ntp.org","PST8PDT,M3.2.0,M11.1.0",true ,true
1,true ,"192.168.1.183","192.168.1.1","255.255.255.0","192.168.1.1","0.0.0.0", 0, 0, 0, 0, -1, 23, 18
true , 0, 56, 8, 9, 7, 44, 4, 5, 433.420, 99.97, 47.60, 10
```
To ensure ESPSomfy-RTS does not try to digest an invalid file, the total size is calculated for all records in the file as well as each record length is verified. While this cannot catch all possible cases of a corrupt file it does capture any instances of incomplete or incorrect files while still allowing it to be edited.
@ -28,15 +52,28 @@ Each data element in the header record is fixed length followed by a comma. The
| ------ | ------ | ------ | ----- |
| Version | 3 | This is the version of the backup file | 1+ |
| Header Length | 3 | The total length of the header | 1+ |
| Room Rec Length | 5 | The total length of a single room record | 19+ |
| Room Rec Count | 3 | The number of room records in the file | 19+ |
| Shade Rec Length | 5 | The total length of a single shade record | 1+ |
| Shade Rec Count | 3 | The number of shade records in the file | 1+ |
| Group Rec Length | 5 | The total length of a single group record | 10+ |
| Group Rec Count | 3 | The number of group records in the file | 10+ |
| Repeater Rec Length | 5 | The total length of 7 repeater addresses | 21+ |
| Repeater Rec Count | 3 | The number of repeater dictionary records in the file | 21+ |
| Settings Rec Length | 5 | The total length of the settings record | 10+ |
| Network Rec Length | 5 | The total length of the network record | 13+ |
| Radio Rec Length | 5 | The total length of the radio record | 13+ |
| Chip Id | 9 | The hex chip id for the ESP32 | 13+ |
## Room Record
There will be one room record for each room shade. All data in a room record is fixed length and each record must match the length defined in the header record.
| Name | Length | Comments | HDR Version |
| ------ | ------ | ------ | --------- |
| Room Id | 3 | The identifier assigned to the room 1-16 | 19+ |
| Name | 20 | The name assigned to the room | 19+ |
| Sort Order | 3 | The order in which to display in the interface | 19+ |
## Shade Record
There will be one shade record for each configured shade. All data in a shade record is fixed length and each record must match the length defined in the header record.
@ -122,6 +159,18 @@ Group records follow the shade records in the file. There is one group record p
| Repeats | 3 | The number of repeats to send when sending a command | 12+ |
| Sort Order | 3 | The order in which to display in the interface | 13+ |
## Repeater Record
The repeaters are stored in the file in sets of 7. Currently only one repeater record (7 repeaters) are available for setup.
| Name | Len | Comments | HDR Version |
| ------ | ------ | ------- | ------ |
| Repeater Address 1 | 10 | The id of the shade member | 21+ |
| Repeater Address 2 | 10 | The id of the shade member | 21+ |
| Repeater Address 3 | 10 | The id of the shade member | 21+ |
| Repeater Address 4 | 10 | The id of the shade member | 21+ |
| Repeater Address 5 | 10 | The id of the shade member | 21+ |
| Repeater Address 6 | 10 | The id of the shade member | 21+ |
| Repeater Address 7 | 10 | The id of the shade member | 21+ |
## General Setting Record
The general settings record contains stored public information from the System tab. Prior to header version 10 this record was not included in the file. Unlike the shade and group records this record contains variable length string data encapsulated in quotes. The total length of the record must match the defined length on the header record.