Commit Graph

17 Commits

Author SHA1 Message Date
Marcus Better 1a462c986c
[tuyamcu_v2] Fix suppressed dimmer updates from MQTT (#20950)
The driver tried to avoid loops when state updates from the MCU (eg
from physical button press) could be reflected back by Tasmota and
trigger another MCU command, followed by a state update. It did this
by tracking the source of the command in the last_source and
last_command_source variables, suppressing the command if either of
those was SRC_SWITCH.

However this logic is faulty: Since there are two last_source
variables to check, a command might reset one of them, but the other
would still suppress the update. As it turns out, MQTT commands would
only set last_source but not last_command_source. As a result, any
dimmer changes via MQTT would be dropped by the driver and not applied
to the MCU.

Switch functionality (on/off) was still working because those do not
rely on last_command_source, only last_source.

This change removes the loop detection logic altogether for dimmer
updates. This should be safe, because the driver already has the
latest dimmer value in its shadow state, and will not try to re-apply
a current value, thus breaking the loop.

This patch has been tested with several CE-WF500D dimmers which had
this problem.
2024-03-14 17:42:52 +01:00
Marcus Better 47ae5bc9c8
[tuyamcu_v2] Send updates unconditionally (#20868)
Remove the logic that inhibits the sending of updates to the MCU until
the DP's state has been observed at least once in a status report from
the MCU. This logic was intended to ensure that a DP is not updated
with its current value, which reportedly crashes some very broken
devices.

However, other devices like the Feit DIM/WIFI dimmers do not reliably
report DPs that haven't been changed. So the required status report
would never arrive, resulting in the inability to control these
devices remotely, at least until their state had been changed by a
manual button press, something that is not always practical as it
requires physical device access and needs to be done after every
restart.

Removing this logic allows Tasmota to control the device state.
2024-03-04 13:23:12 +01:00
Marcus Better bb790efefd
[Tuya v2] Remove unused variable (#20869) 2024-03-04 13:22:35 +01:00
Marcus Better ee6863ffd9
Heartbeat every 15s as documented (#20867) 2024-03-04 13:21:41 +01:00
Theo Arends d5a4f8441b Fix Berry claiming UART0 if needed (#20324) 2023-12-28 17:25:01 +01:00
Theo Arends 21c7edcb50 Add display of active drivers using command ``status 4`` 2023-12-27 22:03:56 +01:00
Marcus Better 04a8414217
Fix Tuya v2 module compilation (#20272) 2023-12-20 10:00:52 +01:00
Theo Arends f65ae0694b Fix XSS phase 1 2023-12-18 12:31:14 +01:00
Barbudor 335e18e8cb
Allow webbutton up to 32 (#19580)
* Allow webbutton up to 32

* use named const
2023-09-29 09:56:52 +02:00
Theo Arends e927e3307e Add DevicesPresent limit check
- Increase supported relays and buttons to 32
2023-02-25 16:44:04 +01:00
Theo Arends e1b11a6fe7 Fix Tuya Exception 3 (#17941) 2023-02-15 16:33:29 +01:00
Theo Arends 31f5b79bf8 Fix adding virtual switches 2023-02-15 11:06:53 +01:00
Theo Arends e0584b2157 Refactor switches and buttons
- Fix Tuya switches
2023-02-12 16:09:28 +01:00
Theo Arends e891830545 Prep ESP32 energy 2023-01-24 16:54:03 +01:00
Theo Arends 20a50ffc2e Revert Tuya rewrite
- Update changelogs
2022-12-31 16:08:59 +01:00
Theo Arends b2239b4dce Disable TUYA_MORE_DEBUG 2022-11-13 15:15:10 +01:00
Theo Arends 13c27194ec TuyaMcu rewrite by btsimonh (#17051) 2022-11-13 12:55:18 +01:00