arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.26k stars 4.82k forks source link

[v12.4] Out-of-sequence Button/Switch not working after Upgrate to v12.4 #17967

Closed smartboart closed 1 year ago

smartboart commented 1 year ago

Hello, after updating all my devices from Percy to Peter, All my configurated Switches didnt work anymore. After downgrade from Peter to Percy it worked again..

arendst commented 1 year ago

I suggest you fill in the mandatory fields requested when you openend this issue.

Currently it's a big guess what switches you have.

smartboart commented 1 year ago

Sorry, i thought this is clear....I have about 20 devices.. Wemo D1 Mini, ESP32 Olimex and NodeMCU. In all devices i have standard external switches configurated as switch and motion sensors also conifgurated as switch. All these gpios which are configurated as switch are not working. All gpios configurated as buttons are still working. Even I²C Sensors and rules are still working... Some switches are standart linked to relais some not linked to a relay / detached ..But this makes no difference.

Jason2866 commented 1 year ago

Please post one exact setup which is not working. Use the template, you have deleted, and provide ALL info asked there. Without providing this data we can't help.

smartboart commented 1 year ago

DO NOT DELETE ANY TEXT from this template! Otherwise the issue will be auto-closed. -->

PROBLEM DESCRIPTION

_A clear and concise description of what the problem is. After the upgrade from Percy to Peter, all devices will not read gpios with connected switch. All action on the hardware switch is not recognized. It makes no difference if the switch is detached fromrelay or linked to a relay like it is in standard configuration. Even if it is a wemo D1 mini, a Node MCU or a ESP32 Olimex POE Modul. All my devices have the same issue after upgrade to Peter. Here is a example of a Wemo Config which is linked to Relay...

After downgrade to Percy everything is fine again.

grafik

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:

11:08:22.370 CMD: rule1
11:08:22.378 MQT: stat/sonoff/RESULT = {"Rule1":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":142,"Free":369,"Rules":"on switch8#state=1 do publish stat/sonoff/RESULT {\"POWER8\":\"ON\"} endon on switch8#state=0 do publish stat/sonoff/RESULT {\"POWER8\":\"OFF\"} endon"}}

11:08:52.282 CMD: rule2
11:08:52.290 MQT: stat/sonoff/RESULT = {"Rule2":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":149,"Free":362,"Rules":"ON button2#state=10 DO power1 2 ENDON ON button2#state=11 DO power2 2 ENDON ON button2#state=3 DO power2 2 ENDON ON button2#state=3 DO power1 2 ENDON"}}

11:09:16.651 CMD: rule3
11:09:16.660 MQT: stat/sonoff/RESULT = {"Rule3":{"State":"OFF","Once":"OFF","StopOnError":"OFF","Length":75,"Free":436,"Rules":"ON button2#state=10 DO power2 2 ENDON ON button2#state=11 DO power1 2 ENDON"}}


### TO REPRODUCE
_Steps to reproduce the behavior:_
use external switch ...always no reaction

### EXPECTED BEHAVIOUR
_A clear and concise description of what you expected to happen._
When i use my external Switch which is connected to gpio 14 D5 conigured as switch 3 it should switch on relay 3 in this example..

### SCREENSHOTS
_If applicable, add screenshots to help explain your problem._

### ADDITIONAL CONTEXT
_Add any other context about the problem here._

**(Please, remember to close the issue when the problem has been addressed)**
arendst commented 1 year ago

Thx for the better description!

Originally the switch (and button) numbering was supposed to be sequential. So starting at 1 and up. Until v12.4 this was apparently not enforced. It is now to cater for virtual switches (and buttons).

I'll need to revisit my code changes leading to this as you seem to have a valid solution up until v12.4

Investigating.

barbudor commented 1 year ago

Supporting scattered values would be a problem when adding port extenders for example that are expecting 8 or more switches to be available continuously like what was recently done on tm1638

The motto on support has always been : start at 1 and increment by 1. This was a loophole

arendst commented 1 year ago

This would indeed be the preffered and supported way of button and switch configuration:

image

In this case GPIO13 can still be unconnected while allowing the switch to control relay2.

barbudor commented 1 year ago

Even is the switch on gpio14 was set to switch 1, it could still be redirected to relay 3 with a rule

sfromis commented 1 year ago

Does this mean that out-of-sequence Switch inputs works differently now? Someone is having trouble with this device, where the template has Switch1 and Switch3. While the user for some reason now has a gpio config with Switch2 and Switch3, both setups would be hit by issues here. https://templates.blakadder.com/milfra_MFA06.html

arendst commented 1 year ago

What's the use for Switch3 without havong a relay3?

smartboart commented 1 year ago

I also have configurations with switch numbers without corespondent Relais.. for example switch 3 is a motion sensor...for these Things i use rules to set a non configurated Relais for example 10 to get a Real time mqtt Information about the switch state..so in the mqtt Broker i trigger with motion information of Relais 10... For example on switch3#state=1 do publish stat/sonoff/RESULT {\"POWER10\":\"ON\"} endon on switch3#state=0 do publish stat/sonoff/RESULT {\"POWER10\":\"OFF\"} endon"}}

Or do we get now switch state change in Realtime to mqtt with switchmode XYZ

arendst commented 1 year ago

I suggest you try latest dev release and report back if it solves your issues.

If so, I'll release v12.4.1 ....

smartboart commented 1 year ago

Hello ..latest dev fixed it...i have tried with the example one from here in this issue.. Thanks...

arendst commented 1 year ago

OK. I'll add the change to v12.4.0 and keep it v12.4.0

helmar74 commented 1 year ago

Hi just a question from my side. I updated ~60 Devices to 2.4.0 which was released on 16.02.2023. Should I recompile and update again?

sfromis commented 1 year ago

Are you affected by this issue? If yes, better update..... If using precompiled builds, better first make sure that the files have been pushed to the servers.

Jason2866 commented 1 year ago

Hi just a question from my side. I updated ~60 Devices to 2.4.0 which was released on 16.02.2023. Should I recompile and update again?

If you have the switch and Relais counting done as recommended (starting from one and continous) there is no need for.

Jason2866 commented 1 year ago

Closing since OP gave feedback it is fixed