Tasmota/tasmota
David Gwynne 17d68750d9
WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626)
* WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver

The main difference is this driver does not try and wire MCU data points
(Dps) into the tasmota power/light/etc controls. Instead each Dp ends up
being relayed directly to MQTT and the rules subsystem. If you want to
change the state of something wired up to the MCU, you send tuyamcu
specific commands to manipulate the Dp.

Each Dp gets a type and id specific topic that is sent to MQTT. eg, Dp
id 1 type bool looks like tele/%topic%/TUYAMCUBOOL1. To change state you
send a TuyaMCUBool1 command (ie, the command index value is used as the
DpId, which is nice and symmetrical) with the new value.

Currently Rules operate on TuyaMCU#TypeDpid things, eg, "rule1 on
TuyaMCU#Bool1 do power %value% endon" toggle the power on the tasmota
device when the state of the thing on the MCU changes too.

The most obviously missing stuff at the moment is:

- better relaying of the wifi/mqtt status to the MCU
- handling wifi reset requests from the MCU
- low power stuff?
- support for sending status updates and device info queries.
- restarting the tuya mcu state machine?
- restarting the rx state machine when no bytes are rxed for a period of
  time
- time sync

* shorten the log prefix to TYB (3 chars).

requested by arendst

* use the local definition for the SET_DP command.

reaching back to the existing tuyamcu code isnt reliable.

pointed out by arendst

* put the todo list in the code so it can be tracked

* check the wifi/mqtt state every second and update the mcu if it changes.

* fix rule processing when Dp state is changed from a cmnd.

rule processing was done as part of publishing the state, but publishing
the state when it was updated by a command only happened if So59 was
set. split rule processing out of publish and call them separately as
needed.

publish is now called from teleperiod, status updates from the MCU,
and from cmnds if so59 is set. rules are called from status updates from
the MCU and from cmnds.

Co-authored-by: David Gwynne <dlg@defeat.lan.animata.net>
2023-01-08 17:35:45 +01:00
..
berry WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
displaydesc Epaper29 v2 (#17627) 2023-01-07 11:31:48 +01:00
energy_modbus_configs Add script support to Energy Modbus 2023-01-03 17:50:39 +01:00
html_compressed Fix broken js introduced in #15515 2022-05-05 10:05:01 +02:00
html_uncompressed Fix broken js introduced in #15515 2022-05-05 10:05:01 +02:00
include WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
language WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
lvgl_berry LVGL/HASPmota add tiny "pixel perfect" fonts for small screens 2022-10-08 14:20:52 +02:00
tasmota_support WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
tasmota_xdrv_driver WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
tasmota_xdsp_display Fix PID-Control parameter destruction 2023-01-06 14:58:19 +01:00
tasmota_xlgt_light Light driver for PCA9632 (#17557) 2023-01-01 14:02:22 +01:00
tasmota_xnrg_energy Add support for filesystem calib.dat 2023-01-04 15:00:43 +01:00
tasmota_xsns_sensor Add ESP32 support for BMPxxx sensors on two I2C busses 2023-01-08 17:19:08 +01:00
tasmota_xx2c_global Refactor uint8_t to uint32_t 2022-11-11 10:44:56 +01:00
zigbee Zigbee improved Aqara plug support and completed cluster 0x0702 2022-11-14 22:46:08 +01:00
my_user_config.h WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
tasmota.ino Removed SetOption177 debugging (#17500) 2023-01-04 15:29:27 +01:00
user_config_override_sample.h Support for second DNS server 2021-07-29 16:57:04 +02:00