From a7c51acd5338304d7bd19f5126b7a6b2deff574d Mon Sep 17 00:00:00 2001 From: blakadder Date: Mon, 28 Oct 2019 19:12:57 +0100 Subject: [PATCH] Updated TuyaMCU Configurations (markdown) --- TuyaMCU-Configurations.md | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/TuyaMCU-Configurations.md b/TuyaMCU-Configurations.md index a3878e9b..0846c372 100644 --- a/TuyaMCU-Configurations.md +++ b/TuyaMCU-Configurations.md @@ -138,6 +138,54 @@ The stock Tuya App communicates with the PIC Micro inside the motor housing at 9 There may first be a reply of 65 02 00 04 before the motor engages +### Aromatherapy Diffuser +This diffuser uses the same dpId scheme as the [example protocol](tuya-protocols#aromatherapy-machine-oil-diffuser) + +#### Functions +`dpID 1` device power: 0 = off / 1 = on +`dpID 11` led power: 0 = off / 1 = on +`dpID 12` error notification: 0 = ok / 1 = error +`dpID 13` countdown mode options: 0 = off / 1 = 1hr / 2 = 3hr *not needed with Tasmota* +`dpID 14` countdown status: reports value of 0...360 minutes *not needed with Tasmota* +`dpID 103` mist strength: 0 = low / 1 = high +`dpID 108` led color: 14 char value in hex (can define only RGB and send HSV value as max: `RRGGBBffff6464`) +`dpID 110` led mode: 0 = rgb_cycle / 1 = color / 2 = white +`dpID 110` led dimmer **color and white modes only** *it is important to define 'DimmerRange 1,255'* + +#### Configuration + +After applying the template and configuring Wi-Fi and MQTT issue + +```lua +Backlog SetOption66 1; TuyaMCU 21,111; TuyaMCU 11,1; TuyaMCU 12,11; TuyaMCU 13,103; TuyaMCU 14,12; TuyaMCU 15,110; DimmerRange 1,255; SetOption59 1 +``` +```lua +Rule1 on TuyaReceived#data=55AA000700056E040001007E do publish2 stat/GD-30W/EFFECT rgb_cycle endon on TuyaReceived#data=55AA000700056E040001017F do publish2 stat/GD-30W/EFFECT color endon on event#rgb_cycle do tuyasend4 110,0 endon on event#color do tuyasend4 110,1 endon on event#ON do backlog tuyasend4 110,1; tuyasend 11,1 endon on event#off do tuyasend1 11,0 endon on power3#state=1 do tuyasend4 103,1 endon on power3#state=0 do tuyasend4 103,0 endon +Rule1 1 +``` + +*Optional rule used to prevent the device going into countdown mode (f.e. using on device controls) and complete MCU status update on restart* + +```lua +Rule3 on TuyaReceived#data=55AA000700050D040001011E do tuyasend4 13,0 endon on TuyaReceived#data=55AA000700050D040001021F do tuyasend4 13,0 endon on mqtt#connected do serialsend5 55aa0001000000 endon +Rule3 1 +``` +[All commands in .txt](https://gist.github.com/blakadder/2d112b50edd8f75f2d7fb0dddd9310c4) + +#### What you get +- Relay1 turns the diffuser on or off in stored mist strength mode, turns led on or off in stored mode and serves as device power status +- Relay2 turns light on or off and serves as light power status. +- Relay3 mist strength status and control using `Rule1` +- Relay4 is used for error status (ON = error), no control +- Relay5 is used for light mode status (0 = rgb_cycle, 1 = color), no control + +LED mode status is reported to mqtt topic `stat/GD-30W/EFFECT` and command [`Event`](https://github.com/arendst/Tasmota/wiki/Commands#event) is used to control some functions using [`TuyaSend4`](https://github.com/arendst/Tasmota/wiki/Commands#tuyasend4) command. All this is defined in `Rule1` + +Color can be changed using `TuyaSend3 108,RRGGBB64646464` (RR, GG and BB are hex value) only in color mode. + +Dimming works using slider and `Dimmer` command but only when in color mode, in rgb_cycle there are no brightness controls. + +Long press on device's power button initiates Tasmota's Wi-Fi config ### Tasmota 1. `module 54` # TuyaMCU (will reboot) 2. `backlog gpio1 0; gpio3 0; gpio15 107; gpio13 108` # change GPIO assignments. The dongle uses gpio15 for U1TX and gpio13 for U1RX (will reboot)