I am trying to set up zigbee devices through a bridge.
I flashed the Sonoff bridge to tasmota, and can control devices through the console (although it needs the hex name - it gives and error using friendly names)
zbsend{“device”:“0xA123”, “send”:{“power”:“on”}} works; using “device”:“zigbeePlug” doesn’t.
I installed MQTT and the JSON transformation tools.
As of now, the bridge talks with MQTT, MQTT talks with openHAB, and it appears that information flows to openHAB from the bridge, but commands from openHAB do not go to the bridge.
MQTT and the devices are constantly cycling from offline to online and back again.
It might be your Thing configuration. You have nested it underneath your Bridge configuration, but then linked it again to your Bridge from within the Thing. Have a look at the documentation for an example of a correct configuration.
Thanks for the links. I think I have almost everything correct - probably just one little thing that is causing it to fail.
I took the MQTT link out and reloaded the file. Still no success. It appears that the zigbee data is not reaching openHAB, and commands from openHAB are not reaching MQTT.
Does the bridge have to be included in the message path (mqtt:topic:bridge:item:action) or is the bridge invisible as far as routing?
Did you know that you could probably use the Jinja Transformation Service to do this instead? It would mean the entire configuration remains within your Things file - no separate JS file required!
Thanks for the help, but I’m still not getting it. Here are the files as I’ve rewritten them, along with a screenshot of the tasmota server. I also set the tasmota server to use friendly names.
Online=ON
Offline=OFF
(function(x){
var result = new Object();
result.Power = x;
return JSON.stringify({ Device: "your device", "send": result });
})(input)
This part of your Bridge configuration needs changing. It sets a unique name with which openHAB communicates with the MQTT broker. However, it’s identical to your Tasmota device name. So now two devices are trying to talk to the MQTT broker using the same unique name - this confuses the broker, and it will refuse to talk to one of the devices.
There may be other issues, but that’s an immediate one to try. Just change it to clientID="openHAB" - or whatever: just make sure that nothing else is talking to your MQTT broker with the same name.
First of all, i`m not using files, everything is UI configured
in your tasmota console type following commands
Setoption83 1
Setoption89 1 // set unique device topic based on Zigbee device ShortAddr
Setoption100 1 // remove Zigbee ZbReceived value from JSON message
If you then send a command from your tasmota console it should look like