SO, I have it mostly working. The switches operate and the leak sensor sends alerts. I am still working on getting devices to report status - things like reachable and battery level - but at least I have basic functionality.
Here is my code, such as it is:
tasmota.things:
Thing mqtt:topic:Zigbee "Tasmota" (mqtt:broker:mqtt) {
Channels:
// Tasmota Status
Type string : Version [stateTopic="stat/Zigbee/STATUS2", transformationPattern="JSONPATH:$.StatusFWR.Version"]
Type switch : Reachable [stateTopic="tele/Zigbee/LWT",
on="Online",
off="Offline"]
// Diagnostics: Define specific for what you really need on a regular basis, use standalone MQTT client for troubleshooting
Type string : RestartReason [
stateTopic="tele/Zigbee/INFO3",
transformationPattern="JSONPATH:$.Info3.RestartReason"
]
// old one, have to query it
Type string : Version2 [
stateTopic="stat/Zigbee/STATUS2",
transformationPattern="JSONPATH:$.StatusFWR.Version"
]
// new one - comes for free at startup
Type string : Version [
stateTopic="tele/Zigbee/INFO1",
transformationPattern="JSONPATH:$.Info1.Version"
]
Type number : RSSI [
stateTopic="tele/Zigbee/STATE",
transformationPattern="JSONPATH:$.Wifi.RSSI"
]
Type string : WifiDowntime [
stateTopic="tele/Zigbee/STATE",
transformationPattern="JSONPATH:$.Wifi.Downtime"
]
Type number : LoadAvg [
stateTopic="tele/Zigbee/STATE",
transformationPattern="JSONPATH:$.LoadAvg"
]
Type number : Uptime [
stateTopic="tele/Zigbee/STATE",
transformationPattern="JSONPATH:$.UptimeSec"
]
Type string : Result [
stateTopic="stat/Zigbee/RESULT"
]
}
Thing mqtt:topic:Zigbee:zPlug1 "Zigbee Plug 1" (mqtt:broker:mqtt) {
Channels:
Type switch : power "Power Switch" [
stateTopic="tele/Zigbee/zPlug1/SENSOR",
transformationPattern="JSONPATH:$.zPlug1.Power",
commandTopic="cmnd/Zigbee/ZBSEND",
formatBeforePublish="{\"device\":\"zPlug1\", \"send\":{\"Power\":\"%s\"} }",
on="1",
off="0"
]
Type switch : Reachable "Reachable" [
stateTopic = "tele/Zigbee/zPlug1/LWT",
on="Online",
off="Offline"
]
}
Thing mqtt:topic:Zigbee:zPlug2 "Zigbee Plug 2" (mqtt:broker:mqtt) {
Channels:
Type switch : power "Power Switch" [
stateTopic="tele/Zigbee/zPlug2/SENSOR",
transformationPattern="JSONPATH:$.zPlug2.Power",
commandTopic="cmnd/Zigbee/ZBSEND",
formatBeforePublish="{\"device\":\"zPlug2\", \"send\":{\"Power\":\"%s\"} }",
on="1",
off="0"
]
Type switch : Reachable "Reachable" [
stateTopic = "tele/Zigbee/zPlug2/LWT",
on="Online",
off="Offline"
]
}
Thing mqtt:topic:Zigbee:zLeak1 "Zigbee Leak Sensor 1" (mqtt:broker:mqtt) {
Channels:
Type contact: water_leak "Water detected" [
stateTopic="tele/Zigbee/zLeak1/SENSOR",
transformationPattern="JSONPATH:$.zLeak1.Water"]
//Type string : battery "Battery" [
// stateTopic="tele/Zigbee/zLeak1/STATE",
// transformationPattern="JSONPATH:$.zLeak1.BatteryPercentage"]
Type switch : Reachable "Reachable" [
stateTopic = "tele/Zigbee/zLeak1/LWT",
on="Online",
off="Offline"
]
}
tasmota.items:
// zPlug1
Switch zPlug1_item "zPlug 1" { channel="mqtt:topic:Zigbee:zPlug1:power" }
Switch string_zPlug1Reachable "Reachable" { channel="mqtt:topic:Zigbee:zPlug1:Reachable" }
//zPlug2
Switch zPlug2_item "zPlug 2" { channel="mqtt:topic:Zigbee:zPlug2:power" }
Switch string_zPlug2Reachable "Reachable" { channel="mqtt:topic:Zigbee:zPlug2:Reachable" }
//zLeak1
Contact zLeak1_leak "Leak Sensor Status [MAP(zleak.map):%s]" { channel="mqtt:topic:Zigbee:zLeak1:water_leak"}
String zLeak1_battery "Battery Status" { channel="mqtt:topic:Zigbee:zLeak1:battery"}
Switch zLeak1_reachable "Reachable" {channel="mqtt:topic:Zigbee:zLeak1:Reachable"}
//Tasmota system
// Tasmota Status
String Tasmota_Version "Tasmota Version [%s]" {channel="mqtt:topic:Zigbee:Version", channel="mqtt:topic:Zigbee:Version2"}
Switch Tasmota_Reachable "Reachable" {channel="mqtt:topic:Zigbee:Reachable"}
// Diagnostics
String Tasmota_RestartReason "Restart Reason [%s]" {channel="mqtt:topic:Zigbee:RestartReason"}
Number:Dimensionless Tasmota_RSSI "Signal [%d %%]" {channel="mqtt:topic:Zigbee:RSSI"}
String Tasmota_WifiDowntime "Wifi Downtime [%s]" {channel="mqtt:topic:Zigbee:WifiDowntime"}
Number:Dimensionless Tasmota_LoadAvg "Load [%d %%]" {channel="mqtt:topic:Zigbee:LoadAvg"}
String Tasmota_Result "Result [%s]" {channel="mqtt:topic:Zigbee:Result"}
Number:Time Tasmota_Uptime "Uptime [%.1f s]" {channel="mqtt:topic:Zigbee:Uptime"}
tasmota.sitemap:
sitemap tasmota label="Tasmota Devices" {
Frame label="Zigbee Plug 1" {
Switch item=zPlug1_item label="Zigbee Plug 1"
Text item=string_zPlug1Reachable labelcolor=["ONLINE"="green","OFFLINE"="red"]
}
Frame label="Zigbee Plug 2" {
Switch item=zPlug2_item label="Zigbee Plug 2"
Text item=string_zPlug2Reachable labelcolor=["ON"="green","OFF"="red"]
}
Frame label="Zigbee Leak Sensor 1" {
Text item=zLeak1_leak labelcolor=["CLOSED"="green","OPEN"="red"] icon="water"
Text item=zLeak1_reachable labelcolor=["ON"="green","OFF"="red"]
Text item=zLeak1_battery
}
Frame label="Tasmota Status" {
// Tasmota Status
Text item=Tasmota_Version
Text item=Tasmota_Reachable labelcolor=["ON"="green","OFF"="red"]
// Diagnostics
Text item=Tasmota_RestartReason
Text item=Tasmota_RSSI
Text item=Tasmota_WifiDowntime
Text item=Tasmota_LoadAvg
Text item=Tasmota_Uptime label="Uptime [%.1f d]"
Text item=Tasmota_Result
}
}
and here’s what I’m seeing in the basic UI:
Thanks for everyone’s help. I’m still trying to get my head around some of the tasmota idiosyncrasies, but at least I know it’s doable!