zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Motion sensors state behavior (RTCGQ11LM)

Open ASchneiderBR opened this issue 8 years ago • 48 comments

Hello everyone.

I was wondering if this behavior is normal or there is something that can be done.

I've noticed that after migrating to this platform from the Xiaomi gateways, the motion sensor cannot maintain the ON state if there is still movement on the room. It only shows the 60 seconds trigger then stays off for a few seconds that does not detects anything and then sends another ON state to HA when motion is detected.

Here is a comparison of the same motion sensors, one with this solution and the other still with connected by the gateway:

image

the one on the bottom is the GW connected sensor, both are the RTCGQ11LM model.

Is this the default behavior? This impacts on my logs, history, recorder (db size) and also CPU, since I have automations that triggers by the ON state of these sensors.

Thanks a lot!

ASchneiderBR avatar Aug 09 '18 20:08 ASchneiderBR

I've seen some RTCGQ11LM which do not report any occupancy anymore for +- 1/2 min after occupancy has been detected. Could you post your log so we could verify this? It is important to constantly trigger the motion sensor during that period.

Koenkk avatar Aug 10 '18 06:08 Koenkk

Will do @Koenkk! Thanks for you reply. I am pretty sure that the sensor goes "numb" for 30 seconds after triggering. Nothing is sent to HA.

ASchneiderBR avatar Aug 10 '18 17:08 ASchneiderBR

Hello, I have the same problems with the Xiaomi Motion with Lux Sensor.

If I paire the sensor it only works for 1-2 minutes, then only sporadically and at some point not at all. I have created a log of this:

log2.txt the different times in the log are probably caused by this #DEBUG=zigbee-shepherd* npm start &>> log2.txt

16:33:27 push button 16:33:27 push button 16:48:49 Battery removed

I was in front of the sensor all the time, making hand movements.

The other motion sensor without Lux Sensor works perfectly, for several weeks.

I tested this on a clean fresh zigbee2mqtt environment, with only one sensor. As coordinator I have a CC2530 with external antenna. The range to the sensor is about 3 meters with an open door in between.

I have this problem at two different locations, with different hardware.

mark078 avatar Aug 14 '18 14:08 mark078

@mark078 this sound like battery issues, have you already tried replacing?

Koenkk avatar Aug 14 '18 16:08 Koenkk

@Koenkk no, I haven't changed the battery yet, I'll do that later. But measured with a multimeter, it has 3.01 volts and is from Panasonic.

I have two of these sensors that cause these problems, by the way. I ordered one from Gearbest in April and the other from Joybuy in June.

mark078 avatar Aug 14 '18 17:08 mark078

@Koenkk I took out the battery and connected a 3.3 Volt Arduino and measured the voltage, it was 3.3 Volt. Unfortunately, nothing has changed in this behaviour. :(

log6.txt

I was the whole time before and waved at him, but he gets out regularly and then reports no more motion. :-(

Don't you have such problems?

mark078 avatar Aug 14 '18 18:08 mark078

It seems that your sensors doens't report the occupancy that often (I've seen that more).

Can you try setting the occupancy_timeout to 300?

Koenkk avatar Aug 14 '18 19:08 Koenkk

I entered it with occupancy_timeout: 300, it looked good at first, but not any more below. There was no reaction for over 8 minutes, although there was movement.

I'll connect it tomorrow with the original Xiaomi bridge. Maybe it'll give him a firmware update.

2018-08-14T19:55:22.273Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":119}}
2018-08-14T19:55:22.303Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":119}'
2018-08-14T19:55:22.331Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":119}}
2018-08-14T19:59:13.591Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"modelId":"lumi.sensor_motion.aq2"}}
2018-08-14T19:59:21.213Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":61}}
2018-08-14T19:59:21.238Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":61}'
2018-08-14T19:59:21.263Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":61}}

battery removed

2018-08-14T19:59:41.619Z - debug: Recieved zigbee message with data {"cid":"msOccupancySensing","data":{"occupancy":1}}
2018-08-14T19:59:41.641Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":61,"occupancy":true}'
2018-08-14T19:59:41.665Z - debug: Recieved zigbee message with data {"cid":"msOccupancySensing","data":{"occupancy":1}}
2018-08-14T19:59:53.279Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":111}}
2018-08-14T19:59:53.302Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":111,"occupancy":true}'
2018-08-14T19:59:53.345Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":111}}
2018-08-14T20:00:11.100Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":118}}
2018-08-14T20:00:11.117Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":118,"occupancy":true}'
2018-08-14T20:00:11.136Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":118}}
2018-08-14T20:00:13.140Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":105}}
2018-08-14T20:00:13.168Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":105,"occupancy":true}'
2018-08-14T20:00:13.197Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":105}}
2018-08-14T20:00:26.059Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":151}}
2018-08-14T20:00:26.076Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":151,"occupancy":true}'
2018-08-14T20:00:26.096Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":151}}
2018-08-14T20:00:28.088Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":124}}
2018-08-14T20:00:28.106Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":124,"occupancy":true}'
2018-08-14T20:00:28.125Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":124}}
2018-08-14T20:00:28.447Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":155}}
2018-08-14T20:00:28.463Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":155,"occupancy":true}'
2018-08-14T20:00:28.482Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":155}}
2018-08-14T20:00:28.803Z - debug: Recieved zigbee message with data {"cid":"msOccupancySensing","data":{"occupancy":1}}
2018-08-14T20:00:28.848Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":155,"occupancy":true}'
2018-08-14T20:00:46.731Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":109}}
2018-08-14T20:00:46.748Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":109,"occupancy":true}'
2018-08-14T20:00:46.766Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":109}}
2018-08-14T20:00:48.758Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T20:00:48.773Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":true}'
2018-08-14T20:00:48.790Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T20:00:50.845Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":154}}
2018-08-14T20:00:50.873Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":154,"occupancy":true}'
2018-08-14T20:00:50.898Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":154}}
2018-08-14T20:00:52.821Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":119}}
2018-08-14T20:00:52.838Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":119,"occupancy":true}'
2018-08-14T20:00:52.857Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":119}}
2018-08-14T20:00:54.956Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T20:00:54.973Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":true}'
2018-08-14T20:00:54.992Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T20:01:42.274Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":112}}
2018-08-14T20:01:42.289Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":112,"occupancy":true}'
2018-08-14T20:01:42.306Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":112}}
2018-08-14T20:01:55.169Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":155}}
2018-08-14T20:01:55.185Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":155,"occupancy":true}'
2018-08-14T20:01:55.204Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":155}}
2018-08-14T20:01:57.219Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T20:01:57.234Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":true}'
2018-08-14T20:01:57.254Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T20:02:09.937Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":149}}
2018-08-14T20:02:09.954Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":149,"occupancy":true}'
2018-08-14T20:02:09.972Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":149}}
2018-08-14T20:02:28.596Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":154}}
2018-08-14T20:02:28.613Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":154,"occupancy":true}'
2018-08-14T20:02:28.631Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":154}}
2018-08-14T20:02:30.621Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":127}}
2018-08-14T20:02:30.636Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":127,"occupancy":true}'
2018-08-14T20:02:30.654Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":127}}
2018-08-14T20:02:43.629Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":123}}
2018-08-14T20:02:43.645Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":123,"occupancy":true}'
2018-08-14T20:02:43.678Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":123}}
2018-08-14T20:02:56.255Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":105}}
2018-08-14T20:02:56.271Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":105,"occupancy":true}'
2018-08-14T20:02:56.290Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":105}}
2018-08-14T20:02:58.283Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":118}}
2018-08-14T20:02:58.299Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":118,"occupancy":true}'
2018-08-14T20:02:58.318Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":118}}
2018-08-14T20:03:00.315Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":153}}
2018-08-14T20:03:00.331Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":153,"occupancy":true}'
2018-08-14T20:03:00.350Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":153}}
2018-08-14T20:03:29.980Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":115}}
2018-08-14T20:03:30.021Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":115,"occupancy":true}'
2018-08-14T20:03:30.039Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":115}}
2018-08-14T20:03:52.850Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":112}}
2018-08-14T20:03:52.867Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":112,"occupancy":true}'
2018-08-14T20:03:52.886Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":112}}
2018-08-14T20:04:16.567Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":126}}
2018-08-14T20:04:16.583Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":126,"occupancy":true}'
2018-08-14T20:04:16.600Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":126}}
2018-08-14T20:04:16.725Z - debug: Recieved zigbee message with data {"cid":"msOccupancySensing","data":{"occupancy":1}}
2018-08-14T20:04:16.744Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":126,"occupancy":true}'
2018-08-14T20:04:28.412Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":104}}
2018-08-14T20:04:28.427Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":104,"occupancy":true}'
2018-08-14T20:04:28.463Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":104}}
2018-08-14T20:04:30.440Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":140}}
2018-08-14T20:04:30.454Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":140,"occupancy":true}'
2018-08-14T20:04:30.473Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":140}}
2018-08-14T20:04:32.473Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":153}}
2018-08-14T20:04:32.489Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":153,"occupancy":true}'
2018-08-14T20:04:32.508Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":153}}
2018-08-14T20:04:34.501Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":130}}
2018-08-14T20:04:34.519Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":130,"occupancy":true}'
2018-08-14T20:04:34.537Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":130}}
2018-08-14T20:04:48.091Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":82}}
2018-08-14T20:04:48.110Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":82,"occupancy":true}'
2018-08-14T20:04:48.129Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":82}}
2018-08-14T20:04:50.121Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":102}}
2018-08-14T20:04:50.138Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":102,"occupancy":true}'
2018-08-14T20:04:50.157Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":102}}
2018-08-14T20:04:52.149Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":98}}
2018-08-14T20:04:52.183Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":98,"occupancy":true}'
2018-08-14T20:04:52.205Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":98}}
2018-08-14T20:04:54.178Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":74}}

sensor turned away

2018-08-14T20:04:54.194Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":74,"occupancy":true}'
2018-08-14T20:04:54.212Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":74}}
2018-08-14T20:09:16.755Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":74,"occupancy":false}'

sensor turned to me again and no motion since ~8 minutes

2018-08-14T20:17:27.648Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":108}}
2018-08-14T20:17:27.679Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":108,"occupancy":false}'
2018-08-14T20:17:27.711Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":108}}
2018-08-14T20:17:27.889Z - debug: Recieved zigbee message with data {"cid":"msOccupancySensing","data":{"occupancy":1}}
2018-08-14T20:17:27.913Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":108,"occupancy":true}'
....
2018-08-14T20:25:46.376Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":139,"occupancy":true}'
2018-08-14T20:30:46.385Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":139,"occupancy":false}'

no reaction

2018-08-14T20:41:33.991Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":108}}
2018-08-14T20:41:34.015Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":108,"occupancy":false}'
2018-08-14T20:41:34.047Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":108}}
2018-08-14T20:41:34.203Z - debug: Recieved zigbee message with data {"cid":"msOccupancySensing","data":{"occupancy":1}}
2018-08-14T20:41:34.219Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":108,"occupancy":true}'

#cat configuration.yaml

homeassistant: false
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'
serial:
  port: /dev/serial/by-id/usb-STM32_MapleCUL_6574bcc5-if02
advanced:
  baudrate: 115200
  rtscts: false
  log_level: debug
devices:
  '0x00158d0002006aa6':
    friendly_name: '0x00158d0002006aa6'
    retain: false
    occupancy_timeout: 300

#cat database.db

{"id":2,"type":"EndDevice","ieeeAddr":"0x00158d0002006aa6","nwkAddr":63121,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_motion.aq2","epList":[1],"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":263,"inClusterList":[0,1,3,1024,1030,1280,65535],"outClusterList":[0,25],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genPowerCfg":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genOta":{"dir":{"value":2},"attrs":{}},"msIlluminanceMeasurement":{"dir":{"value":1},"attrs":{}},"msOccupancySensing":{"dir":{"value":1},"attrs":{}},"ssIasZone":{"dir":{"value":1},"attrs":{}},"manuSpecificCluster":{"dir":{"value":1},"attrs":{}}}}},"_id":"CBpQEdXZluddV4S1"}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0018349128","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,8],"status":"online","joinTime":1534271660,"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"3":{"profId":261,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}}},"_id":"G4m1TMhSJZyqMsOS"}
{"$$indexCreated":{"fieldName":"id","unique":true,"sparse":false}}
{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b0018349128","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,8],"status":"online","joinTime":1534276343,"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"3":{"profId":261,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{}}},"_id":"G4m1TMhSJZyqMsOS"}
{"id":2,"type":"EndDevice","ieeeAddr":"0x00158d0002006aa6","nwkAddr":63121,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_motion.aq2","epList":[1],"status":"offline","joinTime":null,"endpoints":{"1":{"profId":260,"epId":1,"devId":263,"inClusterList":[0,1,3,1024,1030,1280,65535],"outClusterList":[0,25],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{}},"genPowerCfg":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genOta":{"dir":{"value":2},"attrs":{}},"msIlluminanceMeasurement":{"dir":{"value":1},"attrs":{}},"msOccupancySensing":{"dir":{"value":1},"attrs":{}},"ssIasZone":{"dir":{"value":1},"attrs":{}},"manuSpecificCluster":{"dir":{"value":1},"attrs":{}}}}},"_id":"CBpQEdXZluddV4S1"}

mark078 avatar Aug 14 '18 20:08 mark078

@mark078 I've never thought of this, but these difference could indeed be explained due to different firmware versions! I'm curious if a firmware update solves this problem.

Koenkk avatar Aug 15 '18 08:08 Koenkk

@Koenkk I'm curious too. Because the two sensors with Lux (RTCGQ11LM) I had never paired with the original bridge before. I only paired the Motion without Lux Sensor (RTCGQ01LM) on the org. xiaomi bridge and it works fine with zigbee2mqtt.

I'll report tomorrow...

Here's something weird from tonight in the log ([0,8],null,null,null,null,0,0,null). Since then, there's been no more motion detection.

2018-08-14T21:01:11.961Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T21:01:11.979Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":true}'
2018-08-14T21:01:12.008Z - debug: Recieved zigbee message with data {"cid":"msIlluminanceMeasurement","data":{"measuredValue":122}}
2018-08-14T21:03:56.633Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false}'
2018-08-14T22:01:21.332Z - warn: Soft resetted zigbee
2018-08-14T22:01:21.373Z - info: zigbee-shepherd ready
2018-08-14T23:01:29.876Z - warn: Soft resetted zigbee
2018-08-14T23:01:30.127Z - info: zigbee-shepherd ready
2018-08-14T23:31:31.597Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,8],"10":0,"11":0,"100":0}}}
2018-08-14T23:31:31.622Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-14T23:31:31.648Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,3005,null,31,5032,33,[0,8],null,null,null,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0]}}
2018-08-15T00:24:15.705Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,5],"10":0,"11":0,"100":0}}}
2018-08-15T00:24:15.719Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T00:24:15.740Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,null,null,null,null,null,[null,5]]}}
2018-08-15T01:17:51.900Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,2],"10":0,"11":0,"100":0}}}
2018-08-15T01:17:51.917Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T01:17:51.941Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,3005,null,31,5032,33,[0,2],null,null,null,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0]}}
2018-08-15T02:12:19.123Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":32,"4":5032,"5":33,"6":[0,3],"10":0,"11":0,"100":0}}}
2018-08-15T02:12:19.137Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T02:12:19.158Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,null,null,32,null,null,[null,3]]}}
2018-08-15T03:06:45.573Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,3],"10":0,"11":0,"100":0}}}
2018-08-15T03:06:45.588Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T03:06:45.612Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,3005,null,31,5032,33,[0],null,null,null,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0]}}
2018-08-15T04:01:16.422Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":30,"4":5032,"5":33,"6":[0,2],"10":0,"11":3,"100":0}}}
2018-08-15T04:01:16.446Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T04:01:16.468Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,null,null,30,null,null,[null,2],null,null,null,null,3]}}
2018-08-15T04:53:53.068Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,2],"10":0,"11":7,"100":0}}}
2018-08-15T04:53:53.083Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T04:53:53.107Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,3005,null,31,5032,33,[0],null,null,null,0,7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0]}}
2018-08-15T05:46:36.664Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":30,"4":5032,"5":33,"6":[0,3],"10":0,"11":20,"100":0}}}
2018-08-15T05:46:36.679Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T05:46:36.711Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,null,null,30,null,null,[null,3],null,null,null,null,20]}}
2018-08-15T06:41:26.971Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,2],"10":0,"11":11,"100":0}}}
2018-08-15T06:41:26.988Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T06:41:27.011Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,3005,null,31,5032,33,[0,2],null,null,null,0,11,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0]}}
2018-08-15T07:36:27.525Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,1],"10":0,"11":13,"100":0}}}
2018-08-15T07:36:27.539Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T07:36:27.562Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,null,null,null,null,null,[null,1],null,null,null,null,13]}}
2018-08-15T08:30:08.719Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":31,"4":5032,"5":33,"6":[0,26],"10":0,"11":26,"100":0}}}
2018-08-15T08:30:08.733Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T08:30:08.754Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,3005,null,31,5032,33,[0,26],null,null,null,0,26,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0]}}
2018-08-15T09:24:46.032Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":{"1":3005,"3":32,"4":5032,"5":33,"6":[0,41],"10":0,"11":34,"100":0}}}
2018-08-15T09:24:46.047Z - info: MQTT publish, topic: 'zigbee2mqtt/0x00158d0002006aa6', payload: '{"illuminance":122,"occupancy":false,"battery":"100.00","voltage":3005}'
2018-08-15T09:24:46.070Z - debug: Recieved zigbee message with data {"cid":"genBasic","data":{"65281":[null,null,null,32,null,null,[null,41],null,null,null,null,34]}}

mark078 avatar Aug 15 '18 10:08 mark078

@mark078 this is some random data from Xiaomi sensors (pretty normal).

Koenkk avatar Aug 15 '18 15:08 Koenkk

@Koenkk Okay and the soft restart is normal, too? Because the sensor stopped responding to movement at all afterwards. :(

Small update.. I paired both motion with Lux sensors to the Xiaomi Bridge and both have been running without problems for about 3 hours. Motion detection works every 5 seconds without any failures. I leave them connected overnight and take them back with me tomorrow and connect them to the CC2530.

photo5449444631491225996 photo5449444631491225997

mark078 avatar Aug 15 '18 16:08 mark078

I didn't notice the soft restart, but this could also cause problems (like in #274).

Could you try changing: https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/controller.js#L14 to const softResetTimeout = 9999999 * 1000; // seconds * 1000..

This should disable the soft restart.

Koenkk avatar Aug 15 '18 18:08 Koenkk

@Koenkk I'll try tomorrow. If you want me to test anything to fix the error, let me know. :) I would rather use zigbee2mqtt than the xiaomi cloud solution.

The rest like xiaomi switches, motion without lux sensor and cube works very well!

mark078 avatar Aug 15 '18 19:08 mark078

@mark078 ok great, let me know the result. Was there any firmware update available for the motion sensors?

Koenkk avatar Aug 15 '18 20:08 Koenkk

Hey @Koenkk , not good news. I didn't see an update in the Mi Home app, there was only one for the Yeelight bulb. I had paired the motion sensor at Xiaomi bridge for about 16 hours.

I paired the motion sensor to zigbee2mqtt again. Unfortunately, the behaviour has not changed. :-(

It detects motion for a few minutes, then at some point it only transmits light values and then it no longer reacts at all for a long time. I also paired the cube and it continues to respond. There's only problem with the motion sensor with Lux.

I adjusted the controller.js (with a 9 less) and tried to set the channel to 14, but that didn't help.

My firmware for CC2530 is from ptvo: http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/ Because the FW from here (CC2530ZNP-Pro-Secure_LinkKeyJoin.hex) doesn't start zigbee2mqtt: zigbee-shepherd:init Coordinator initialize had an error: Error: request timeout P20 is connected to GND.

mark078 avatar Aug 16 '18 13:08 mark078

@mark078 could you try this firmware: https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/CC2530/bin

Koenkk avatar Aug 16 '18 17:08 Koenkk

@Koenkk this firmware doesn't work, I tried it on two different CC2530s: https://de.aliexpress.com/item/CC2530-Zigbee-Module-UART-Wireless-Core-Board-Development-Board-CC2530F256-Serial-Port-Wireless-Module-2-4GHz/32767470382.html

I have flashed this several times...

Pics: https://www.dropbox.com/sh/ud0mx1igu9df0r5/AACqJfgwPYGdGam42xi5iCqSa?dl=0

Zigbee2mqtt start with CC2530ZNP-Prod.hex FW:

> [email protected] start /opt/zigbee2mqtt
> node index.js

2018-8-16 19:50:53 DEBUG Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[14]},"dbPath":"/opt/zigbee2mqtt/data/database.db","sp":{"baudrate":115200,"rtscts":false}}'
2018-8-16 19:50:54 INFO Starting zigbee2mqtt version 0.1.2 (commit #7dd1c75)
2018-8-16 19:50:54 INFO Starting zigbee-shepherd
  zigbee-shepherd:init zigbee-shepherd booting... +0ms
  zigbee-shepherd:request REQ --> SYS:osalNvRead +198ms
  zigbee-shepherd:request RSP <-- SYS:osalNvRead +3s
  zigbee-shepherd:init Coordinator initialize had an error: Error: request timeout
    at CcZnp.<anonymous> (/opt/zigbee2mqtt/node_modules/cc-znp/lib/ccznp.js:254:22)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at CcZnp.emit (events.js:211:7)
    at Timeout.<anonymous> (/opt/zigbee2mqtt/node_modules/cc-znp/lib/ccznp.js:233:18)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5) +38ms
2018-8-16 19:50:58 INFO Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
2018-8-16 19:51:58 INFO Starting zigbee-shepherd
  zigbee-shepherd:init zigbee-shepherd booting... +1m
  zigbee-shepherd:request REQ --> SYS:osalNvRead +34ms
  zigbee-shepherd:request RSP <-- SYS:osalNvRead +3s
  zigbee-shepherd:init Coordinator initialize had an error: Error: request timeout
    at CcZnp.<anonymous> (/opt/zigbee2mqtt/node_modules/cc-znp/lib/ccznp.js:254:22)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at CcZnp.emit (events.js:211:7)
    at Timeout.<anonymous> (/opt/zigbee2mqtt/node_modules/cc-znp/lib/ccznp.js:233:18)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5) +11ms
2018-8-16 19:52:01 ERROR Error while starting zigbee-shepherd!
2018-8-16 19:52:01 ERROR Press the reset button on the stick (the one closest to the USB) and start again
2018-8-16 19:52:01 ERROR Failed to start
        {"message":"request timeout","stack":"Error: request timeout\n    at CcZnp.<anonymous> (/opt/zigbee2mqtt/node_modules/cc-znp/lib/ccznp.js:254:22)\n    at Object.onceWrapper (events.js:315:30)\n    at emitOne (events.js:116:13)\n    at CcZnp.emit (events.js:211:7)\n    at Timeout.<anonymous> (/opt/zigbee2mqtt/node_modules/cc-znp/lib/ccznp.js:233:18)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)"}

With the ptvo FW it works.

> [email protected] start /opt/zigbee2mqtt
> node index.js

2018-8-16 19:47:44 DEBUG Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[14]},"dbPath":"/opt/zigbee2mqtt/data/database.db","sp":{"baudrate":115200,"rtscts":false}}'
2018-8-16 19:47:45 INFO Starting zigbee2mqtt version 0.1.2 (commit #7dd1c75)
2018-8-16 19:47:45 INFO Starting zigbee-shepherd
  zigbee-shepherd:init zigbee-shepherd booting... +0ms
  zigbee-shepherd:request REQ --> SYS:osalNvRead +192ms
  zigbee-shepherd:request RSP <-- SYS:osalNvRead, status: 2 +387ms
  zigbee-shepherd:init Non-Volatile memory is changed. +46ms
  zigbee-shepherd Starting a hardware reset... +21ms
  zigbee-shepherd:request REQ --> SYS:resetReq +16ms
  zigbee-shepherd:msgHdlr IND <-- SYS:resetInd +899ms
  zigbee-shepherd:request RSP <-- SYS:resetReq +6ms
...

mark078 avatar Aug 16 '18 18:08 mark078

@kirovilya do you know what could cause the CC2530 firmware not to work?

Koenkk avatar Aug 16 '18 18:08 Koenkk

@mark078 could you try this firmware: https://raw.githubusercontent.com/kirovilya/files/master/CC2530ZNP-Pro-Secure_LinkKeyJoin.hex (it is first FW that work for me) if it works, then I will try to find new build parameters...

Sometimes helps wire P05 and P04 to GND (and P20 too).

kirovilya avatar Aug 16 '18 18:08 kirovilya