Component 255

Michael Ingraham 2019-09-18 02:45:11 -04:00
parent 726004dfb6
commit 37b744344e
1 changed files with 7 additions and 2 deletions

@ -25,16 +25,21 @@ Time to create your template.
1. Change the template name (also defines the name for `Module 0`).
2. Select a module to [**BASE** your template on](Templates#base). If you're not sure, `Module 18` is the best choice. In this example the device is based on Blitzwolf SHP (45) module.
3. Configure the components assigned to the [**GPIOs**](Templates#gpio) to match your device. If you do not know what pins your device uses, employ the [new device configuration procedure](Configuration-Procedure-for-New-Devices) to determine the correct pin assignments.
4. Any GPIO that have no component connected should be set to `None (0)`.
> Component `User (255)` is used for GPIO that are to be configurable. In fact, with a Template, every GPIO is easily configurable. So, why ever use `255`? When a Template is declared and activated, it becomes known to the device as `Module 0`. Any GPIO assigned as `255` become GPIO that can be configured through the Module dialog.
>
> Take, for example, a `Sonoff TH`. The design of the device exposes a jack that allows a user to plug in a sensor. The jack on the Sonoff TH is connected to GPIO4. Assigning GPIO4 as `255` allows a Template to be generic for this class of devices. Yet, when a user decides to connect a sensor using the jack, GPIO4 can be configured easily through the Module dialog to be set to the type of sensor connected to the device.
![GPIO configuration](https://i.postimg.cc/44r41GDJ/templat-step3.png)
[Explanation of ADC0](#ADC0)
4. Click on **Save**.
5. Click on **Save**.
![](https://i.postimg.cc/nVvtCsy0/templat-step4.png)
5. Select `Module 0` in **Configuration - Configure Module**.
6. Select `Module 0` in **Configuration - Configure Module**.
In the example dropdown menu you see the template name that is defined in step 1 (in this case `RGB Smart Plug`) always followed by `(0)`.