Zigbee2mqtt on a different pi don't work

*Hello

I’m trying to connect some zigbee stuff that is connected in a second pi to my openhab instalation using zigbee2mqtt.
It “almost” works.

Everything works on the zeebee2mqtt side:

And I can see the topic changing on MQTT Explorer on the device where Openhab runs:

In “.things” I have:

Bridge mqtt:broker:mosquitto "MQTTBroker" [ host="192.168.128.23", port=1883, secure=false ]
{
    Thing topic Botao "Botão" @ "Botao" {
    Channels:
            Type string : click "click" [ stateTopic= "zigbee2mqtt/Botao/action" ]
            Type number : linkquality "linkquality" [ stateTopic= "zigbee2mqtt/Botao/linkquality" ]               

}        

    // Sonoffs
    Thing topic Entrada "Entrada" @ "int_entrada1 " {
    Channels:
        Type string : reachable "Reachable"            [ stateTopic="tele/int_t1_entrada/LWT" ]
        Type switch : power1     "Power1"                [ stateTopic="stat/int_t1_entrada/POWER1", commandTopic="cmnd/int_t1_entrada/POWER1" ]
		Type switch : power2     "Power2"                [ stateTopic="stat/int_t1_entrada/POWER2", commandTopic="cmnd/int_t1_entrada/POWER2" ]
        Type number : rssi      "WiFi Signal Strength" [ stateTopic="tele/int_t1_entrada/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
}

And in “.items”:

String Botao "Botao"  {channel = "mqtt:topic:mosquitto:Botao:click"}

I don’t get anything on Openhab, I have a few Sonoffs using mqtt and they work without problems

What am I missing?

Thanks

João

Based on the screen shot from MQTT Explorer, the topic is zigbee2mqtt/Botao, not zigbee2mqtt/Botao/action. You’ll need to use a JSONPATH transformation to extract the “action” value from the JSON that gets published there.

That’s exactly what I do. Or, use the zigbee2mqtt home assistant auto discovery function.
It works 70% of the time, every time.

Thank you for your help. Rick’s post point me the right direction. I was overlooking the MQTT topic
I normally use

experimental:
  output: attribute

on the configuration.yalm so I don’t need JSONPATH and can use zigbee2mqtt/Botao/action and forgot this time.

Thank you

Bom trabalho :slight_smile:

1 Like