diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_gpio.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_gpio.ino index 7e514622a..191c0c8f6 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_gpio.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_gpio.ino @@ -249,7 +249,7 @@ extern "C" { #ifdef USE_COUNTER int32_t argc = be_top(vm); // Get the number of arguments if (argc >= 1 && be_isint(vm, 1)) { - int32_t counter = be_toint(vm, 1); + int32_t counter = be_toint(vm, 1) + 1; // counter are 0 based in Berry, 1 based in Tasmota // is `index` refering to a counter? if (CounterPinConfigured(counter)) { @@ -270,7 +270,7 @@ extern "C" { #ifdef USE_COUNTER int32_t argc = be_top(vm); // Get the number of arguments if (argc >= 2 && be_isint(vm, 1) && be_isint(vm, 2)) { - int32_t counter = be_toint(vm, 1); + int32_t counter = be_toint(vm, 1) + 1; // counter are 0 based in Berry, 1 based in Tasmota int32_t value = be_toint(vm, 2); // is `index` refering to a counter?