Tasmota/tools
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
..
fw_HM10_cc2541 Move some firmware files around 2020-11-27 15:56:30 +01:00
fw_RfSensor_attiny85 Move some firmware files around 2020-11-27 15:56:30 +01:00
fw_ShellyDimmer_stm32 Shelly dimmer firmware stm32 v51.6 2021-05-02 16:54:06 +02:00
fw_SonoffRfBridge_efm8bb1 Remove mismerged files 2020-11-27 15:43:20 +01:00
fw_SonoffZigbeeBridgePro_cc2652 fix OTA URL 2022-08-10 17:58:58 +02:00
fw_SonoffZigbeeBridgePro_router_only_cc2652 Zigbee fix checksum in ZBBridge Pro router firmware 2022-11-03 14:24:41 +01:00
fw_SonoffZigbeeBridge_ezsp Add Zigbee firmware 6.7.9 for Sonoff ZBBridge 2021-04-30 22:14:00 +02:00
fw_TasmotaClient_arduino Rename firmware folders 2020-11-25 17:15:02 +01:00
fw_TubeZigbee_efr32 Add accept filename extensions to GUI 2022-11-20 15:07:38 +01:00
fw_Zigbee_cc2530 Move some firmware files around 2020-11-27 15:56:30 +01:00
logo reduce icon to 1 bit 2022-01-08 10:17:30 +01:00
lv_gpio WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
mqtt-file Add initial support for Tasmota Mesh 2021-07-02 14:08:06 +02:00
ota_server Move some firmware files around 2020-11-27 15:56:30 +01:00
templates Prep release 2022-02-07 14:53:45 +01:00
unishox remove leftover import re 2022-01-08 10:18:25 +01:00
decode-config.md decode-config moved to https://github.com/tasmota/decode-config 2019-12-02 15:17:45 +01:00
decode-status.py WIP Tuya MCU Bridge driver alternative to the TuyaMCU driver (#17626) 2023-01-08 17:35:45 +01:00
serial-plotter.py Happy New Year 2021-01-01 13:57:04 +01:00