mirror of https://github.com/arendst/Tasmota.git
Updated openHAB (markdown)
parent
9a65f4843c
commit
9910a099a3
20
openHAB.md
20
openHAB.md
|
@ -20,7 +20,7 @@ By following the guide below you'll be able to observe, control and manage your
|
|||
|
||||
* (optional) Standalone [MQTT client](http://www.hivemq.com/blog/seven-best-mqtt-client-tools) (e.g. [mqtt-spy](https://kamilfb.github.io/mqtt-spy)) to observe and identify messages on the MQTT broker
|
||||
|
||||
Before continuing, please make sure you assigned **unique MQTT "Topics"** in the Sonoff-Tasmota configuration interface of each Sonoff module. The default MQTT topic is "sonoff", in the examples below we will use names like "sonoff-A00F9D".
|
||||
Before continuing, please make sure you assigned **unique MQTT "Topics"** in the Sonoff-Tasmota configuration interface of each Sonoff module. The default MQTT topic is "sonoff", in the examples below we will use names like "sonoff-A00EEA".
|
||||
|
||||
![Example Sonoff-Tasmota MQTT settings](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/8/8fe9008fb24b0b70e6eddf7cf0f0c70c8ac21b92.png "Example Sonoff-Tasmota MQTT settings")
|
||||
|
||||
|
@ -34,7 +34,7 @@ Additional or further interesting topics are easily identified by reading up on
|
|||
|
||||
### Mandatory Topics / Items
|
||||
|
||||
This it the minimal set of items for the basic functionality of different Sonoff modules. You'll need to replace the given example dive name (e.g. "sonoff-A00F9D") by the one chosen for your module.
|
||||
This it the minimal set of items for the basic functionality of different Sonoff modules. You'll need to replace the given example dive name (e.g. "sonoff-A00EEA") by the one chosen for your module.
|
||||
<br /> (*Note: Lines have been wrapped for better presentation*)
|
||||
|
||||
**sonoff.items:**
|
||||
|
@ -42,8 +42,8 @@ This it the minimal set of items for the basic functionality of different Sonoff
|
|||
* Sonoff Basic / Sonoff S20 Smart Socket (Read the current power state, switch power on and off)
|
||||
```java
|
||||
Switch LivingRoom_Light "Living Room Light" <light> (LR,gLight)
|
||||
{ mqtt=">[broker:cmnd/sonoff-A00F9D/POWER:command:*:default],
|
||||
<[broker:stat/sonoff-A00F9D/POWER:state:default]" }
|
||||
{ mqtt=">[broker:cmnd/sonoff-A00EEA/POWER:command:*:default],
|
||||
<[broker:stat/sonoff-A00EEA/POWER:state:default]" }
|
||||
```
|
||||
* Sonoff Pow (Read and switch power, read current wattage)
|
||||
```java
|
||||
|
@ -64,22 +64,22 @@ It is furthermore recommended, to add the following status items for every Sonof
|
|||
* A switch being 'ON' as long as the device is reachable 💬
|
||||
```java
|
||||
Switch LivingRoom_Light_Reachable "Living Room Light: reachable" (gReachable)
|
||||
{ mqtt="<[broker:tele/sonoff-A00F9D/LWT:state:MAP(reachable.map)]" }
|
||||
{ mqtt="<[broker:tele/sonoff-A00EEA/LWT:state:MAP(reachable.map)]" }
|
||||
```
|
||||
|
||||
* Wifi Signal Strength in Percent
|
||||
```java
|
||||
Number LivingRoom_Light_RSSI "Living Room Light: RSSI [%d %%]" (gRSSI)
|
||||
{ mqtt="<[broker:tele/sonoff-A00F9D/STATE:state:JSONPATH($.Wifi.RSSI)]" }
|
||||
{ mqtt="<[broker:tele/sonoff-A00EEA/STATE:state:JSONPATH($.Wifi.RSSI)]" }
|
||||
```
|
||||
|
||||
* Optional! A collection of return messages by the Sonoff module
|
||||
<br>Recommendation: Define specific items for what you really need on a regular basis, use standalone MQTT client for troubleshooting
|
||||
```java
|
||||
String LivingRoom_Light_Verbose "Living Room Light: MQTT return message [%s]"
|
||||
{ mqtt="<[broker:tele/sonoff-A00F9D/INFO1:state:default],
|
||||
<[broker:stat/sonoff-A00F9D/STATUS2:state:default],
|
||||
<[broker:stat/sonoff-A00F9D/RESULT:state:default]" }
|
||||
{ mqtt="<[broker:tele/sonoff-A00EEA/INFO1:state:default],
|
||||
<[broker:stat/sonoff-A00EEA/STATUS2:state:default],
|
||||
<[broker:stat/sonoff-A00EEA/RESULT:state:default]" }
|
||||
```
|
||||
|
||||
💬 The "LWT" topic (["Last Will and Testament"](http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament)) will receive regular "Online" messages by the module and an "Offline" message a short time after the module is disconnected, generated by the MQTT broker. These messages are transformed to a valid `ON`/`OFF` state by the [MAP](http://docs.openhab.org/addons/transformations/map/readme.html) transformation. Of course you can implement `Unreachable` instead of `Reachable` if you prefer. The following transformation file is needed:
|
||||
|
@ -119,7 +119,7 @@ Switch item=Sonoff_Action mappings=[restart="Restart", queryFW="Query FW", upgra
|
|||
```java
|
||||
// Work with a list of selected Sonoff modules
|
||||
val sonoff_device_ids = newArrayList(
|
||||
"sonoff-A00F9D",
|
||||
"sonoff-A00EEA",
|
||||
//... add all your modules here!
|
||||
"sonoff-E8A6E4"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue