Success with Sonoff zigbee bridge and zigbee binding

Thanks for the tip !
I now have a MQTT topic per device.
I just adapted my things:

Bridge mqtt:broker:mosquitto-nas [ host="localhost", secure=false, clientID="openhab-aqara.things" ]
{   Thing topic Zbbridge1 "Zbbridge1 Sonoff" @ "Garage" {
      Channels:
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/zbbridge1/STATE" , transformationPattern="JSONPATH:$.Time"]      
        Type number : LoadAvg "LoadAvg" [stateTopic="tele/zbbridge1/STATE" , transformationPattern="JSONPATH:$.LoadAvg"]
        Type number : Vcc "Vcc" [stateTopic="tele/zbbridge1/STATE" , transformationPattern="JSONPATH:$.Vcc"]
        Type string : Version [stateTopic="stat/zbbridge1/INFO1", transformationPattern="JSONPATH:$.Version"]
      }

    Thing topic AqaraTemp02 "AqaraTemp02" @ "Cave" {
    Channels:
        Type string : Name "Name" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.Name"]
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.Temperature"]      
        Type number : Temperature "Temperature" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.Temperature", unit="°C"]
        Type number : Pressure "Pressure" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.Pressure" , unit="hPa"]
        Type number : Humidity "Humidity" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.Humidity" , unit="%"]
        Type number : BatteryVoltage "BatteryVoltage" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.BatteryVoltage" , unit="V"]
        Type number : BatteryPercentage "BatteryPercentage" [stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.BatteryPercentage" , unit="%"]
        Type number : LinkQuality "LinkQuality" [ stateTopic="tele/AqaraTemp02/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraTemp02.LinkQuality"]
      }

    Thing topic TuyaTemp01 "TuyaTemp01" @ "Cuisine" {
    Channels:
        Type string : Name "Name" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.Name"]
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.Temperature"]
        Type number : Temperature "Temperature" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.Temperature", unit="°C"]
        Type number : Pressure "Pressure" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.Pressure" , unit="hPa"]
        Type number : Humidity "Humidity" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.Humidity" , unit="%"]
        Type number : BatteryVoltage "BatteryVoltage" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.BatteryVoltage" , unit="V"]
        Type number : BatteryPercentage "BatteryPercentage" [stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.BatteryPercentage" , unit="%"]
        Type number : LinkQuality "LinkQuality" [ stateTopic="tele/TuyaTemp01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.TuyaTemp01.LinkQuality"]
      }

    Thing topic AqaraPlug01 "AqaraPlug01" @ "Garage" {
    Channels:
        Type string : Name "Name" [stateTopic="tele/AqaraPlug01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraPlug01.Name"]
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/AqaraPlug01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraPlug01.Temperature"]
        Type switch : Power "Power" [stateTopic="tele/AqaraPlug01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraPlug01.Power", commandTopic = "cmnd/zbbridge1/zbSend", formatBeforePublish="{ \"device\":\"AqaraPlug01\", \"send\":{\"Power\":%s} }" ]
        Type number : LinkQuality "LinkQuality" [ stateTopic="tele/AqaraPlug01/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.AqaraPlug01.LinkQuality"]
      }

    Thing topic HueSensor1 "HueSensor1" @ "Extérieur" {
    Channels:
        Type string : Name "Name" [stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.Name"]
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.LinkQuality"]
        Type number : LinkQuality "LinkQuality" [ stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.LinkQuality"]
		Type number : BatteryPercentage "BatteryPercentage" [stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.BatteryPercentage" , unit="%"]
        Type number : Temperature "Temperature" [stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.Temperature", unit="°C"]
        Type switch : Occupancy "Occupancy" [stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.Occupancy"]
        Type number : Illuminance "Illuminance" [stateTopic="tele/HueSensor1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.HueSensor1.Illuminance"]
	}

    Thing topic SonoffMotion1 "SonoffMotion1" @ "Cave" {
    Channels:
        Type string : Name "Name" [stateTopic="tele/SonoffMotion1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffMotion1.Name"]
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/SonoffMotion1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffMotion1.LinkQuality"]
        Type number : LinkQuality "LinkQuality" [ stateTopic="tele/SonoffMotion1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffMotion1.LinkQuality"]
		Type number : BatteryPercentage "BatteryPercentage" [stateTopic="tele/SonoffMotion1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffMotion1.BatteryPercentage" , unit="%"]
        Type switch : Occupancy "Occupancy" [stateTopic="tele/SonoffMotion1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffMotion1.Occupancy"]
	}

    Thing topic SonoffRelay1 "SonoffRelay1" @ "Extérieur" {
    Channels:
        Type string   : Name "Name" [stateTopic="tele/SonoffRelay1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffRelay1.Name"]
        Type datetime : LastUpdate "LastUpdate" [stateTopic="tele/SonoffRelay1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffRelay1.LinkQuality"]
        Type number   : LinkQuality "LinkQuality" [ stateTopic="tele/SonoffRelay1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffRelay1.LinkQuality"]
        Type switch   : Power "Power" [stateTopic="tele/SonoffRelay1/SENSOR" , transformationPattern="JSONPATH:$.ZbReceived.SonoffRelay1.Power", commandTopic = "cmnd/zbbridge1/zbSend", formatBeforePublish="{ \"device\":\"SonoffRelay1\", \"send\":{\"Power\":%s} }" ]
	}

Edit : My previous command transformation pattern was wrong.

1 Like