tasmota / decode-config

Backup/restore and decode configuration tool for Tasmota
GNU Lesser General Public License v3.0
211 stars 32 forks source link

cmnd format: wrong index for ShutterButton #20

Closed jdpiguet closed 4 years ago

jdpiguet commented 4 years ago

Describe the bug Using the "cmnd" format, the output of the ShutterButton commands is wrong (index starts at 0 instead of 1)

To Reproduce

  1. Configure a Tasmota device as Shutter/Blind
  2. Do a backup of the configuration (decode-config_linux --source x.y.z.t --backup-type dmp --backup-file /tmp/shutter)
  3. Export the Shutter configuration from the file (decode-config_linux --source /tmp/shutter.dmp --output-format cmnd --group Shutter)
  4. Check the " ShutterButton" lines, the index starts at 0 instead of 1

Expected behavior The index starts at 1

Version Information (please complete the following information):

Script: decode-config.py Python: 3.8.2 Platform: Linux-5.4.0-42-generic-x86_64-with-glibc2.4 - x86_64 OS: Linux 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 Time: 2020-08-24 11:04:34

- 'system' information of your Tasmota data (append `-g System` to your decode-config parameter, e. g. `decode-config -f myconfig.dmp -g System`):  

{ "bootcount": 19, "bootcount_reset_time": 1592817296, "cfg_crc": "0x1d70", "cfg_crc32": "0x05b04d4b", "cfg_holder": 4617, "cfg_size": 4096, "cfg_timestamp": 1598254567, "header": { "data": { "crc": "0x3753", "crc32": "0x5b04d4b", "platform": "ESP82xx", "size": 4096, "template": { "crc": "0x1d70", "crc32": "0x5b04d4b", "size": 4096, "version": "0x8030100" }, "version": "0x8030100" }, "env": { "platform": "Linux-5.4.0-42-generic-x86_64-with-glibc2.4", "python": "3.8.2", "script": "decode-config.py v8.4.0 [00067]", "system": "Linux x86_64 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020" }, "timestamp": "2020-08-24 07:36:07" }, "version": "0x8030100" }


**Additional context**
_Add any other context about the problem here._

decode-config_linux --source /tmp/shutter.dmp --output-format cmnd --group Shutter

Shutter:

KeeloqSet 0 0 0 0 ShutterButton0 1 51 26 38 51 0 0 0 1 1 ShutterButton0 2 1 26 13 1 0 0 0 1 1 ShutterButton0 3 0 0 0 0 0 0 0 0 0 ShutterButton0 4 0 0 0 0 0 0 0 0 0 ShutterCalibration1 300,500,700,900,1000 ShutterCalibration2 0,0,0,0,0 ShutterCalibration3 0,0,0,0,0 ShutterCalibration4 0,0,0,0,0 ShutterCloseDuration1 15.0 ShutterCloseDuration2 0.0 ShutterCloseDuration3 0.0 ShutterCloseDuration4 0.0 ShutterEnableEndStopTime1 0 ShutterEnableEndStopTime2 0 ShutterEnableEndStopTime3 0 ShutterEnableEndStopTime4 0 ShutterInvert1 0 ShutterInvert2 0 ShutterInvert3 0 ShutterInvert4 0 ShutterInvertWebButtons1 0 ShutterInvertWebButtons2 0 ShutterInvertWebButtons3 0 ShutterInvertWebButtons4 0 ShutterLock1 0 ShutterLock2 0 ShutterLock3 0 ShutterLock4 0 ShutterMotorDelay1 0.0 ShutterMotorDelay2 0.0 ShutterMotorDelay3 0.0 ShutterMotorDelay4 0.0 ShutterOpenDuration1 15.0 ShutterOpenDuration2 0.0 ShutterOpenDuration3 0.0 ShutterOpenDuration4 0.0 ShutterPosition1 0 ShutterPosition2 0 ShutterPosition3 0 ShutterPosition4 0 ShutterRelay1 1 ShutterRelay2 0 ShutterRelay3 0 ShutterRelay4 0 ShutterSetHalfway1 50 ShutterSetHalfway2 0 ShutterSetHalfway3 0 ShutterSetHalfway4 0

curzon01 commented 4 years ago

try latest developer version

jdpiguet commented 4 years ago

Fixed! Thank you