Receiving MQTT response from a Philips bulb

I have an RPi running Node-Red, Mosquitto and Zigbee2MQTT in Docker (latest). Currently only one Philps Hue lamp (9290022169) is connected which I can control. Unfortunately I have a problem querying the status and use it (show in debug) in Node-Red.

This is my FLow:

I cann see the respone in the Z2M Log:

How can i read the respone in Node-Red?

Thanks and have a nice day,
Ben

Hi Ben,

This should be enough to get the status out of your lamp after pressing the statusabfrage , don't forget to set the output of the mqtt node to "a parsed json object" for easy handling of the data.

Hi edje,

Thanks for your reply.

Unfortunately I don’t get a response in Node-red.

Here are the settings of the mqtt-in Node.

Do you think these settings should work?

If you install MQTT explorer you can watch and examine all the MQTT topics flying around & determine what topics you need to subscribe to

The mqtt in node must be without the /get in the topic.
So the topic needs to be zigbee2mqtt/Lampe_Buero

I tried this before. But with no succes.

If I got that right, it should actually work with this flow?! But I did not receive the response of the bulb in Node Red (but in the MQTT-Broker Logs).

Do you have any ideas how I can catch the respone in NodeRed?

This is my Flow:

[
    {
        "id": "3523f9f6631a492f",
        "type": "tab",
        "label": "Bulb repsonse",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "3fd60f1c8f78b190",
        "type": "debug",
        "z": "3523f9f6631a492f",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 550,
        "y": 300,
        "wires": []
    },
    {
        "id": "785215765a426f6f",
        "type": "inject",
        "z": "3523f9f6631a492f",
        "name": "Statusabfrage ",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"brightness\": \"\"}",
        "payloadType": "str",
        "x": 350,
        "y": 220,
        "wires": [
            [
                "d9259d47693d1f8b",
                "abe33dd859ac5def"
            ]
        ]
    },
    {
        "id": "f2e34ef30cecf719",
        "type": "mqtt in",
        "z": "3523f9f6631a492f",
        "name": "",
        "topic": "zigbee2mqtt/Lampe_Buero",
        "qos": "0",
        "datatype": "json",
        "broker": "5f7aaa48051ef5f8",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 270,
        "y": 280,
        "wires": [
            [
                "3fd60f1c8f78b190"
            ]
        ]
    },
    {
        "id": "d9259d47693d1f8b",
        "type": "mqtt out",
        "z": "3523f9f6631a492f",
        "name": "",
        "topic": "zigbee2mqtt/Lampe_Buero/get",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "5f7aaa48051ef5f8",
        "x": 610,
        "y": 220,
        "wires": []
    },
    {
        "id": "abe33dd859ac5def",
        "type": "debug",
        "z": "3523f9f6631a492f",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 160,
        "wires": []
    },
    {
        "id": "5f7aaa48051ef5f8",
        "type": "mqtt-broker",
        "name": "mosquitto mit PW",
        "broker": "mosquitto",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    }
]

It looks good, now set the output of the mqtt node to a parsed json object and look again in the debug window.
To be sure you don't miss anything set the output of the debug node to complete msg object.