mirror of https://github.com/arendst/Tasmota.git
removed reference tables to keep them in one place only for easier editing
parent
b7d806b3f1
commit
f6790be61b
154
Templates.md
154
Templates.md
|
@ -84,7 +84,7 @@ The device will reboot with a name reflecting your template name and `Module 0`
|
|||
|
||||
![It is finished](https://i.postimg.cc/8kqMRCRQ/templat-step4.png)
|
||||
## Template configuration with commands
|
||||
A user provided template can be stored in Sonoff-Tasmota using the ``Template`` command. It has the following parameters.
|
||||
A user provided template can be stored in Tasmota using the [`Template`](commands#template) command. It has the following parameters.
|
||||
|
||||
|Parameter| Description |
|
||||
|---------|----------|
|
||||
|
@ -104,7 +104,7 @@ A user provided template can be stored in Sonoff-Tasmota using the ``Template``
|
|||
After setting a template in command line it is necessary to issue `Module 0` command if the device doesn't reboot on its own.
|
||||
|
||||
# Explanation of template properties
|
||||
Let's look again at our example template
|
||||
Let's look again at our example template:
|
||||
|
||||
```
|
||||
{"NAME":"UserModule1","GPIO":[17,148,29,149,7,255,255,255,138,255,139,255,255],"FLAG":0,"BASE":18}
|
||||
|
@ -134,77 +134,10 @@ The GPIO functionality numbers are the same as shown by command ``GPIOs``. In ad
|
|||
***example***
|
||||
>In our example the GPIO 00 data element is `17` which corresponds to the `Button1` component, according to the following table. If you change that template element to `9` it would then be assigned as a `Switch1` component instead.
|
||||
|
||||
### [Components](Components)
|
||||
|#|Function|#|Function|#|Function|#|Function|
|
||||
|:---:|:---|:---:|:---|:---:|:---|:---:|:---|
|
||||
|0|None|255|User define|
|
||||
|17|Button1|18|Button2|19|Button3|20|Button4|
|
||||
|90|Button1n|91|Button2n|92|Button3n|93|Button4n|
|
||||
|9|Switch1|10|Switch2|11|Switch3|12|Switch4|
|
||||
|13|Switch5|14|Switch6|15|Switch7|16|Switch8|
|
||||
|82|Switch1n|83|Switch2n|84|Switch3n|85|Switch4n|
|
||||
|86|Switch5n|87|Switch6n|88|Switch7n|89|Switch8n|
|
||||
|21|Relay1|22|Relay2|23|Relay3|24|Relay4|
|
||||
|25|Relay5|26|Relay6|27|Relay7|28|Relay8|
|
||||
|29|Relay1i|30|Relay2i|31|Relay3i|32|Relay4i|
|
||||
|33|Relay5i|34|Relay6i|35|Relay7i|36|Relay8i|
|
||||
|52|Led1|53|Led2|54|Led3|55|Led4|
|
||||
|56|Led1i|57|Led2i|58|Led3i|59|Led4i|
|
||||
|157|LedLink|158|LedLinki|
|
||||
|37|PWM1|38|PWM2|39|PWM3|40|PWM4|
|
||||
|41|PWM5|46|PWM1i|47|PWM2i|48|PWM3i|
|
||||
|49|PWM4i|50|PWM5i|
|
||||
|42|Counter1|43|Counter2|44|Counter3|45|Counter4|
|
||||
|94|Counter1n|95|Counter2n|96|Counter3n|97|Counter4n|
|
||||
|150|Rotary1a|151|Rotary1b|152|Rotary2a|153|Rotary2b|
|
||||
### Components
|
||||
See [Components](Components) for a complete list
|
||||
|
||||
|#|Function|#|Function|#|Function|
|
||||
|:---:|:---|:---:|:---|:---:|:---|
|
||||
|1|DHT11|2|AM2301|3|SI7021|4|DS18x20|
|
||||
|5|I2C SCL|6|I2C SDA|
|
||||
|7|WS2812|
|
||||
|8|IRsend|51|IRrecv|
|
||||
|60|MHZ Tx|61|MHZ Rx|
|
||||
|64|SAir Tx|65|SAir Rx|
|
||||
|62|PZEM0XX Tx|63|PZEM004 Rx|
|
||||
|98|PZEM016 Rx|99|PZEM017 Rx|
|
||||
|69|PMS5003|
|
||||
|71|SerBr Tx|72|SerBr Rx|
|
||||
|73|SR04 Tri|74|SR04 Ech|
|
||||
|101|SDS0X1 Tx|70|SDS0X1 Rx|
|
||||
|102|HX711 SCK|103|HX711 DAT|
|
||||
|104|TX20|
|
||||
|105|RFSend|106|RFrecv|
|
||||
|107|Tuya Tx|108|Tuya Rx|
|
||||
|109|MGC3130 Xfr|110|MGC3130 Rst|
|
||||
|111|SSPI MISO|112|SSPI MOSI|113|SSPI SCLK|
|
||||
|114|SSPI CS|115|SSPI DC|116|RF Sensor|
|
||||
|117|AZ Rx|118|AZ Tx|
|
||||
|119|MX31855 CS|120|MX31855 CLK|121|MX31855 DO|
|
||||
|130|HLWBL SEL|131|HLWBL SELi|132|HLWBL CF1|
|
||||
|133|HLW8012 CF|134|BL0937 CF|
|
||||
|135|MCP39F5 Tx|136|MCP39F5 Rx|137|MCP39F5 Rst|
|
||||
|138|PN532 Tx|139|PN532 Rx|
|
||||
|140|SM16716 CLK|141|SM16716 DAT|142|SM16716 PWR|
|
||||
|143|MY92x1 DI|144|MY92x1 DCKI|
|
||||
|145|CSE7766 Tx|146|CSE7766 Rx|
|
||||
|147|ALux IrRcv|159|ALux IrSel|
|
||||
|148|Serial Tx|149|Serial Rx|
|
||||
|154|HRE CLOCK|155|HRE DATA|
|
||||
|156|ADE7953_IRQ|
|
||||
|160|Buzzer|161|Buzzeri|
|
||||
|162|OLED Reset|
|
||||
|163|SolaxX1 Tx|164|SolaxX1 Rx|
|
||||
|165|Zigbee Tx|166|Zigbee Rx|
|
||||
|167|RDM6300 Rx|
|
||||
|168|iBeacon Tx|169|iBeacon Rx|
|
||||
|170|A4988 DIR|171|A4988 STP|172|A4988 ENA|
|
||||
|173|A4988 MS1|174|A4988 MS2|175|A4988 MS3|
|
||||
|176|DDS238-2 Tx|177|DDS238-2 Rx|
|
||||
|178|DDSU666 Tx|179|DDSU666 Rx|
|
||||
|180|SM2135 CLK|181|SM2135 DAT|
|
||||
|
||||
[Google Sheet](https://docs.google.com/spreadsheets/d/10aYCaR3P09omn_vryFGyyq7dS-XK54K2fGAcb4gruik/edit?usp=sharing) with the components sorted by number or alphabetically.
|
||||
[Google Sheet](https://docs.google.com/spreadsheets/d/10aYCaR3P09omn_vryFGyyq7dS-XK54K2fGAcb4gruik) with the components by number or alphabetically.
|
||||
|
||||
## FLAG
|
||||
The FLAG value is an 8-bit mask where each bit controls a feature. Add FLAG values to set multiple bits.
|
||||
|
@ -222,84 +155,11 @@ FLAG | Mask | Feature description
|
|||
128 | 1xxxxxxx | Not used
|
||||
|
||||
## BASE
|
||||
BASE is the starting module setup for the custom template. Some modules, not all, include special programming. If your device is similar to an existing built-in module it is best to use that as a starting point. When you're not sure which BASE module is suitable for your device use the `Generic (18)` module.
|
||||
BASE is the starting module setup for the custom template. Some modules include special programming. If your device is similar to an existing built-in module it is best to use that as a starting point. When you're not sure which BASE module is suitable for your device use the `Generic (18)` module. A list of hard-coded devices can be found in [Modules](Modules).
|
||||
|
||||
***example***
|
||||
>In the [RGB Smart Plug](https://blakadder.github.io/templates/rgbpow.html)
|
||||
template we used the `BlitzWolf SHP (45)` module as BASE since the power monitoring circuitry is identical but GPIO00 and GPIO02 were changed and an unused GPIO04 was added to enable the RGB LED function. Using that specific module we took advantage of that module's calibrated power monitoring special programming which the `Generic (18)` module does not use.
|
||||
|
||||
The following table lists hard-coded device specific functionality.
|
||||
|
||||
BASE | Module | Description
|
||||
--- | --- | ---
|
||||
<a id="SonoffBasic"> </a> 1 | Sonoff Basic |
|
||||
<a id="SonoffRF"> </a> 2 | Sonoff RF |
|
||||
<a id="SonoffSV"> </a> 3 | Sonoff SV |
|
||||
<a id="SonoffTh"> </a> 4 | Sonoff TH |
|
||||
<a id="SonoffDual"> </a> 5 | Sonoff Dual | Process relay and button via hardware serial interface using GPIO01 and GPIO03. Change the baud rate to 19200 bps. Process buttons as single press only
|
||||
<a id="SonoffPow"> </a> 6 | Sonoff POW |
|
||||
<a id="Sonoff4Ch"> </a> 7 | Sonoff 4Ch |
|
||||
<a id="SonoffS2X"> </a> 8 | Sonoff S2X |
|
||||
<a id="Slampher"> </a> 9 | Slampher |
|
||||
<a id="SonoffTouch"> </a> 10 | Sonoff Touch | Invert `LedState 1` functionality
|
||||
<a id="SonoffLED"> </a> 11 | Sonoff LED | Set light type to 2 PWM channels disregarding SetOption15. Fix device specific LED instabilities by disabling GPIO04, GPIO5 and GPIO14
|
||||
<a id="1Channel"> </a> 12 | 1 Channel |
|
||||
<a id="4Channel"> </a> 13 | 4 Channel | [See Sonoff Dual](#SonoffDual)
|
||||
<a id="MotorC/AC"> </a> 14 | Motor C/AC | Force all relays ON at power up and disable command `PowerOnState`
|
||||
<a id="ElectroDragon"> </a> 15 | ElectroDragon |
|
||||
<a id="EXSRelays"> </a> 16 | EXS Relay(s) | Enable pulse latching using even/odd numbered relay pairs
|
||||
<a id="WION"> </a> 17 | WION |
|
||||
<a id="Generic"> </a> 18 | Generic | Show Wemos specific pin information in GUI
|
||||
<a id="SonoffDev"> </a> 19 | Sonoff Dev |
|
||||
<a id="H801"> </a> 20 | H801 | Change hardware UART Tx from GPIO01 to GPIO02
|
||||
<a id="SonoffSC"> </a> 21 | Sonoff SC | Enable and process data via hardware serial interface using GPIO01 and GPIO03. Change the baud rate to 19200 bps
|
||||
<a id="SonoffBN-SZ"> </a> 22 | Sonoff BN-SZ | Set light type to 1 PWM channel disregarding `SetOption15`
|
||||
<a id="Sonoff4ChPro"> </a> 23 | Sonoff 4Ch Pro | Button handling disregarding `SetOption13` only allowing single press to enable RF learning while holding the button
|
||||
<a id="HuafanSS"> </a> 24 | Huafan SS |
|
||||
<a id="SonoffBridge"> </a> 25 | Sonoff Bridge | Enable and Process data via hardware serial interface using GPIO01 and GPIO03. Change the baud rate to 19200 bps. Process 16 buttons in web GUI. Enable EFM8BB1 firmware upload
|
||||
<a id="SonoffB1"> </a> 26 | Sonoff B1 | Set light type to RGBWC using MY92x1
|
||||
<a id="Ailight"> </a> 27 | Ailight | Set light type to RGBW using MY92x1
|
||||
<a id="SonoffT11Ch"> </a> 28 | Sonoff T1 1Ch | [See Sonoff Touch](#SonoffTouch)
|
||||
<a id="SonoffT12Ch"> </a> 29 | Sonoff T1 2Ch | [See Sonoff Touch](#SonoffTouch)
|
||||
<a id="SonoffT13Ch"> </a> 30 | Sonoff T1 3Ch | [See Sonoff Touch](#SonoffTouch)
|
||||
<a id="SuplaEspablo"> </a> 31 | Supla Espablo |
|
||||
<a id="WittyCloud"> </a> 32 | Witty Cloud |
|
||||
<a id="YunshanRelay"> </a> 33 | Yunshan Relay |
|
||||
<a id="MagicHome"> </a> 34 | MagicHome |
|
||||
<a id="LuaniHVIO"> </a> 35 | Luani HVIO |
|
||||
<a id="KMC70011"> </a> 36 | KMC 70011 |
|
||||
<a id="AriluxLC01"> </a> 37 | Arilux LC01 |
|
||||
<a id="AriluxLC11"> </a> 38 | Arilux LC11 |
|
||||
<a id="SonoffDualR2"> </a> 39 | Sonoff Dual R2 | Process buttons as single press only
|
||||
<a id="AriluxLC06"> </a> 40 | Arilux LC06 |
|
||||
<a id="SonoffS31"> </a> 41 | Sonoff S31 | Selects component types for the CSE7766 (serial connected energy monitoring chip) with Rx and Tx hardware serial (even parity) on GPIO01 and GPIO03 respectively. Sets serial interface to 4800 baud and disables serial logging
|
||||
<a id="ZenggeWF017"> </a> 42 | Zengge WF017 |
|
||||
<a id="SonoffPowR2"> </a> 43 | Sonoff Pow R2 |
|
||||
<a id="SonoffIFan02"> </a> 44 | Sonoff IFan02 | Enable command [`FanSpeed`](Commands#fanspeed). Disable `Interlock` and `PulseTime`. Tune status information, MQTT data and GUI. Sync with microcontroller. Process Domoticz Fan state
|
||||
<a id="BlitzwolfSHP"> </a> 45 | Blitzwolf SHP | Module specific power monitoring calibration
|
||||
<a id="Shelly1"> </a> 46 | Shelly 1 |
|
||||
<a id="Shelly2"> </a> 47 | Shelly 2 |
|
||||
<a id="XiaomiPhilips"> </a> 48 | Xiaomi Philips | Process color temperature using PWM2 and intensity using PWM1
|
||||
<a id="NeoCoolcam"> </a> 49 | Neo Coolcam |
|
||||
<a id="ESPSwitCh"> </a> 50 | ESP SwitCh |
|
||||
<a id="ObiSocket"> </a> 51 | Obi Socket |
|
||||
<a id="Teckin"> </a> 52 | Teckin |
|
||||
<a id="APLICWDP303075"> </a> 53 | APLIC WDP303075 |
|
||||
<a id="TuyaDimmer"> </a> 54 | Tuya Dimmer | Enable and process data via software or hardware serial interface using component 107 and 108. Change the baud rate to 9600 bps. Process all buttons
|
||||
<a id="GosundSP1v23"> </a> 55 | Gosund SP1 v23 |
|
||||
<a id="ArmtronixDimmers"> </a> 56 | Armtronix Dimmers | Enable and process data via software or hardware serial interface using component 148 and 149. Change baudrate to 115200 bps.
|
||||
<a id="SK03OutdoorTuya"> </a> 57 | SK03 Outdoor (Tuya) |
|
||||
<a id="PS-16-DZ"> </a> 58 | PS-16-DZ | Enable and process data via software or hardware serial interface using component 148 and 149. Change the baud rate to 19200 bps.
|
||||
<a id="TeckinUS"> </a> 59 | Teckin US |
|
||||
<a id="ManzokuStripEU_4"> </a> 60 | Manzoku Strip (EU 4) |
|
||||
<a id="ObiSocket2"> </a> 61 | Obi Socket 2 |
|
||||
<a id="YTFLRBridge"> </a> 62 | YTF LR Bridge | Disable serial interface to stop loopback
|
||||
<a id="DigooDG-SP202"> </a> 63 | Digoo DG-SP202 |
|
||||
<a id="KA10"> </a> 64 | KA10 |
|
||||
<a id="LumineaZX2820"> </a> 65 | Luminea ZX2820 |
|
||||
<a id="MiDeskLamp"> </a> 66 | Mi Desk Lamp | Process rotary and `Button1` data specific to this device
|
||||
<a id="SP10"> </a> 67 | SP10 |
|
||||
<a id="WAGACHCZ02MB"> </a> 68 | WAGA CHCZ02MB |
|
||||
<a id="SYF05"> </a> 69 | SYF05 |
|
||||
<a id="SonoffL1"> </a> 70 | Sonoff L1 |
|
||||
<a id="SonoffIFan03"> </a> 71 | Sonoff iFan03 |
|
||||
|
||||
|
|
Loading…
Reference in New Issue