Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get device VOCKQJK11LM binding to Z2M #6872

Closed
zrainx opened this issue Mar 29, 2021 · 37 comments
Closed

How to get device VOCKQJK11LM binding to Z2M #6872

zrainx opened this issue Mar 29, 2021 · 37 comments
Labels
problem Something isn't working stale Stale issues

Comments

@zrainx
Copy link

zrainx commented Mar 29, 2021

Bug Report
What happened
I have bought a new device VOCKQJK11LM from www.aqara.com. I tried to support this device in my Z2M. It seemed the device has successfully been paired but I can't receive any Zigbee message of "attributeReport" type from it.

The package shows it's a Zigbee 3.0 device.

In an other zigbee adapter I received following log:
{"code":1002,"id": "010154ef44100001abe5", "ep": 1,"serial": 12004,"control":{"devbindreq":"0001mtemp","bindDstEndpoin":1,"bindDstAddr":"680ae2fffe0694bc"}}
{"code":1002,"id": "010154ef44100001abe5", "ep": 1,"serial": 12004,"control":{"devbindreq":"0001mhumi","bindDstEndpoin":1,"bindDstAddr":"680ae2fffe0694bc"}}
After the zigbee adapter bound the VOC device, I can receive payload message from the device.
I am not sure whether this device bind request is skipped in Z2M. And in zigbee2mqtt.io I can only find binding information between devices.

Or there was something I didn't aware to do to support the VOC device.

What did you expect to happen
I can receive some Zigbee message of "attributeReport" type from the new VOCKQJK11LM device, so I can support this new device in my Z2M

How to reproduce it (minimal and precise)
Just in What happened

Debug Info
Zigbee2MQTT version: 1.17.0
Adapter hardware: CC2538
Adapter firmware version: ’20200211‘

@zrainx zrainx added the problem Something isn't working label Mar 29, 2021
@Koenkk
Copy link
Owner

Koenkk commented Mar 29, 2021

Can you share the data/database.db entry of this device?

@zrainx
Copy link
Author

zrainx commented Mar 30, 2021

the db entry of this device is as below:

{"id":6,"type":"EndDevice","ieeeAddr":"0x54ef44100001abe5","nwkAddr":65335,"manufId":4447,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.airmonitor.acn01","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":770,"inClusterList":[0,3,1026,1029,12,1],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"modelId":"lumi.airmonitor.acn01","manufacturerName":"LUMI","powerSource":3,"zclVersion":3,"appVersion":23,"stackVersion":2,"hwVersion":1,"dateCode":"20200925","swBuildId":"2020\u0000www."}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":23,"stackVersion":2,"hwVersion":1,"dateCode":"20200925","swBuildId":"2020\u0000www.","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1616478351314}

@Koenkk
Copy link
Owner

Koenkk commented Mar 30, 2021

I see it supports the temperature (1026) and humidity (1029) cluster, but not any cluster supporting VOC measurements. Probably they use something manufacturer specific. To support this I would need to have a sniff when pairing it with the Xiaomi gateway: https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html

@zrainx
Copy link
Author

zrainx commented Apr 1, 2021

pcapng.zip

Hi Koenkk ,
This is the log sniffed when it pairing with gateway.
I'm not very sure the log is caught correctly or not.
Thanks a lot!

@Koenkk
Copy link
Owner

Koenkk commented Apr 1, 2021

Thanks, can you now make the sensor report some values? (and sniff that)

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Apr 1, 2021
@zrainx
Copy link
Author

zrainx commented Apr 2, 2021

Hi Koenkk ,
Unfortunatly, The sensor VOCKQJK11LM doesn't report any value to z2m when I update your new commit.
But I have found something interesting. I have a shunzhou gateway(not xiaomi gateway), and I find that, the sensor device will report value after it receives the bind request from shunzhou gateway.
mmexport1617373284453

The content of the bind request is as below:

{"code":1002,"id": "010154ef44100001abe5", "ep": 1,"serial": 12004,"control":{"devbindreq":"0001mtemp","bindDstEndpoin":1,"bindDstAddr":"680ae2fffe0694bc"}}
{"code":1002,"id": "010154ef44100001abe5", "ep": 1,"serial": 12004,"control":{"devbindreq":"0001mhumi","bindDstEndpoin":1,"bindDstAddr":"680ae2fffe0694bc"}}

Can z2m submit bind request like that?

Thanks a lot.

@Koenkk
Copy link
Owner

Koenkk commented Apr 4, 2021

@zrainx
Copy link
Author

zrainx commented Apr 6, 2021

Hi Koenkk ,
I‘ve tried with commit 2448,I’m glad to find it reports temperature and humidity to the z2m gateway, But it doesn't report VOC value.
微信图片_20210406151439

Yesterday, I bought a new xiaomi gateway and tried again. I found the sensor VOCKQJK11LM did report VOC value to the new xiaomi gateway. So I re-catch a sniffer log when it was pairing with the new xiaomi gateway.

The sniffer log is as below:
0406-xiaomi.zip

Thank you.

@Koenkk
Copy link
Owner

Koenkk commented Apr 6, 2021

Can you share the network key of your Xiaomi gateway?

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale issues label May 7, 2021
@dasfuu
Copy link

dasfuu commented Jun 24, 2021

@Koenkk

I got it to work - kinda. I don't think i got battery/power and the configure part correct. I manually added the reporting stuff through the UI. (I know the configure part is missing some stuff, but temperature and humidty didn't setup correct either.
And there are two batteries in there so I think the voltage for the calculation might be wrong, or it shipped with very empty batteries. (Edit: Battery now shows 100% now without any changes to the software or hardware)

The sensor values match with the display. They are at times more up to date than on the device. The eInk screen only refreshes from time to time.

image
image

// Import the regular converter package
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
// Set fz (also done in the original device list)
const fz = zigbeeHerdsmanConverters.fromZigbeeConverters;
// Set e (also done in the original device list)
const e = zigbeeHerdsmanConverters.exposes.presets;

const fzn = {
    avoc: {
        cluster: 'genAnalogInput',
        type: 'attributeReport',
        convert: (model, msg, publish, options, meta) => {
            return {
                voc:  msg.data.presentValue
            };
        },
    }
};

const definition = {
    zigbeeModel: ['lumi.airmonitor.acn01'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'AAQS-S01', // Vendor model number, look on the device for a model number
    vendor: 'Xiaomi', // Vendor of the device (only used for documentation and startup logging)
    description: 'TVOC Air Quality Monitor', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    fromZigbee: [
      fzn.avoc,
      fz.xiaomi_battery,
      fz.battery, 
      fz.temperature, 
      fz.humidity
    ], // We will add this later
    toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches).
    //meta: {battery: {voltageToPercentage: '3V_2100'}},
    meta: {configureKey: 2, battery: {voltageToPercentage: '3V_2100'}},    
    exposes: [e.battery(), e.temperature(), e.humidity(), e.voc()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
    configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);
            const binds = ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg'];
            await reporting.bind(endpoint, coordinatorEndpoint, binds);
            await reporting.batteryVoltage(endpoint);
            await reporting.batteryPercentageRemaining(endpoint);
            device.powerSource = 'Battery';
            device.save();
        },
};

module.exports = definition;

@Koenkk Koenkk reopened this Jul 1, 2021
Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Jul 1, 2021
@Koenkk
Copy link
Owner

Koenkk commented Jul 1, 2021

@dasfuu looks good, added this config now. can this be closed?

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

@dasfuu
Copy link

dasfuu commented Jul 1, 2021

@Koenkk there is a problem with this. The configure part didn't seem work for me. I had to add all the reporting entries by hand in the UI. It's missing the genAnalogInput in the code too.

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Jul 1, 2021
@Koenkk
Copy link
Owner

Koenkk commented Jul 1, 2021

@dasfuu does it also work without? If you put the same values in the configure() method it should work (the same code gets called)

@dasfuu
Copy link

dasfuu commented Jul 1, 2021

I got the following in my log:

Jul 01 19:12:42 zigbee npm[5986]: Zigbee2MQTT:error 2021-07-01 19:12:42: Failed to configure 'Aqara_Air_Quality_1', attempt 1 (ReferenceError: reporting is not defined
Jul 01 19:12:42 zigbee npm[5986]:     at Object.configure (evalmachine.<anonymous>:39:13)
Jul 01 19:12:42 zigbee npm[5986]:     at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.js:131:45)
Jul 01 19:12:42 zigbee npm[5986]:     at Configure.onZigbeeEvent (/opt/zigbee2mqtt/lib/extension/configure.js:113:18)
Jul 01 19:12:42 zigbee npm[5986]:     at Controller.callExtensionMethod (/opt/zigbee2mqtt/lib/controller.js:385:44)
Jul 01 19:12:42 zigbee npm[5986]:     at processTicksAndRejections (internal/process/task_queues.js:97:5))

I cannot see anything in the reporting and bind tabs. And i don't get any updates either but it updated the values on the display. When i add the entries in the ui i get updates VERY OFTEN.

See:
image

@dasfuu
Copy link

dasfuu commented Jul 1, 2021

@Koenkk Sorry for double posting. I repaired it and waited some time. But still nothing. As soon as i add the reporting settings it starts sending data. (Unlike the old aqara stuff)

Edit: I am stupid 😅 Defined reporting now in the converter. But still doesn't work.
Even if it works. I cannot configure the genAnalogInput in the converter too. Or at least I don't know how.

Error now is:

Jul 01 19:49:46 zigbee npm[6412]: Zigbee2MQTT:info  2021-07-01 19:49:46: Configuring '0x54ef4410001059a1'
Jul 01 19:49:46 zigbee npm[6412]: Zigbee2MQTT:error 2021-07-01 19:49:46: Failed to configure '0x54ef4410001059a1', attempt 1 (TypeError: Cannot read property 'bind' of undefined
Jul 01 19:49:46 zigbee npm[6412]:     at Object.configure (evalmachine.<anonymous>:41:29)
Jul 01 19:49:46 zigbee npm[6412]:     at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.js:131:45)
Jul 01 19:49:46 zigbee npm[6412]:     at Configure.onZigbeeEvent (/opt/zigbee2mqtt/lib/extension/configure.js:113:18)
Jul 01 19:49:46 zigbee npm[6412]:     at Controller.callExtensionMethod (/opt/zigbee2mqtt/lib/controller.js:385:44)
Jul 01 19:49:46 zigbee npm[6412]:     at processTicksAndRejections (internal/process/task_queues.js:97:5))

Current version:

// Import the regular converter package
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
// Set fz (also done in the original device list)
const fz = zigbeeHerdsmanConverters.fromZigbeeConverters;
// Set e (also done in the original device list)
const e = zigbeeHerdsmanConverters.exposes.presets;
// Set e (also done in the original device list)
const reporting = zigbeeHerdsmanConverters.reporting;

const fzn = {
    avoc: {
        cluster: 'genAnalogInput',
        type: 'attributeReport',
        convert: (model, msg, publish, options, meta) => {
            return {
                voc:  msg.data.presentValue
            };
        },
    }
};

const definition = {
    zigbeeModel: ['lumi.airmonitor.acn01'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
    model: 'AAQS-S01', // Vendor model number, look on the device for a model number
    vendor: 'Xiaomi', // Vendor of the device (only used for documentation and startup logging)
    description: 'TVOC Air Quality Monitor', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
    fromZigbee: [
      fzn.avoc,
      fz.xiaomi_battery,
      fz.battery, 
      fz.temperature, 
      fz.humidity
    ], // We will add this later
    toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches).
    meta: {configureKey: 2, battery: {voltageToPercentage: '3V_2100'}},    
    exposes: [e.battery(), e.temperature(), e.humidity(), e.voc()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
    configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);
            const binds = ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg', 'genAnalogInput'];
            await reporting.bind(endpoint, coordinatorEndpoint, binds);
            await reporting.batteryVoltage(endpoint);
            await reporting.humidity(endpoint);
            await reporting.temperature(endpoint);
            device.powerSource = 'Battery';
            device.save();
        },
};

module.exports = definition;

@github-actions github-actions bot removed the stale Stale issues label Jul 2, 2021
@Koenkk
Copy link
Owner

Koenkk commented Jul 2, 2021

@dasfuu can you add some console.log('TEST 123') to the configure() to see where it fails?

@dasfuu
Copy link

dasfuu commented Jul 2, 2021

@Koenkk

await reporting.bind(endpoint, coordinatorEndpoint, binds);

Seems to be the cause. I get log before but not after that line. (I am on the current master)

@dasfuu
Copy link

dasfuu commented Jul 2, 2021

I fixed the faulty import. now i get

Jul 02 19:02:17 zigbee npm[13781]: Zigbee2MQTT:error 2021-07-02 19:02:17: Failed to configure '0x54ef4410001059a1', attempt 1 (Error: Bind 0x54ef4410001059a1/1 msTemperatureMeasurement from '0x00124b0021cbec97/1' failed (AREQ - ZDO - bindRsp after 10000ms)
Jul 02 19:02:17 zigbee npm[13781]:     at Timeout._onTimeout (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/utils/waitress.js:37:35)
Jul 02 19:02:17 zigbee npm[13781]:     at listOnTimeout (internal/timers.js:549:17)
Jul 02 19:02:17 zigbee npm[13781]:     at processTimers (internal/timers.js:492:7))
Jul 02 19:02:17 zigbee npm[13781]: Zigbee2MQTT:info  2021-07-02 19:02:17: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{"id":"0x54ef4410001059a1"},"error":"Failed to configure (Bind 0x54ef4410001059a1/1 msTemperatureMeasurement from '0x00124b0021cbec97/1' failed (AREQ - ZDO - bindRsp after 10000ms))","status":"error","transaction":"9s9ji-2"}'

Still fails at

await reporting.bind(endpoint, coordinatorEndpoint, binds);

@Koenkk
Copy link
Owner

Koenkk commented Jul 3, 2021

const reporting = zigbeeHerdsmanConverters.reporting; is wrong, should be: const reporting = require('zigbee-herdsman-converters/lib/reporting');

@dasfuu
Copy link

dasfuu commented Jul 3, 2021

@Koenkk I fixed that already and then i got the error in my last comment.

@Koenkk
Copy link
Owner

Koenkk commented Jul 3, 2021

@dasfuu

  • Either the device does not support binding (check if it works without having:
const binds = ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg', 'genAnalogInput'];
await reporting.bind(endpoint, coordinatorEndpoint, binds);
  • OR make sure the device is awake when these commands are executed (press a button on it to wake it up). You can force an execution on the configure via the frontend by clicking on the yellow refresh icon

@dasfuu
Copy link

dasfuu commented Jul 3, 2021

@Koenkk I will try that. But why does it work manually through the UI? Although I only create reportings there. The binding stuff shows up automatically then.

@dasfuu
Copy link

dasfuu commented Jul 3, 2021

@Koenkk the configure works. But the device doesn't report anything then. If I reapply the reportings in the UI it starts working.
After that there is an entry in the binding tab too:

image

Before reapplying I cannot add that binding by myself. It doesn't show the clusters. Only OTA

@Koenkk
Copy link
Owner

Koenkk commented Jul 3, 2021

Ah, binding is indeed done automatically, can you try readding the bind and make sure to wake it up when configure is executed?

@dasfuu
Copy link

dasfuu commented Jul 3, 2021

@Koenkk It does not work. Same error. The device has only one button (double tap to switch display mode, hold to reset/pair)

@Koenkk
Copy link
Owner

Koenkk commented Jul 3, 2021

Can you provide 2 separate herdsman debug logs with the following content (in both situations click a button on the device right before):

  1. When setting up configure reporting via the frontend
  2. When executing the configure from the frontend

See https://www.zigbee2mqtt.io/information/debug.html#zigbee-herdsman-debug-logging on how to enable the herdsman debug logging. Note that this is only logged to STDOUT and not to log files.

@blakadder
Copy link
Contributor

blakadder commented Jul 8, 2021

I managed to get all 3 reporting when manually configuring report in webui. For each time I had to press the button on the device once or the request would time out.
Here's my logs

  • configure reporting for TVOC, required using Bind after
Zigbee2MQTT:debug 2021-07-09 01:30:19: Received MQTT message on 'zigbee2mqtt/bridge/request/device/bind' with data '{"clusters":["msTemperatureMeasurement","msRelativeHumidity","genPowerCfg","genAnalogInput"],"from":"0x54ef441000106c1e/1","to":"Coordinator","transaction":"8z5np-4"}'
Zigbee2MQTT:debug 2021-07-09 01:30:19: binding cluster 'msTemperatureMeasurement' from '0x54ef441000106c1e' to 'Coordinator'
Zigbee2MQTT:info  2021-07-09 01:30:21: Successfully bound cluster 'msTemperatureMeasurement' from '0x54ef441000106c1e' to 'Coordinator'
Zigbee2MQTT:info  2021-07-09 01:30:22: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/bind', payload '{"data":{"clusters":["msTemperatureMeasurement"],"failed":[],"from":"0x54ef441000106c1e/1","to":"Coordinator"},"status":"ok","transaction":"8z5np-4"}'
Zigbee2MQTT:debug 2021-07-09 01:30:25: Received Zigbee message from '0x54ef441000106c1e', type 'attributeReport', cluster 'genAnalogInput', data '{"presentValue":7}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-07-09 01:30:25: MQTT publish: topic 'zigbee2mqtt/0x54ef441000106c1e', payload '{"battery":27,"humidity":55.18,"linkquality":94,"temperature":32.18,"voc":7,"voltage":2800}'
Zigbee2MQTT:debug 2021-07-09 01:30:25: Received Zigbee message from '0x54ef441000106c1e', type 'attributeReport', cluster 'msRelativeHumidity', data '{"measuredValue":5604}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-07-09 01:30:25: MQTT publish: topic 'zigbee2mqtt/0x54ef441000106c1e', payload '{"battery":27,"humidity":56.04,"linkquality":94,"temperature":32.18,"voc":7,"voltage":2800}'
Zigbee2MQTT:debug 2021-07-09 01:30:49: Received Zigbee message from '0x54ef441000106c1e', type 'attributeReport', cluster 'msRelativeHumidity', data '{"measuredValue":5414}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-07-09 01:30:49: MQTT publish: topic 'zigbee2mqtt/0x54ef441000106c1e', payload '{"battery":27,"humidity":54.14,"linkquality":105,"temperature":32.18,"voc":7,"voltage":2800}'
  1. Executing configure after pairing
Zigbee2MQTT:info  2021-07-09 01:25:56: Successfully configured '0x54ef441000106c1e'
Zigbee2MQTT:debug 2021-07-09 01:26:25: Received MQTT message on 'zigbee2mqtt/bridge/request/device/configure' with data '{"id":"0x54ef441000106c1e","transaction":"8z5np-1"}'
Zigbee2MQTT:info  2021-07-09 01:26:25: Configuring '0x54ef441000106c1e'
Zigbee2MQTT:debug 2021-07-09 01:26:26: Received Zigbee message from '0x54ef441000106c1e', type 'readResponse', cluster 'genPowerCfg', data '{"batteryVoltage":28}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-07-09 01:26:26: MQTT publish: topic 'zigbee2mqtt/0x54ef441000106c1e', payload '{"battery":27,"humidity":null,"linkquality":110,"temperature":null,"voc":null,"voltage":2800}'
Zigbee2MQTT:info  2021-07-09 01:26:27: Successfully configured '0x54ef441000106c1e'
Zigbee2MQTT:info  2021-07-09 01:26:27: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{"id":"0x54ef441000106c1e"},"status":"ok","transaction":"8z5np-1"}'
Zigbee2MQTT:debug 2021-07-09 01:26:35: Device '0x54ef441000106c1e' announced itself
igbee2MQTT:info  2021-07-09 01:26:35: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x54ef441000106c1e","ieee_address":"0x54ef441000106c1e"},"type":"device_announce"}'
Zigbee2MQTT:debug 2021-07-09 01:26:45: Received Zigbee message from '0x54ef441000106c1e', type 'attributeReport', cluster 'msRelativeHumidity', data '{"measuredValue":5518}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-07-09 01:26:45: MQTT publish: topic 'zigbee2mqtt/0x54ef441000106c1e', payload '{"battery":27,"humidity":55.18,"linkquality":118,"temperature":null,"voc":null,"voltage":2800}'
Zigbee2MQTT:debug 2021-07-09 01:26:45: Received Zigbee message from '0x54ef441000106c1e', type 'attributeReport', cluster 'msTemperatureMeasurement', data '{"measuredValue":3207}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-07-09 01:26:45: MQTT publish: topic 'zigbee2mqtt/0x54ef441000106c1e', payload '{"battery":27,"humidity":55.18,"linkquality":118,"temperature":32.07,"voc":null,"voltage":2800}'

If it helps, here are Tasmota logs, it binds successfully on first pairing without needing to keep the device awake. Battery

01:14:22.067 ZIG: {"ZbZNPReceived":"653600"}
01:14:22.073 ZIG: {"ZbZNPReceived":"45CB3C"}
01:14:22.078 MQT: tele/zigbee-gateway/RESULT = {"ZbState":{"Status":21,"Message":"Enable Pairing mode for 60 seconds"}}
01:14:22.084 ZIG: {"ZbZNPReceived":"45B6000000"}
01:14:26.061 ZIG: {"ZbZNPReceived":"45CAF13E1E6C10001044EF540000"}
01:14:26.067 MQT: tele/zigbee-gateway/RESULT = {"ZbState":{"Status":34,"IEEEAddr":"0x54EF441000106C1E","ShortAddr":"0x3EF1","ParentNetwork":"0x0000"}}
01:14:26.630 ZIG: {"ZbZNPReceived":"45C1F13EF13E1E6C10001044EF5484"}
01:14:26.636 MQT: tele/zigbee-gateway/RESULT = {"ZbState":{"Status":30,"IEEEAddr":"0x54EF441000106C1E","ShortAddr":"0x3EF1","PowerSource":true,"ReceiveWhenIdle":false,"Security":false}}
01:14:26.643 ZIG: ZbZNPSent 2505F13EF13E
01:14:26.653 ZIG: {"ZbZNPReceived":"650500"}
01:14:26.753 WIF: Checking connection...
01:14:27.026 ZIG: {"ZbZNPReceived":"4585F13E00F13E0101"}
01:14:27.032 MQT: tele/zigbee-gateway/RESULT = {"ZbState":{"Status":32,"ActiveEndpoints":["0x01"]}}
01:14:27.038 ZigbeeZCLSend device: 0x3EF1, group: 0x0000, endpoint:1, cluster:0x0000, cmd:0x00, send:"05000400"
01:14:27.042 ZIG: ZbZNPSent 240202F13E00000000000001000001000001301E070000010005000400
01:14:27.053 ZIG: {"ZbZNPReceived":"640200"}
01:14:27.509 ZIG: {"ZbZNPReceived":"4480F00101"}
01:14:27.514 MQT: tele/zigbee-gateway/RESULT = {"ZbConfirm":{"Endpoint":1,"Status":240,"StatusMessage":""}}
01:14:28.109 ZIG: Zigbee Devices Data saved in Flash (361 bytes)
01:14:28.163 ZIG: Zigbee Devices Data store in Flash (0x402FF800 - 361 bytes)
01:14:28.570 ZIG: ZbZNPSent 2504F13EF13E01
01:14:28.580 ZIG: {"ZbZNPReceived":"650400"}
01:14:29.032 ZIG: {"ZbZNPReceived":"4584F13E00F13E160104010203010600000300020405040C000100011900"}
01:14:29.039 MQT: tele/zigbee-gateway/RESULT = {"ZbState":{"Status":33,"Device":"0x3EF1","Endpoint":"0x01","ProfileId":"0x0104","DeviceId":"0x0302","DeviceVersion":1,"InClusters":["0x0000","0x0003","0x0402","0x0405","0x000C","0x0001"],"OutClusters":["0x0019"]}}
01:14:31.085 ZIG: auto-bind `ZbBind {"Device":"0x3EF1","Endpoint":1,"Cluster":"0x0001"}`
01:14:31.087 ZIG: ZbZNPSent 2521F13E1E6C10001044EF540101000338FB381D004B120001
01:14:31.099 ZIG: {"ZbZNPReceived":"652100"}
01:14:31.457 WIF: Sending Gratuitous ARP
01:14:33.065 ZIG: auto-bind `ZbBind {"Device":"0x3EF1","Endpoint":1,"Cluster":"0x0402"}`
01:14:33.068 ZIG: ZbZNPSent 2521F13E1E6C10001044EF540102040338FB381D004B120001
01:14:33.078 ZIG: {"ZbZNPReceived":"652100"}
01:14:33.574 ZIG: {"ZbZNPReceived":"45A1F13E00"}
01:14:33.580 MQT: tele/zigbee-gateway/RESULT = {"ZbBind":{"Device":"0x3EF1","Status":0,"StatusMessage":"SUCCESS"}}
01:14:33.791 ZIG: {"ZbZNPReceived":"45A1F13E00"}
01:14:33.801 MQT: tele/zigbee-gateway/RESULT = {"ZbBind":{"Device":"0x3EF1","Status":0,"StatusMessage":"SUCCESS"}}
01:14:35.072 ZIG: auto-bind `ZbBind {"Device":"0x3EF1","Endpoint":1,"Cluster":"0x0405"}`
01:14:35.075 ZIG: ZbZNPSent 2521F13E1E6C10001044EF540105040338FB381D004B120001
01:14:35.088 ZIG: {"ZbZNPReceived":"652100"}
01:14:35.185 ZIG: {"ZbZNPReceived":"448100000100F13E0101009C001AC20300000718000A2000201EF13E1D"}
01:14:35.189 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0001","srcaddr":"0x3EF1","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":156,"securityuse":0,"seqnumber":0,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":0,"cmdid":"0x0A","payload":"2000201E"}}
01:14:35.194 ZIG: ZbZCLRawReceived: {"0x3EF1":{"0001/0020":30,"Endpoint":1,"LinkQuality":156}}
01:14:35.200 ZIG: {"ZbZNPReceived":"448100000204F13E0101009C0051C20300000818010A000029910CF13E1D"}
01:14:35.204 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0402","srcaddr":"0x3EF1","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":156,"securityuse":0,"seqnumber":0,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":1,"cmdid":"0x0A","payload":"000029910C"}}
01:14:35.209 ZIG: ZbZCLRawReceived: {"0x3EF1":{"0402/0000":3217,"Endpoint":1,"LinkQuality":156}}
01:14:35.217 ZIG: {"ZbZNPReceived":"45A1F13E00"}
01:14:35.222 MQT: tele/zigbee-gateway/RESULT = {"ZbBind":{"Device":"0x3EF1","Status":0,"StatusMessage":"SUCCESS"}}
01:14:35.572 MQT: tele/zigbee-gateway/3EF1/SENSOR = {"ZbReceived":{"0x3EF1":{"Device":"0x3EF1","BatteryVoltage":3,"BatteryPercentage":100,"Temperature":32.17,"Endpoint":1,"LinkQuality":156}}}
01:14:36.417 ZIG: {"ZbZNPReceived":"448100000504F13E0101009C0030D10300000818030A000021DD15F13E1D"}
01:14:36.421 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0405","srcaddr":"0x3EF1","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":156,"securityuse":0,"seqnumber":0,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":3,"cmdid":"0x0A","payload":"000021DD15"}}
01:14:36.426 ZIG: ZbZCLRawReceived: {"0x3EF1":{"0405/0000":5597,"Endpoint":1,"LinkQuality":156}}
01:14:36.822 MQT: tele/zigbee-gateway/3EF1/SENSOR = {"ZbReceived":{"0x3EF1":{"Device":"0x3EF1","Humidity":55.97,"Endpoint":1,"LinkQuality":156}}}
01:14:37.120 ZIG: auto-bind `ZbSend {"Device":"0x3EF1","Config":{"BatteryVoltage":{"MinInterval":3600,"MaxInterval":14400,"ReportableChange":0.2},"BatteryPercentage":{"MinInterval":3600,"MaxInterval":14400,"ReportableChange":5}}}`
01:14:37.124 ZigbeeZCLSend device: 0x3EF1, group: 0x0000, endpoint:1, cluster:0x0001, cmd:0x06, send:"00200020100E40380200210020100E40380A"
01:14:37.127 ZIG: ZbZNPSent 240202F13E00000000000001000001010002301E150010020600200020100E40380200210020100E40380A
01:14:37.140 ZIG: {"ZbZNPReceived":"640200"}
01:14:37.430 ZIG: {"ZbZNPReceived":"4480000102"}
01:14:37.451 ZIG: {"ZbZNPReceived":"448100000100F13E0101009900B7DD0300000718020786002100F13E1D"}
01:14:37.455 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0001","srcaddr":"0x3EF1","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":153,"securityuse":0,"seqnumber":0,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":2,"cmdid":"0x07","payload":"86002100"}}
01:14:37.460 ZIG: ZbZCLRawReceived: {"0x3EF1":{"ConfigResponse":{"BatteryPercentage":{"Status":134,"StatusMsg":"UNSUPPORTED_ATTRIBUTE"}},"Endpoint":1,"LinkQuality":153}}
01:14:37.468 MQT: tele/zigbee-gateway/3EF1/SENSOR = {"ZbReceived":{"0x3EF1":{"Device":"0x3EF1","ConfigResponse":{"BatteryPercentage":{"Status":134,"StatusMsg":"UNSUPPORTED_ATTRIBUTE"}},"Endpoint":1,"LinkQuality":153}}}
01:14:39.055 ZIG: auto-bind `ZbSend {"Device":"0x3EF1","Config":{"Temperature":{"MinInterval":30,"MaxInterval":3600,"ReportableChange":0.5}}}`
01:14:39.058 ZigbeeZCLSend device: 0x3EF1, group: 0x0000, endpoint:1, cluster:0x0402, cmd:0x06, send:"000000291E00100E3200"
01:14:39.062 ZIG: ZbZNPSent 240202F13E00000000000001000001020403301E0D00100306000000291E00100E3200
01:14:39.074 ZIG: {"ZbZNPReceived":"640200"}
01:14:39.457 ZIG: {"ZbZNPReceived":"4480000103"}
01:14:39.471 ZIG: {"ZbZNPReceived":"448100000204F13E010100940077F60300000418030700F13E1D"}
01:14:39.475 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0402","srcaddr":"0x3EF1","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":148,"securityuse":0,"seqnumber":0,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":3,"cmdid":"0x07","payload":"00"}}
01:14:39.479 ZIG: ZbZCLRawReceived: {"0x3EF1":{"ConfigResponse":{},"Endpoint":1,"LinkQuality":148}}
01:14:39.484 MQT: tele/zigbee-gateway/3EF1/SENSOR = {"ZbReceived":{"0x3EF1":{"Device":"0x3EF1","ConfigResponse":{},"Endpoint":1,"LinkQuality":148}}}
01:14:41.074 ZIG: auto-bind `ZbSend {"Device":"0x3EF1","Config":{"Humidity":{"MinInterval":30,"MaxInterval":3600,"ReportableChange":1}}}`
01:14:41.077 ZigbeeZCLSend device: 0x3EF1, group: 0x0000, endpoint:1, cluster:0x0405, cmd:0x06, send:"000000211E00100E6400"
01:14:41.079 ZIG: ZbZNPSent 240202F13E00000000000001000001050404301E0D00100406000000211E00100E6400
01:14:41.092 ZIG: {"ZbZNPReceived":"640200"}
01:14:41.484 ZIG: {"ZbZNPReceived":"4480000104"}
01:14:41.500 ZIG: {"ZbZNPReceived":"448100000504F13E010100A600430F0400000418040700F13E1D"}
01:14:41.503 ZIG: {"ZbZCLReceived":{"groupid":0,"clusterid":"0x0405","srcaddr":"0x3EF1","srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"LinkQuality":166,"securityuse":0,"seqnumber":0,"fc":"0x18","frametype":0,"direction":1,"disableresp":1,"manuf":"0x0000","transact":4,"cmdid":"0x07","payload":"00"}}
01:14:41.507 ZIG: ZbZCLRawReceived: {"0x3EF1":{"ConfigResponse":{},"Endpoint":1,"LinkQuality":166}}
01:14:41.513 MQT: tele/zigbee-gateway/3EF1/SENSOR = {"ZbReceived":{"0x3EF1":{"Device":"0x3EF1","ConfigResponse":{},"Endpoint":1,"LinkQuality":166}}}

@dasfuu
Copy link

dasfuu commented Jul 8, 2021

I can test some more on the weekend.

@danieledwardgeorgehitchcock
Copy link
Contributor

danieledwardgeorgehitchcock commented Jul 19, 2021

Hi All,

I have managed to get the device to work with the following external converter (aqara_tvoc.js):

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const e = exposes.presets;
const {repInterval} = require('zigbee-herdsman-converters/lib/constants');

const fzLocal = {
    xiaomi_tvoc: {
        cluster: 'genAnalogInput',
        type: ['attributeReport', 'readResponse'],
        convert: (model, msg, publish, options, meta) => {
            return {
                voc: msg.data.presentValue
            };
        },
    }
};

const reportingLocal = {
    xiaomi_tvoc: async (endpoint, overrides) => {
        const p = reporting.payload('presentValue', 10, repInterval.HOUR, 0, overrides);                
        await endpoint.configureReporting('genAnalogInput', p);                                 
    }  
};

const device = {
        zigbeeModel: ['lumi.airmonitor.acn01'],
        model: 'VOCKQJK11LM',
        vendor: 'Xiaomi',
        description: 'Aqara TVOC Air Quality Monitor',
        fromZigbee: [fzLocal.xiaomi_tvoc, fz.battery, fz.temperature, fz.humidity],
        toZigbee: [],
        meta: {battery: {voltageToPercentage: '3V_2100'}},
        exposes: [e.battery(), e.temperature(), e.humidity(), e.voc()],
        configure: async (device, coordinatorEndpoint, logger) => {
            await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg', 'genAnalogInput']);
            await reporting.batteryVoltage(device.getEndpoint(1));
            await reporting.humidity(device.getEndpoint(1));
            await reporting.temperature(device.getEndpoint(1));
            await reportingLocal.xiaomi_tvoc(device.getEndpoint(1));
        },
    };

module.exports = device;

@Koenkk - I am not sure if what I have done with the addition to reporting is the correct way of doing this, but it works - I am happy to tweak this in my prod version

This for me, allows the device to join, bind and report all values without error (voc takes a little while (10-15 mins) to start trickling through).

I have set the minimum report change to 0 for TVOC which will report every change and would likely burn through batteries so, feedback on ideal values would be favourable!

My sweet spot at present is: Battery: 100, Humidity: 50, Temp: 10, TVOC: 5

Please test for yourselves and I will get this merged into the main repo.

@dasfuu
Copy link

dasfuu commented Jul 20, 2021

@danieledwardgeorgehitchcock @Koenkk
looking at the model number. there seem to be different version of this new device.
I will try the converter from @danieledwardgeorgehitchcock and report if it works with my version too. So we can add the model as well.

@danieledwardgeorgehitchcock
Copy link
Contributor

When I looked into it, I found that what you had used was a designation number not the model number. If you look closely at the back of the box just below top left, you should see the value that I have used (I may be wrong though)?

The value that I have used also aligns more the numbering convention that Xiaomi Aqara have used with their other sensors - see the Zigbee2MQTT wiki to confirm.

my device handler should work with your device anyway as Zigbee2MQTT only uses that field for documentation purposes.

Please let me know if this isn’t the case

@blakadder
Copy link
Contributor

blakadder commented Jul 21, 2021

AAQ-S001 model scheme is used for EU markets while the VOCKQJK11LM could be for other markets but its feasible both are the same device

It is also noteworthy that Aqara is he vendor not Xiaomi since this device doesn't exist in Xiaomi's Mijia ecosystem and instead requires Aqara only app and gateway to work with

@dasfuu
Copy link

dasfuu commented Jul 21, 2021

@blakadder seems to be correct

But it still says "Lumi United Technology", isnt that Mi?

PXL_20210721_081717290

@blakadder
Copy link
Contributor

It is not. While Aqara used to label their products under Mi/Xiaomi brand the situation is different now. Xiaomi has their Works with Mijia labe, any manufacturer following Miot spec will have their device added in Mi Home but they don't have to do it.
Aqara is targeting the western markets with Aqara only Homekit enabled devices that work only with latest Aqara gateways and with their own app

@danieledwardgeorgehitchcock
Copy link
Contributor

Interesting!

Nonetheless, the device handler that has been merged, should work with the AAQS-S01 branded device as well as the VOCKQJK11LM one.

As mentioned above, the model is used for the documentation and image references more than anything.

Please try the device that has been pushed to the Dev branch, and let me know if you have any issues.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working stale Stale issues
Projects
None yet
Development

No branches or pull requests

5 participants