Zigbee2Mqtt & Hue Motion Detector

Hello All,

I have successfully paired the Hue Motion Detector with Zigbee2Mqtt, but I could not manage to get it running at OpenHab.

I need to have a transformation file for it, but I searched the whole forum + google and I am not able to find something. Maybe I used the wrong keywords…

Does anyone has experience with the Hue Motion Detector within the combination Zigbee2Mqtt & Openhab


Post your item file and the Hue mqtt output, maybe someone can help. BTW I didn’t see the Hue Motion Detector listed in zigbee2mqtt supported devices. Did you use the “How to support new devices” guide to pair it with OH?


I don’t have a item file, as I need a thing file first, similar to this (this one is for Xiamomi motion sensor):

Thing mqtt:topic:OG2_fl_motion "OG2_fl_motion" (mqtt:broker:mosquitto){
    Type switch : motion "Motion" [ stateTopic="zigbee2mqtt/OG2_fl_motion", transformationPattern="JS:getZigbeeOccupancy2Switch.js"]
    Type number : brightness "Brightness" [ stateTopic="zigbee2mqtt/OG2_fl_motion", transformationPattern="JSONPATH:$.illuminance"]
    Type number : voltage "Voltage" [ stateTopic="zigbee2mqtt/OG2_fl_motion", transformationPattern="JSONPATH:$.voltage"]
    Type number : battery "Battery" [ stateTopic="zigbee2mqtt/OG2_fl_motion", transformationPattern="JSONPATH:$.battery"]

I have no clue, how to write the transformation pattern.

BTW: The motion sensor is supported:

For the motion channel, I don’t think OH can use JS transformation with mqtt2 but there may have been some updates to the binding that I’m not aware of.:thinking: I have a light bulb that worked with JS on the mqtt 1.x binding and when moving to mqtt2 I had to use formatBeforePublish on the commandTopic to control brightness/dimmer.

Here are my Things config for the bulb.

Thing topic zigbee2mqtt "My Light" @ "Bedroom" {
        Type switch : power  "Power"               [ stateTopic="zigbee/0xb0ce1814030ac279", transformationPattern="JSONPATH:$.state",
                                                    commandTopic="zigbee/0xb0ce1814030ac279/set", on="ON", off="OFF" ]
        Type dimmer : dimmer "Dimmer"              [ stateTopic="zigbee/0xb0ce1814030ac279",
                                                    commandTopic="zigbee/0xb0ce1814030ac279/set", transformationPattern="JSONPATH:$.brightness", formatBeforePublish="{\"brightness\":%s}" ]

And the Items config

Switch MyLight "My Light"    <light> ["Lighting"]  { channel="mqtt:topic:pibroker:zigbee2mqtt:power", expire="120m,command=OFF" }
Dimmer MyLight_Level "My Light Level [%.0f %%]"    <light> ["Lighting"]  { channel="mqtt:topic:pibroker:zigbee2mqtt:dimmer" }

I do not have a motion sensor that communicates via zigbee2mqtt but hopefully, the bulb example will give you some ideas to get it working.:crossed_fingers: Also, when editing files for the mqtt2 binding you will need to restart OH, each time you make a change, for the changes to work.

Guess I totally missed it.:upside_down_face: