Setting up zigbee devices witha tasmota bridge

can you show the output from the tasmota console

I think I have a problem in my files - the command is not being sent to mqtt.

mqqt.things (connection to the MQTT server)

Bridge mqtt:broker:MosquittoMqttBroker "Mosquitto MQTT Broker" [
	host="192.168.0.14",
	secure=false,
	port=1883,
	username="openhabian",
	]

tasmota.things (the plug)

Thing mqtt:topic:zPlug1 "Zigbee Switch"
    (mqtt:broker:MosquittoMqttBroker)
        {
 	Channels:
		Type switch : power "Power" [
		     stateTopic="tele/zPlug1/STATE",
		     commandTopic="cmnd/zPlug1/ZbSend",
		     transformationPattern="JSONPATH:$.POWER",
		     on="ON",
		     off="OFF" ]


		Type string : reachable "Reachable" [
			stateTopic = "JINJA:{\"mqtt\":\"tele\", \"zPlug1\":\"LWT\"}"
			]
	}

tasmota.items

Switch switch_zPlug1 "Zigbee Switch"  { channel="mqtt:topic:zPlug1:power" }
String string_zPlug1State "Device Status" { channel="mqtt:topic:zPlug1:state" }
String string_zPlug1Reachable "Device Status" { channel="mqtt:topic:zPlug1:reachable" }

tasmota.sitemap

sitemap tasmota label="Tasmota Setup" {
				       Switch item=switch_zPlug1
				       Text   item=string_zPlug1State
				       Text   item=string_zPlug1Reachable
				       }

No messages are being sent to mqtt, nor to the tasmota bridge.

What tool are you using to verify this? If you’re not already, please install MQTT Explorer and use that to watch all the incoming messages to your MQTT broker.

Does your MQTT broker have a username and password?

Please also review the second link in the second post on this thread for correct syntax for an Item. You are missing the reference to the Bridge in your Items configurations.

Your screeshot say that tasmotaHub is the Topic

but in your thing zPlug1 is your topic, this can`t work

show the output of the tasmota conole, you sayed that it works, then will see what is the topic and the device!!!

TasmotaHub is what I thought was the name of the bridge. Should that field be empty?

May I recommend the following tutorial - it should help you with the basics of getting Tasmota devices into openHAB via MQTT - there’s quite a few parts which need correctly configuring, and the tutorial goes into some depth to try and help.

Thanks for the tutorial - it’s where I started! I think what confuses me is that I have a bridge rather than a flashed device (I flashed the bridge but the plug still uses zigbee. I just redid everything per your tutorial, and from what I can see, openhab is not sending any commands to mqtt (although it is online according to the paper ui).
Here are my current files.

Bridge:

mqtt.things

Bridge mqtt:broker:MosquittoMqttBroker "Mosquitto MQTT Broker" [
	host="192.168.0.14",
	secure=false,
	port=1883,
	clientID="OpenHAB2",
	username="",
	password=""
]

tasmota.things

Thing mqtt:topic:zPlug1 "Zigbee Plug 1" (mqtt:broker:MosquittoMqttBroker) {
	Channels:
		Type switch : power "Power Switch" [
			commandTopic="cmnd/zPlug1/POWER",
			stateTopic="stat/zPlug1/POWER",
			on="ON",
			off="OFF"
		]
}

tasmota.items

Switch zPlug1_item "Zigbee Light"  { channel="mqtt:topic:zPlug1:power" }

tasmota.sitemap

sitemap tazHome label="Tasmota Devices" {
   Switch item=zPlug1_item label="Zigbee Light"
}

When I switch the item in the sitemap, I get the following in the openhab events log:

2022-12-11 12:07:09.108 [ome.event.ItemCommandEvent] - Item 'zPlug1_item' received command ON
2022-12-11 12:07:09.124 [nt.ItemStatePredictedEvent] - zPlug1_item predicted to become ON
2022-12-11 12:07:09.279 [vent.ItemStateChangedEvent] - zPlug1_item changed from OFF to ON

I have the mqtt log in a separate terminal, and it does nothing when I switch the item.

You still use the wrong topic.

Why not just post the output of your tasmota cosole, i asked twice already.

Here’s the console output. Thanks for the help.

18:23:56.578 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0006","srcaddr":"0x8BAD","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":71,"securityuse":0,"seqnumber":203,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":125,"cmdid":"0x0A","payload":"00001001"}}
18:23:56.580 ZIG: Battery auto-probe `ZbSend {"Device":"0x8BAD","Read":{"BatteryPercentage":true,"BatteryVoltage":true}}`
18:23:56.582 ZIG: ZbZCLRawReceived: {"0x8BAD":{"0006/0000":1,"Endpoint":1,"LinkQuality":71}}
18:23:56.625 ZigbeeZCLSend device: 0x8BAD, endpoint:1, cluster:0x0001, cmd:0x00, send:"20002100"
18:23:56.626 ZIG: ZbEZSPSend 340000AD8B0401010001014001000001010700010020002100
18:23:56.684 ZIG: {"ZbEZSPReceived":"34000011"}
18:23:56.707 ZIG: {"ZbEZSPReceived":"3F0000AD8B0401010001014001000011010000"}
18:23:56.715 ZIG: {"ZbEZSPReceived":"45000004010100010140010000CCA0C4AD8BFFFF0518010B00C3"}
18:23:56.717 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0001","srcaddr":"0x8BAD","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":71,"securityuse":0,"seqnumber":204,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":1,"cmdid":"0x0B","payload":"00C3"}}
18:23:56.722 MQT: tele/41picX/RESULT = {"ZbResponse":{"Device":"0x8BAD","Name":" zPlug1","Command":"0001!00","Status":195,"StatusMessage":"UNSUPPORTED_CLUSTER","Endpoint":1,"LinkQuality":71}}
18:23:56.968 MQT: tele/41picX/8BAD/SENSOR = {" zPlug1":{"Device":"0x8BAD","Name":" zPlug1","Power":1,"Endpoint":1,"LinkQuality":71}}
18:24:38.402 MQT: tele/41picX/STATE = {"Time":"2022-12-11T18:24:38","Uptime":"0T00:30:13","UptimeSec":1813,"Vcc":3.434,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Raven","BSSId":"00:7F:28:51:E9:17","Channel":6,"Mode":"11n","RSSI":52,"Signal":-74,"LinkCount":1,"Downtime":"0T00:00:06"}}
18:29:38.407 MQT: tele/41picX/STATE = {"Time":"2022-12-11T18:29:38","Uptime":"0T00:35:13","UptimeSec":2113,"Vcc":3.432,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Raven","BSSId":"00:7F:28:51:E9:17","Channel":6,"Mode":"11n","RSSI":58,"Signal":-71,"LinkCount":1,"Downtime":"0T00:00:06"}}
18:34:38.406 MQT: tele/41picX/STATE = {"Time":"2022-12-11T18:34:38","Uptime":"0T00:40:13","UptimeSec":2413,"Vcc":3.418,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Raven","BSSId":"00:7F:28:51:E9:17","Channel":6,"Mode":"11n","RSSI":60,"Signal":-70,"LinkCount":1,"Downtime":"0T00:00:06"}}
18:38:25.912 WIF: Network (re)scan started...
...
18:39:38.410 MQT: tele/41picX/STATE = {"Time":"2022-12-11T18:39:38","Uptime":"0T00:45:13","UptimeSec":2713,"Vcc":3.429,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Raven","BSSId":"00:7F:28:51:E9:17","Channel":6,"Mode":"11n","RSSI":56,"Signal":-72,"LinkCount":1,"Downtime":"0T00:00:06"}}
18:42:37.476 HTP: Configuration
18:42:43.607 HTP: Main Menu
18:42:45.765 HTP: Consoles

I have no idea what 41picX is.

type in your tasmota console

Setoption89 1

restart the device and
post the same output as above again

41picX is your mqtt topic

if you want to change the topic you have to change the mqtt settings %topic% to whatever you want

Here is the console output:

01:38:09.679 CFG: Saved to flash at 1FB, Count 61, Bytes 4096
01:38:16.040 ZIG: Resetting EZSP device
01:38:17.314 MQT: tele/41picX/RESULT = {"ZbState":{"Status":1,"Message":"EFR32 EZSP booted","RestartReason":"Power-on","Code":2}}
01:38:17.315 ZIG: ZbEZSPSend 000008
01:38:17.365 ZIG: {"ZbEZSPReceived":"000008028067"}
01:38:17.367 MQT: tele/41picX/RESULT = {"ZbState":{"Status":55,"Version":"6.7.8.0","Protocol":8,"Stack":2}}
01:38:17.369 MQT: tele/41picX/RESULT = {"ZbState":{"Status":3,"Message":"Configured, starting coordinator"}}
01:38:17.369 ZIG: ZbEZSPSend 53001E0200
01:38:17.437 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.438 ZIG: ZbEZSPSend 5300061000
01:38:17.512 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.513 ZIG: ZbEZSPSend 53000C0200
01:38:17.565 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.566 ZIG: ZbEZSPSend 53000D0500
01:38:17.619 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.620 ZIG: ZbEZSPSend 530012001E
01:38:17.673 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.673 ZIG: ZbEZSPSend 5300190200
01:38:17.745 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.745 ZIG: ZbEZSPSend 53001A1000
01:38:17.817 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.818 ZIG: ZbEZSPSend 53001E0400
01:38:17.888 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.889 ZIG: ZbEZSPSend 5300220200
01:38:17.943 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.944 ZIG: ZbEZSPSend 53002A0300
01:38:17.997 ZIG: {"ZbEZSPReceived":"530000"}
01:38:17.998 ZIG: ZbEZSPSend 53002D0100
01:38:18.069 ZIG: {"ZbEZSPReceived":"530000"}
01:38:18.070 ZIG: ZbEZSPSend 530001FF00
01:38:18.141 ZIG: {"ZbEZSPReceived":"000000"}
01:38:18.142 ZIG: ZbEZSPSend 02000104010500000F0F0000040005000600070008000A00020100030004020403040504060400050000040005000600070008000A0002010003000402040304050406040005
01:38:18.204 ZIG: {"ZbEZSPReceived":"020000"}
01:38:18.205 ZIG: ZbEZSPSend 02000B04010500000000
01:38:18.259 ZIG: {"ZbEZSPReceived":"020000"}
01:38:18.260 ZIG: ZbEZSPSend 100000F9FF58020807020500
01:38:18.314 ZIG: {"ZbEZSPReceived":"100000"}
01:38:18.315 ZIG: ZbEZSPSend 55000003
01:38:18.368 ZIG: {"ZbEZSPReceived":"550000"}
01:38:18.369 ZIG: ZbEZSPSend 55000220
01:38:18.422 ZIG: {"ZbEZSPReceived":"550000"}
01:38:18.423 ZIG: ZbEZSPSend 55000330
01:38:18.476 ZIG: {"ZbEZSPReceived":"550000"}
01:38:18.477 ZIG: ZbEZSPSend 55000551
01:38:18.529 ZIG: {"ZbEZSPReceived":"550000"}
01:38:18.530 ZIG: ZbEZSPSend 55000660
01:38:18.584 ZIG: {"ZbEZSPReceived":"550000"}
01:38:18.585 ZIG: ZbEZSPSend 17000000
01:38:18.639 ZIG: {"ZbEZSPReceived":"170000"}
01:38:18.641 ZIG: {"ZbEZSPReceived":"190090"}
01:38:18.642 ZIG: ZbEZSPSend 6A0003
01:38:18.720 ZIG: {"ZbEZSPReceived":"6A0000030003A140BD3EC45BBEE2A140BD3EC45BBEE20160010000000000000000000000000000"}
01:38:18.722 ZIG: ZbEZSPSend 2600
01:38:18.775 ZIG: {"ZbEZSPReceived":"2600CB975CFEFFB8DE94"}
01:38:18.776 ZIG: ZbEZSPSend 2800
01:38:18.831 ZIG: {"ZbEZSPReceived":"28000001C45BBEE2CCCCCCCCC41B140B0000000000F8FF07"}
01:38:18.835 MQT: tele/41picX/RESULT = {"ZbState":{"Status":56,"IEEEAddr":"0x94DEB8FFFE5C97CB","ShortAddr":"0x0000","DeviceType":1}}
01:38:18.837 ZIG: ZbEZSPSend 2600
01:38:18.887 ZIG: {"ZbEZSPReceived":"2600CB975CFEFFB8DE94"}
01:38:18.888 ZIG: ZbEZSPSend 2700
01:38:18.940 ZIG: {"ZbEZSPReceived":"27000000"}
01:38:18.941 ZIG: Subscribe to group 0 'ZbListen0 0'
01:38:18.941 ZIG: ZbEZSPSend 64000000000100
01:38:18.994 ZIG: {"ZbEZSPReceived":"640000"}
01:38:18.997 MQT: tele/41picX/RESULT = {"ZbState":{"Status":0,"Message":"Started"}}
01:38:18.999 ZIG: Zigbee started
01:38:18.025 ZIG: EEPROM signature 0x6D736154 is correct
01:38:19.003 ZIG: Zigbee device information found in File System (2 devices - 97 bytes)
01:38:19.010 ZIG: Zigbee device data in EEPROM (40 bytes)
01:38:32.953 HTP: Consoles
01:38:35.426 HTP: Console

I need you to do one more command in your tasmota console

ZbInfo

and post the output of the console again

Here it is. Thanks again.

14:13:10.737 CMD: zbinfo
14:13:10.739 SRC: WebConsole from 192.168.0.3
14:13:10.740 CMD: Grp 0, Cmd 'ZBINFO', Idx 1, Len 0, Pld -99, Data ''
14:13:10.748 MQT: tele/41picX/8BAD/SENSOR = {" zPlug1":{"Device":"0x8BAD","Name":" zPlug1","IEEEAddr":"0x7CB94C6334A90000","ModelId":"SWITCH-ZR03-1","Manufacturer":"eWeLink","Endpoints":[1],"Config":["O01"],"Power":0,"Reachable":true,"LastSeen":2301,"LastSeenEpoch":1670848489,"LinkQuality":66}}
14:13:10.754 MQT: tele/41picX/968E/SENSOR = {" zPlug2":{"Device":"0x968E","Name":" zPlug2","IEEEAddr":"0x7CB94C63348A0000","ModelId":"SWITCH-ZR03-1","Manufacturer":"eWeLink","Endpoints":[1],"Config":["O01"],"Power":0,"Reachable":true,"LastSeen":1186,"LastSeenEpoch":1670849604,"LinkQuality":76}}
14:13:10.757 MQT: stat/41picX/RESULT = {"ZbInfo":"Done"}
14:13:25.162 ZIG: {"ZbEZSPReceived":"45000004010600010100010000AA9CC38E96FFFF07186D0A00001000"}
14:13:25.164 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0006","srcaddr":"0x968E","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":68,"securityuse":0,"seqnumber":170,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":109,"cmdid":"0x0A","payload":"00001000"}}
14:13:25.166 ZIG: Battery auto-probe `ZbSend {"Device":"0x968E","Read":{"BatteryPercentage":true,"BatteryVoltage":true}}`
14:13:25.167 ZIG: ZbZCLRawReceived: {"0x968E":{"0006/0000":0,"Endpoint":1,"LinkQuality":68}}
14:13:25.213 ZigbeeZCLSend device: 0x968E, endpoint:1, cluster:0x0001, cmd:0x00, send:"20002100"
14:13:25.214 ZIG: ZbEZSPSend 3400008E96040101000101400100000D0107000D0020002100
14:13:25.271 ZIG: {"ZbEZSPReceived":"34000043"}
14:13:25.296 ZIG: {"ZbEZSPReceived":"3F00008E960401010001014001000043010000"}
14:13:25.304 ZIG: {"ZbEZSPReceived":"45000004010100010140010000AB9CC38E96FFFF05180D0B00C3"}
14:13:25.306 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0001","srcaddr":"0x968E","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":68,"securityuse":0,"seqnumber":171,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":13,"cmdid":"0x0B","payload":"00C3"}}
14:13:25.311 MQT: tele/41picX/RESULT = {"ZbResponse":{"Device":"0x968E","Name":" zPlug2","Command":"0001!00","Status":195,"StatusMessage":"UNSUPPORTED_CLUSTER","Endpoint":1,"LinkQuality":68}}
14:13:25.556 MQT: tele/41picX/968E/SENSOR = {" zPlug2":{"Device":"0x968E","Name":" zPlug2","Power":0,"Endpoint":1,"LinkQuality":68}}

Note - I have two plug devices linked to the bridge, but so far I’m just trying to figure out how to work with the first one.

use this as your tasmota.things

Thing mqtt:topic:41picX "Zigbee Plug 1" (mqtt:broker:MosquittoMqttBroker) {
	Channels:
		Type switch : power "Power Switch" [
			
			stateTopic="tele/41picX/8BAD/SENSOR",
                        transformationPattern="JSONPATH:$.zPlug1.POWER",
                        commandTopic="cmnd/41picX/8BAD/ZBSEND",
                        formatBeforePublish: "{"device":"zPlug1", "send":{"Power":"%s"} }",
			on="1",
			off="0"
		]

}


This as your tasmota.item

Switch zPlug1_item "Zigbee Light"  { channel="mqtt:topic:41picX:power" }

It shold work like this

Is this tested? May need to escape the quotation marks in the formatBeforePublish value.

I’ve tried escaping the quotation marks and still can’t get it to validate/load in OH.

Revised thing:

Thing mqtt:topic:41picX "Zigbee Plug 1" (mqtt:broker:MosquittoMqttBroker) {
	Channels:
		Type switch : power "Power Switch" [

			stateTopic="tele/41picX/8BAD/SENSOR",
                        transformationPattern="JSONPATH:$.zPlug1.POWER",
                        commandTopic="cmnd/41picX/8BAD/ZBSEND",
                        formatBeforePublish: "{\"device\":\"zPlug1\", \"send\":{\"Power\":\"%s\"} }",
							on="1",
							off="0"
			]

}

And I get the following when it loads:

==> /var/log/openhab2/openhab.log <==
2022-12-12 13:34:06.164 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'tasmota.things' has errors, therefore ignoring it: [8,44]: mismatched input ':' expecting '='

2022-12-12 13:34:07.910 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'tasmota.things' has errors, therefore ignoring it: [8,44]: mismatched input ':' expecting '='

Sorry, my bad, now tested
you were on the right track, but you overlooked the colon, as i did. :face_with_peeking_eye:

formatBeforePublish= "{\"device\":\"zPlug1\", \"send\":{\"Power\":\"%s\"} }",

I almost forgot why i changed to UI configuration

So I did this:

formatBeforePublish: "{\"device\"\:\"zPlug1\", \"send\"\:{\"Power\"\:\"%s\"} }",

and got:

2022-12-12 16:41:07.351 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'tasmota.things' has errors, therefore ignoring it: [8,44]: mismatched input ':' expecting '='
[8,46]: mismatched character ':' expecting set null
[8,61]: mismatched character ':' expecting set null
[8,84]: mismatched character ':' expecting set null

change the colon against the equals