zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

No Battery State for Xiaomi Smokedetector JTYJ-GD-01LM/BW

Open Sonsi79 opened this issue 8 years ago • 71 comments

I have add my Xiaomi Honeywell smoke detector JTYJ-GD-01LM/BW and it works fine and publish the "smoke" state. But the smoke detector is the didn't publish any state of the battery in MQTT.

Is it possible to get this state also as a publish?

Sonsi79 avatar Jun 26 '18 04:06 Sonsi79

For how long did you let it run? It should publish it's battery state after 1/2 hours.

Koenkk avatar Jun 26 '18 17:06 Koenkk

Hi

I have the same issue, but I only get the smoke state when I press the test button. (last entry)

I should expect every hour the state with the battery, like an xiaomi door sensor does

2018-6-26 05:46:22 INFO 0x00158d0002092004 (0x00158d0002092004): MCCGQ11LM - Xiaomi Aqara door & window contact sensor (EndDevice)
2018-6-26 05:46:22 INFO 0x00158d0001fd66e2 (0x00158d0001fd66e2): JTYJ-GD-01LM/BW - Xiaomi MiJia Honeywell smoke detector (EndDevice)
2018-6-26 05:46:22 WARN `permit_join` set to  `true` in configuration.yaml.
2018-6-26 05:46:22 WARN Allowing new devices to join.
2018-6-26 05:46:22 WARN Set `permit_join` to `false` once you joined all devices.
2018-6-26 05:46:22 INFO Zigbee: allowing new devices to join.
2018-6-26 05:46:22 INFO Connecting to MQTT server at mqtt://192.168.180.10
2018-6-26 05:46:22 INFO zigbee-shepherd ready
2018-6-26 05:46:22 INFO Connected to MQTT server
2018-6-26 05:46:22 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
2018-6-26 05:58:15 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 06:48:25 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 07:38:36 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 08:28:48 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3065}'
2018-6-26 09:18:58 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3065}'
2018-6-26 10:09:07 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3065}'
2018-6-26 10:59:18 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3065}'
2018-6-26 11:49:30 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 12:39:42 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 13:29:49 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 14:20:00 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 15:10:11 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3055}'
2018-6-26 16:00:22 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3065}'
2018-6-26 16:50:33 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0002092004', payload: '{"battery":"100.00","voltage":3065}'
2018-6-26 17:28:19 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d0001fd66e2', payload: '{"smoke":false}'

kroon040 avatar Jun 26 '18 17:06 kroon040

I have run 4 devices for few days and only get the smoke state as publish. All of my other Xiaomi devices publish the battery state only the smoke detector didn't.

By pressing the Button the device is publishing only: {"smoke":false}

Hope you can help

Sonsi79 avatar Jun 26 '18 19:06 Sonsi79

Can you try changing the entry of this device in node_modules/zigbee-shepherd-converters/devices.js to:

    {
        zigbeeModel: ['lumi.sensor_smoke'],
        model: 'JTYJ-GD-01LM/BW',
        description: 'MiJia Honeywell smoke detector',
        supports: 'smoke',
        vendor: 'Xiaomi',
        fromZigbee: [fz.JTYJGD01LMBW_smoke, fz.ignore_basic_change],
        toZigbee: [],
    },

And check if any WARN: No converter available for.... messages appear?

Koenkk avatar Jun 27 '18 19:06 Koenkk

I have try it and get this error by pressing the Button on smoke detector: WARN No converter available for 'JTYJ-GD-01LM/BW' with cid 'genBasic' and type 'attReport'

any other ideas? how can i help you to found the error and fix it?

Sonsi79 avatar Jun 27 '18 20:06 Sonsi79

Good! Can you now set advanced -> log_level: debug in data/configuration.yaml. https://github.com/Koenkk/zigbee2mqtt/wiki/Configuration

This will print the message.

Koenkk avatar Jun 28 '18 06:06 Koenkk

OK, now im getting the message

2018-6-29 23:46:12 WARN No converter available for 'JTYJ-GD-01LM/BW' with cid 'genBasic' and type 'attReport'
2018-6-29 23:46:12 WARN Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices.
2018-6-29 23:46:12 DEBUG Recieved zigbee message with data {"cid":"genBasic","data":{"modelId":"lumi.sensor_smoke"}}
2018-6-29 23:46:12 DEBUG Recieved zigbee message with data {"cid":"ssIasZone","zoneStatus":0}
2018-6-29 23:46:12 INFO MQTT publish, topic: 'zigbee2mqtt/0x00158d000202eff6', payload: '{"smoke":false}'

Sonsi79 avatar Jun 29 '18 21:06 Sonsi79

It doesn't contain any battery information.

Could you post the entry of this device from data/database.db?

Koenkk avatar Jun 30 '18 07:06 Koenkk

I hope this is the right line...

{"id":11,"type":"EndDevice","ieeeAddr":"0x00158d000202eff6","nwkAddr":20594,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_smoke","epList":[1],"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,1,3,12,18,1280],"outClusterList":[25],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{}},"genPowerCfg":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genAnalogInput":{"dir":{"value":1},"attrs":{}},"genMultistateInput":{"dir":{"value":1},"attrs":{}},"genOta":{"dir":{"value":2},"attrs":{}},"ssIasZone":{"dir":{"value":1},"attrs":{}}}}},"_id":"pCPL00secZLGvXec"}

Sonsi79 avatar Jun 30 '18 11:06 Sonsi79

That's the right line, but I don't see the battery being in.

@kirovilya can you help with this?

Koenkk avatar Jun 30 '18 15:06 Koenkk

I have not Xiaomi Smoke sensor... I'll ask the users of my application for this issue. Think, it was like for other xiaomi sensor. Strange that this is not so...

kirovilya avatar Jul 02 '18 06:07 kirovilya

Confirmed. Battery not received :( Need research events and data... I request a detailed log of work with the sensor.

Found some code here https://github.com/veeceeoh/xiaomi-hubitat/blob/0c42285fc9c7cb4554d7b8968087d50ef9cb048b/devicedrivers/xiaomi-honeywell-smoke-detector.src/xiaomi-honeywell-smoke-detector.groovy#L86

kirovilya avatar Jul 02 '18 10:07 kirovilya

In i can help, let me know...

Sonsi79 avatar Jul 02 '18 21:07 Sonsi79

@Sonsi79 Can you collect detailed log from smoke-sensor like describe here https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-debug#all-debug-logging during short press button on sensor. And put file here.

kirovilya avatar Jul 03 '18 04:07 kirovilya

@kirovilya ok i will do it later after work and publish the results here...

Sonsi79 avatar Jul 03 '18 05:07 Sonsi79

Here's the log file from DEBUG run. During this run i have first pressed buttons on my Switch and later pressed the button on smoke detector. It seems my thermometer also publish something during thins time.

I hope this file helps... log.txt

Sonsi79 avatar Jul 03 '18 20:07 Sonsi79

@Sonsi79 that is not all... you need start DEBUG=* npm start and save all from console to file. So, command will be: DEBUG=* npm start > log.txt

kirovilya avatar Jul 04 '18 04:07 kirovilya

Ok, done. Here the file... log.txt

Sonsi79 avatar Jul 04 '18 08:07 Sonsi79

Hm it seems that most of Debug Infos wasn't Safe in this file. Here the Output of Console during Debug start. I have copy/paste it. debug_output.txt

Sonsi79 avatar Jul 04 '18 09:07 Sonsi79

@Sonsi79 Well! I think we got it: cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 20594, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 52, securityuse: 0, timestamp: 94508, transseqnumber: 0, len: 46, data: <Buffer 18 7f 0a 01 ff 42 28 01 21 85 0c 03 28 19 04 21 a8 43 05 21 0e 00 06 24 03 00 00 00 00 0a 21 00 00 08 21 04 10 64 20 00 96 23 00 00 00 00> } +21ms

Splited version of buffer: 18 7f 0a - header 01 ff - attrId ----- this is xiaomi attribute for heartbeat = 65281 42 - type 'charStr' 28 - length 40 byte 01 - index '1' ----- this is battery value of attribute 21 - type 'uint16' 85 0c - data ----- this is battery voltage = 3205 03 - index '3' 28 - type 'int8' 19 - data 04 - index '4' 21 - type 'uint16' a8 43 - data 05 - index '5' 21 - type 'uint16' 0e 00 - data 06 - index '6' 24 - type 'uint40' 03 00 00 00 00 - data 0a 21 04 10 - '10' 'uint16' data 64 20 00 - '100' 'int8' data 96 23 00 00 00 00 - '150', 'uint32', data

So, this message is correctly understood by me, but why it not parsed by zigbee-shepherd... Any ideas?

kirovilya avatar Jul 04 '18 09:07 kirovilya