Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettSheleski authored Feb 27, 2018
1 parent 948b599 commit 7add925
Showing 1 changed file with 19 additions and 60 deletions.
79 changes: 19 additions & 60 deletions smartapps/BrettSheleski/tasmota.src/readme.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,35 @@
# Tasmota SmartApp
SmartThings SmartApp for controlling devices running the Sonoff-Tasmota firmware (see https://github.com/arendst/Sonoff-Tasmota)
SmartThings SmartApp for use with the SmartThings [Tasmota Device Handler](https://github.com/BrettSheleski/SmartThingsPublic/tree/master/devicetypes/BrettSheleski/tasmota.src)

## Supported Modules
I do not physically have all the modules that the Sonoff-Tasmota firmware supports. I was able to implement use for some modules listed below.
1. Sonoff Basic
2. Sonoff 4CH / Sonoff 4CH Pro
3. Sonoff RF Bridge
The Device Handler is used for updating devices running the [Sonoff-Tasmota](https://github.com/arendst/Sonoff-Tasmota) firmware.

(Please contribute to help create support for all modules supported by the Sonoff-Tasmota firmware)
See Tasmota Device Handler (https://github.com/BrettSheleski/SmartThingsPublic/tree/master/devicetypes/BrettSheleski/tasmota.src) for more details.

## Installation
This SmartApp works by creating several child devices that the user would interact with.

### Install Necessary Device Handler(s) (Required)
#### Install the Tasmota Device Handler (Required)
This device handler is necessary for all module types. This device handler will make an HTTP call to the Tasmota device to determine the module type. Depending on the module type defined, it will create child devices.
1. Log in to the SmartThings IDE (https://graph.api.smartthings.com/)
2. Go to `My Device Handlers`
3. Click `Create New Device Handler`
4. In the `From Code` tab paste in the code from https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/BrettSheleski/tasmota.src/tasmota.groovy
5. Click `Create`
6. Click `Publish` --> `For Me`

### Tasmota-Power Device Handler
For Sonoff-Basic, Sonoff-4CH, and Sonoff Dual devices this is required
1. Log in to the SmartThings IDE (https://graph.api.smartthings.com/)
2. Go to `My Device Handlers`
3. Click `Create New Device Handler`
4. In the `From Code` tab paste in the code from https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/BrettSheleski/tasmota.src/tasmota-power.groovy
5. Click `Create`
6. Click `Publish` --> `For Me`

### Tasmota-RF-Bridge-Button Device Handler
For Sonoff-Basic, Sonoff-4CH, and Sonoff Dual devices this is required
1. Log in to the SmartThings IDE (https://graph.api.smartthings.com/)
2. Go to `My Device Handlers`
3. Click `Create New Device Handler`
4. In the `From Code` tab paste in the code from https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/BrettSheleski/tasmota.src/tasmota-rf-bridge-button.groovy
5. Click `Create`
6. Click `Publish` --> `For Me`

## Install SmartApp (Required)
This is the brains of everything.
### Adding SmartApp to SmartThings
1. Log in to the SmartThings IDE (https://graph.api.smartthings.com/)
2. Go to `My SmartApps`
3. Click `New SmartApp`
4. In the `From Code` tab paste in the code from https://github.com/BrettSheleski/SmartThingsPublic/blob/master/smartapps/BrettSheleski/tasmota.src/tasmota.groovy
5. Click `Create`
6. Click `Publish` --> `For Me`

## Usage
Install the SmartApp, Tasmota Device Handler, and any othe necessary Device Handlers (see above).

Then in the SmartThings mobile App go to
1. Automation Tab (bottom tab)
2. SmartApps (top tab)
3. Add a SmartApp (bottom of list)
4. My Apps (bottom of list)
5. Tasmota
6. Set the IP Address
7. (optional) set the Username and Password
### Installing SmartApp
Open the SmartThings app:
1. Select `Automation` tab (on bottom)
2. Select `SmartApps` tab (on top)
3. Scroll to the bottom and select `Add a SmartApp`
4. Scroll to the bottom and select `My Apps`
5. Find the `Tasmota` SmartApp
6. In the Devices input, select all devices using the `Tasmota` device handler.

Once done you may notice that there is at least 1 new device:
* Tasmota-Master device.
This is a device that may spawn other devices that the user would use. It is not intended to be used directly by the user, but is what is used by its child devices to send commands and deal with the responses.
* Tasmota-Power device(s).
These device(s) get spawned by Sonoff-Basic, Sonoff 4CH and Sonoff Dual devices. These are the actual Switch/Momentary devices the user would normally interact with.
### SmartApp Usage
The SmartApp exposes an HTTP endpoint which can be used to update the Tasmota devices.

## Contribute
As I don't have all the module types supported by the Sonoff-Tasmota firmware I currently do not have implementation for all module types. Please create any other child device(s) for the module.
TODO: Finish documenting this when finished.

See https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/BrettSheleski/tasmota.src/tasmota-base.groovy for a skeleton of a device handler to start with.
## Example Usages
### Node-Red
A Node-Red flow can be created which will subscribe to the appropriate MQTT topic(s) for the device(s) and call make an HTTP request to the SmartThings SmartApp endpoint.

## Future
I also plan for the 'Master' device to also check the GPIO configuration and spawn additional child devices depending.
TODO: Document here.

0 comments on commit 7add925

Please sign in to comment.