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

ZY-M100-S_1 sensors report every second #19045

Open
seblu opened this issue Sep 21, 2023 · 196 comments
Open

ZY-M100-S_1 sensors report every second #19045

seblu opened this issue Sep 21, 2023 · 196 comments
Labels
problem Something isn't working

Comments

@seblu
Copy link

seblu commented Sep 21, 2023

What happened?

The Tuya ZY-M100-S_1 (_TZE204_sxm7l9xa) is reporting its values every second. This values can or can not changes.

Here is an example with values not changing:
Screenshot_20230921_231622

What did you expect to happen?

A delay or minimal value change that can be configured in the Reporting tab.

How to reproduce it (minimal and precise)

Pair the sensor and it starts sending data every second or 2.

Zigbee2MQTT version

1.33.0

Adapter firmware version

20221226

Adapter

Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001

Debug log

debug 2023-09-21 23:20:33: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":6912}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:33: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:33.910Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:35: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":7168}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:35: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:35.506Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:37: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":7424}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:37: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:37.101Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:38: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":7680}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:38: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:38.697Z","linkquality":102,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:40: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":7936}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:40: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:40.293Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:41: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":8192}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:41: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:41.889Z","linkquality":109,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:43: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":8448}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:43: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:43.684Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:45: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":8704}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:45: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:45.081Z","linkquality":102,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:46: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":8960}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:46: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:46.674Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:48: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":9216}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:48: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:48.272Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:49: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":9472}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:49: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:49.866Z","linkquality":109,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:51: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":9728}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:51: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:51.462Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:53: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":9984}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:53: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:53.058Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:54: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":10240}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:54: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:54.653Z","linkquality":105,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'
debug 2023-09-21 23:20:56: Received Zigbee message from 'Toilet Presence', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":109}],"seq":10496}' from endpoint 1 with groupID 0
info  2023-09-21 23:20:56: MQTT publish: topic 'zigbee2mqtt/Toilet Presence', payload '{"detection_delay":0,"fading_time":5,"illuminance_lux":3,"last_seen":"2023-09-21T21:20:56.250Z","linkquality":109,"maximum_range":1.95,"minimum_range":0.75,"presence":false,"radar_sensitivity":0,"target_distance":0}'

@seblu seblu added the problem Something isn't working label Sep 21, 2023
@Koenkk
Copy link
Owner

Koenkk commented Sep 23, 2023

This is a TuYa device, these doesn't support to configure reporting. AFAIK there is no way to reduce the reporting interval for these kind of TuYa devices.

@adiov
Copy link

adiov commented Sep 25, 2023

I have the same problem, and I suspect it's the reason for my Zigbee network performance issues. Ever since I added ZY-M100-S_1 to the network, I've been noticing lags and slower response times.

I bought 3 identical TuYa mmWave radar human presence sensor from the same AliExpress listing, and when I paired them they were recognised by Zigbee2MQTT as 2 ZY-M100-L devices and 1 ZY-M100-S_1 device. The noisy, repeated messages are mostly coming from ZY-M100-S_1.

I suspect that the suppliers are mixing different hardware revisions in the same inventory. My solution is to buy a couple of these sensors from different AliExpress listing until I hit ZY-M100-L again, and replace the noisy ZY-M100-S_1 with it.

@bsaurusrex
Copy link

Having the same issues and it is crashing my network. About 50% of my ZY-M100-L are joining as S_1 devices and reporting every second.
Next steps: remove all the S_1 revisions and see if I can get stability with only the -L on the network.
Alternative: I might try to convert them to ESPhome/wifi: https://blakadder.com/replace-tuya-esp12/

@Faraday76
Copy link

I have the same problem, the sensor overloads the network and every 1 second it communicates this information.
I'm also looking for an "L" type version but how can I be sure before buying, there is generally not this information on the AliExpress seller's sheets.
It's a shame because it seems to be very precise for me.

@adiov
Copy link

adiov commented Nov 4, 2023

I spent a few weeks sifting through several of these sensors, and the "L" type seems to not exist anymore as I suspect it's now an older hardware revision. I gave up on it and replaced one of my offending sensors with the WiFi equivalent. Unfortunately, I have one outside the WiFi range that will have to keep being noisy on the Zigbee network until something new comes to market or there's a firmware update for it.

@Faraday76
Copy link

ok thank you very much for your information.
I'm going to do like you, that is to say buy the wifi version.
I think a lot of people will want to know why their network is unstable and slow because of this sensor.

@jpettitt
Copy link

I had 7 of these on my network and it was crashing (all devices unavailable, z2m UI non-responsive) regularly. I removed all but one and I'm back to stability.

@RikJ01
Copy link

RikJ01 commented Nov 23, 2023

Having the same issues and it is crashing my network. About 50% of my ZY-M100-L are joining as S_1 devices and reporting every second. Next steps: remove all the S_1 revisions and see if I can get stability with only the -L on the network. Alternative: I might try to convert them to ESPhome/wifi: https://blakadder.com/replace-tuya-esp12/

Any luck with converting to ESPhome? I can only find replacement guides on the WBR3 module (the WiFi version of this sensor) and not the ZT3L chip (Zigbee version).

@adiov
Copy link

adiov commented Nov 23, 2023

Any luck with converting to ESPhome? I can only find replacement guides on the WBR3 module (the WiFi version of this sensor) and not the ZT3L chip (Zigbee version).

Follow the same procedure. All 3 comms modules (WBR3, ZT3L, and ESP-12) support UART for talking with the mmwave module, and all 3 have the same pin layout for the pins you care about (UART TX/RX, VCC, and so on). The result should be identical whether you start with the Zigbee version or the WiFi version.

Let us know how it goes for you.

@bsaurusrex
Copy link

bsaurusrex commented Nov 24, 2023

Has anyone tried the new 24Ghz in ceiling zigbee models to see if they have the same problem?

@jpettitt
Copy link

Has anyone tried the new 24Ghz in ceiling zigbee models to see if they have the same problem?

Yes and yes. Same behavior in terms of once a second update, I won't install the ceiling sensor becasue the mains 110/220 connection is dangerous (connectors with no strain relief and inadequate separation, poor isolation of low and high voltage components). It's a fire waiting to happen.

I've just bough 2 athom esphome sensors to play with which are wifi, have both PIR and MM Wave and so far work great. They run on 5v usbc. and the connector is on the back so if you ceiling mount them it's invisible.

@JanHACS
Copy link

JanHACS commented Dec 1, 2023

I have exactly the same problem here, my ZY-M100-S_1 is reporting every second, apart from that works perfectly, but obviously is not very good for the zigbee network.

I have seen that there is a possible update of this wall sensor called WZ-M10024, anybody tested?

@pmrosa
Copy link

pmrosa commented Dec 10, 2023

Using the 24G (both ceiling and non-ceiling) that are identified as ZY-M100-24G (_TZE204_ijxvkhd0) on zigbee2mqtt and are spanning the zg network every second.
Since i'm using a cheap CC2531 with >60 devices on the network, i was suspecting that the problems were arriving soon, thats why i was looking into the sky connect from home assistant. Should it be more stable? Any feedback?

@rhuss
Copy link
Contributor

rhuss commented Dec 17, 2023

I'm using a WZ-M100-W (Wenzhi Human presence sensor) and have the very same issue as described in #20261 (and probably also in #17824 ). 'guess it's all the same firmware anyways.

@rhuss
Copy link
Contributor

rhuss commented Dec 18, 2023

For the WZ-M100-W it's also spamming when there is no presence detected, every 0.5 seconds a MQTT message is created. See the log example in #20261

@adiov
Copy link

adiov commented Dec 18, 2023

At the bottom of the ZT3L board, there's an SWS pad, allowing it to be flashed with custom firmware using the Single Wire interface. I got a suitable programmer from AliExpress, which was a little pricey for what it does.

After some intense desoldering and soldering, I successfully dumped the firmware out of the ZY-M100-L's ZT3L board and flashed it on the noisy ZY-M100-S_1 one. That didn't change the noisy behaviour, which tells me the bug isn't there.

I don't quite understand this sensor's architecture, but the only remaining place is the MCU on the 4th board, which is the one directly connected to the mmwave sensor. It's an ARM Cortex M23 chip. If somebody knows how to dump and flash its firmware, we can try to revert it back to the older firmware and see if that fixes the issue.

arm

My worry is this approach is way too coarse, and it's possible the older firmware wouldn't work with the newer daughterboards in the newer version of the firmware.

@rhuss
Copy link
Contributor

rhuss commented Dec 18, 2023

It's a pity that this is so difficult. I wonder whether there is a way to get the configuration detection_delay set to 10 (the documented maximum, default is 0.5 s) and be honored. I don't know how this configuration can be set so that it is taken over. According to https://www.zigbee2mqtt.io/devices/WZ-M100-W.html this should work e.g. with mosquitto_pub ... 'zigbee2mqtt/motion_human_presence_1/set' -m '{"detection_delay": 10.0}', but it doesn't. See #20261 for more info.

@esj006
Copy link

esj006 commented Jan 15, 2024

Hello everyone,

I wanted to provide an update on the ZY-M100-S_1 sensor's excessive reporting issue. After contacting Tuya, it's evident that the device's frequent reporting is governed by the MCU's firmware, developed using the Tuya MCU SDK. Tuya's module, part of this setup, does not fully support the standard Zigbee 3.0 protocol and is mainly for data transmission.

This clarifies that resolving the issue is beyond Tuya's direct scope, as they only supply the networking module, not the device firmware. Consequently, any changes to the reporting frequency would require modification at the firmware level, controlled by the developers who created it. Unfortunately, Tuya could not provide contact details for these developers, suggesting we reach out to the device suppliers or check for contact information on the product packaging.

For those interested in a deeper technical dive, Tuya referenced their Zigbee MCU SDK protocol, which might offer more insight into how their modules work: Tuya Zigbee MCU SDK Protocol.

@jvdburgt
Copy link

Thank you for these insights. I have spent the last two weeks trying to figure out what was wrong with the network in my new apartment, starting to setup home assistant from scratch multiple times. I have 9 of these sensors, and the network kept failing when more than 5 of these sensors were included.

I solved the issue for now by creating a second zigbee network (a Z2M besides the already existing ZHA network) and dumping all the sensors on there. It seems to work (for now). But a more direct solution to the problem (lower update frequency / less chatter) is of course preferable, and it seems this necessarily has to be done via the firmware route (switching to another sensors is not really a viable option for me, because I prepared all the in-ceiling sensors in my new apartment).

Is there any way for a custom firmware, or can it only come from the developers? I really hope there is a solution, because - besides the spamming by these sensors - they work great!

@rhuss
Copy link
Contributor

rhuss commented Jan 15, 2024

Besides spamming the Zigbee network, directly forwarding all messages as MQTT messages also spams the computer network. One could reduce the frequency of issues MQTT messages, e.g., if there have been any changes? I think, this should be possible on the Zigbee2Mqtt handler level.

@adiov
Copy link

adiov commented Jan 16, 2024

Besides spamming the Zigbee network, directly forwarding all messages as MQTT messages also spams the computer network.

I would probably not worry about the MQTT side of this issue. For MQTT server running on the same machine that runs Zigbee coordinator, it's all cheap operations in memory and occasional disk commits. It's peanuts in terms of the overall level of activity of your Home Assistant setup. For MQTT server running on another machine, the TCP protocol is more than capable of handling frequent transmissions at pretty much any data rate, and the same applies to the physical layers (Ethernet and WiFi). I don't think any component in your system or network even notices them.

I guess in theory I could see those additional MQTT messages being unnecessary spam, but architecting and writing code and tests to rate limit them is probably way too costly compared to the benefit.

The biggest issue is the spam on the Zigbee network. It's way more vulnerable to this problem. If you have 2-3 misbehaving devices like this, they can really clog up the Zigbee network, cause lags and delays. When I had 3 of those senors in my network, doing firmware OTA on any of my other Zigbee devices was basically out of the question.

@bsaurusrex
Copy link

bsaurusrex commented Jan 16, 2024

Anyone able to find any guides on dumping the firmware and modifying it? I have a ton of these devices.

At the same time, I ordered a 24Ghz model (MTG235-ZB-RL) with the local switched relay. It is significantly higher quality and a lot safer. It has a power line tie down and plastic cover to protect the power wire screw terminals. Pending installation this week.

@jvdburgt
Copy link

Anyone able to find any guides on dumping the firmware and modifying it? I have a ton of these devices.

At the same time, I ordered a 24Ghz model (MTG235-ZB-RL) with the local switched relay. It is significantly higher quality and a lot safer. It has a power line tie down and plastic cover to protect the power wire screw terminals. Pending installation this week.

Curious if the TS0225 sensor your getting is any different (in terms of chattiness). Can’t find a lot of info on it, so look forward to your update on that.

@bsaurusrex
Copy link

bsaurusrex commented Jan 16, 2024

Additionally, the 24Ghz model moved the re-pairing button to the front of the unit so that it is not required to pull the unit out of the ceiling and risk getting shocked.

As for testing, the original model is spamming every 1-2 seconds whereas this 24Ghz model is bursty at random. Sometimes no updates for up to 1 minute apart and other times it will send 3 messages a few seconds apart.

The is a difference in the size though. This model is 60mm wide instead of 55mm.

https://www.aliexpress.com/item/1005006102760484.html?spm=a2g0o.order_list.order_list_main.24.579d18021ch3hM

@jvdburgt
Copy link

And with “at random” you mean when there is no presence detected?

Overall, the way you describe it, it seems like less messages per minute though, correct?

@bsaurusrex
Copy link

Even when presence is detected, the messages from this new model are much less frequent.

I don't see any impact on accuracy. While it has only been installed for 12 hours, the presence history looks perfect.

@cangaroo82
Copy link

cangaroo82 commented Jan 25, 2024

It's not a detection problem but it's actually the zigbee chip that transmits fast
I tried deleting the sensors but nothing changed

I bought 20 zy-m100-v1.4 to put on the same network with 40 other devices, the network collapsed almost immediately
Z2M restarts

I thought of a drastic solution
if we added an external timer that reset the ZT3L chip

silent for 4 seconds
it restarts and talks for 2seconds
by trying empirically he makes a communication

https://www.google.com/aclk?sa=l&ai=DChcSEwiWweTBmviDAxV5kmgJHTrBAxEYABADGgJ3Zg&gclid=EAIaIQobChMIlsHkwZr4gwMVeZJoCR06wQMREAQYAiABEgLQBfD_BwE&sig=AOD64_3ig1-E7qMxFLqak9DkC-0Dllz6NA&adurl&ctype=5&ved=2ahUKEwjmzNPBmviDAxV8g_0HHf0CCAEQvhd6BAgBEFg&nis=8

https://futuranet.it/prodotto/micro-modulo-timer-programmabile-2-secondi-1000-ore/

Already ordered, I'll try as soon as they arrive

do you think damage could be caused with all these resets
Any suggestions are welcome

@kkossev
Copy link

kkossev commented Jan 25, 2024

I bought 20 zy-m100-v1.4 to put on the same network with 40 other devices,

Put the spammy mmWave radars on a separate Zigbee network ... Just add a second Zigbee dongle.

@cangaroo82
Copy link

that's 20 spam radars talking over each other all the time

@jvdburgt
Copy link

jvdburgt commented Oct 4, 2024

Okay, I decided I will give it a go, but I'm a bit lost about exactly what to order. I see various J-Link and USB-stick options. Can someone post the link to AE versions that are guaranteed to work? And do I also need to order other peripherals, like the cables, or are they included?

In other words: I need a shopping list ;)

@walberjunior
Copy link

Okay, I decided I will give it a go, but I'm a bit lost about exactly what to order. I see various J-Link and USB-stick options. Can someone post the link to AE versions that are guaranteed to work? And do I also need to order other peripherals, like the cables, or are they included?

In other words: I need a shopping list ;)

I use this:

https://pt.aliexpress.com/item/1005006998022759.html?spm=a2g0o.order_list.order_list_main.17.b7a8caa42TecOY&gatewayAdapt=glo2bra

@jvdburgt
Copy link

jvdburgt commented Oct 4, 2024

Okay, I decided I will give it a go, but I'm a bit lost about exactly what to order. I see various J-Link and USB-stick options. Can someone post the link to AE versions that are guaranteed to work? And do I also need to order other peripherals, like the cables, or are they included?
In other words: I need a shopping list ;)

I use this:

https://pt.aliexpress.com/item/1005006998022759.html?spm=a2g0o.order_list.order_list_main.17.b7a8caa42TecOY&gatewayAdapt=glo2bra

Great thank you! I see only the ST-Link v2 here, though. What about the J-Link, and the pinned cables I need to connect to the sensor module?

Or is only the ST-link v2 needed? Now I'm confused, I thought the J-Link was also required. but in @tandarra guide only the ST-link v2 is mentioned... Can anyone calrify please.

@kenni
Copy link

kenni commented Oct 4, 2024

@jvdburgt A ST-Link v2 (clone or original) dongle and some male<->female dupont wires are all you need. You do not need to solder the wires, they only need to have good contact for ~5 seconds while flashing.

ST-Link v2 clone:
https://a.aliexpress.com/_Ewizxk5

Dupont wires male<->female:
https://a.aliexpress.com/_EGtBG8h

@jvdburgt
Copy link

jvdburgt commented Oct 4, 2024

Awesome, many thanks!

@walberjunior
Copy link

@jvdburgt
20240919_142727
20240919_142639

I used some wire jumpers and a female PCB connector that came with some esp32 I bought.

@mitchins
Copy link

mitchins commented Oct 6, 2024

I've just bought the devices and am attempting to read this thread.
Could someone please tell me if there's a current guide to the state of these?
From what I can tell some of the models may have firmware updates available that ameliorate the issue that require manual flashing via an ST-Link V2.

@jonathanathe
Copy link

jonathanathe commented Oct 7, 2024

@java-devil I'll try my best to run through the steps I used. Unsure if everything was needed but this is how I got my one to work.

First connect them to zigbee2mqtt to see what model you have to confirm which firmware you need

zigb2mqtt

Follow @Andrik45719 github guide - https://github.com/Andrik45719/ZY-M100

Mods:

  • Target distance (DP: 9) reporting disabled.
  • Settings report interval (DPs: 1, 4, 2, 3, 6, 101, 102, 103, 104) increased to 60s, stock FW 10s.
  • Illuminance Lux report interval (DP 104) increased to 10s, stock FW 500ms

Suppoted models: as of 20/09/24

  • ZY-M100_L (_TZE204_ztc6ggyl)
  • ZY-M100-S_1 (_TZE204_sxm7l9xa, _TZE204_e5m9c5hl)
  • ZY-M100-S_2 (_TZE204_qasjif9e)
  • ZY-M100-24G (_TZE204_ijxvkhd0)
  • ZY-M100-24GV2 (_TZE204_7gclukjs)

I assume the binaries first came from Andrik backing them up, reading them and modifying them to suit, other models possibly have been assisted from other members such as @jgarridoalcazar submitting them also, I don't want to assume what is going on, but I certainly appreciate everyone's input to get us here so far. https://github.com/Andrik45719/ZY-M100/issues/4

  • Download and install MSYS2 - https://www.msys2.org/
  • I ran into an issue installing and had to manually create these four folders - C:\Windows\System32\drivers\etc

four folders

  • Run msys2 and enter "pacman -Sy mingw-w64-86_64-openocd" to install OpenOCD

msys2-openocd

zadig

  • Download libusb drivers and put libusb-1.0.dll into mingw64 library - C:\msys64\mingw64\lib
    (Unsure if this was actually needed as files look similar, I just had stumbled across someone else doing this online)

libusb

  • Connect your device as per below
  • Blue - 3.3V, Green - GND, Purple - SWDIO, Orange - SWCLK (If it doesn't connect swap Purple and orange around. Power and GND should* always be those first two pads)

IMG202409200016491 yhiub1z1 7stymrc5

  • From here we try backup original firmware using Command Prompt and using "openocd -f interface/stlink-v2.cfg -f target/gd32e23x.cfg -c init -c "reset halt" -c "flash read_bank 0 ZY-M100_L.bin" -c "reset" -c shutdown"

backup

  • Find where it saved the back up for me was - C:\Users\Kurt

backup1

  • Download correct firmware for your device and rename it to "ZY-M100_L-TargetDistance_disable"

userbin

  • Now we flash using "openocd -f interface/stlink-v2.cfg -f target/gd32e23x.cfg -c init -c "reset halt" -c "flash erase_sector 0 0 last" -c "flash write_bank 0 ZY-M100_L-TargetDistance_disable.bin" -c "flash verify_bank 0 ZY-M100_L-TargetDistance_disable.bin" -c "reset" -c shutdown"

flashfi

  • Should Write the bin firmware, then read and verify it to confirm it was successful.
  • Then power it back on and take a look at how its operating in Zigbee2mqtt

As @jgarridoalcazar mentioned, I just did a spare device whilst writing this out and didn't solder the pin to the pads just had the jumper pins sitting there under its own tension and worked, super easy.

You mean you don't have physical access to the devices as they are still in the ceiling? Just turn the breaker off to the power and remove them, honestly procrastinating and waiting for an OTA fix will take longer than doing. It seems daunting but should be fairly straightforward now you can follow along.

Mine were installed in the ceiling also so I can understand the frustration and you're right an OTA update would be amazing; I just didn't have the patience to wait while having so many issues on my zigbee network

I encourage everyone to critic my steps, more than happy to learn a better way of doing something and make it easier for the next person.

Change made to my 6 devices ZY-M100-S_2_TZE204_qasjif9e: I can tell that the drop in calls has drastically reduced, but before confirming that it works, I want to wait a bit more than a week since, on many occasions, my Zigbee network didn’t drop immediately, and I want to check its stability.

Thank you very much!

@thargy
Copy link

thargy commented Oct 7, 2024

Hi, I have now moved from 20 _TZE204_ztc6ggyl on a single dedicated network to 26, split evenly across 2 networks, each with ~100 devices on them. I have a a mixture of wall mounted and ceiling mounted versions.

Some observations:

  • I could not get pacman to install OpenOCD - however, I just downloaded OpenOCD from it's releases page. The .tar.gz file already contained a windows executable in the bin directory (once unzipped), so I'm not sure it's even necessary to install msys.
  • The wall-mounted versions require a tiny hex bit (1.5mm) to open, I have one in an iFixit kit because I do a lot of electronics, others may not.
  • The ceiling-mounted version requires a 'PH0' bit (so small Philips screwdriver), which is more common. Again, an iFixit kit has them if you don't.
  • When taking the ceiling mounted version apart, unscrew the back and remove one of the spring loaded grips, the circuit will then fall out easily.
  • I found holding the board and putting slight pressure on the pins whilst executing the flash command gave me a 100% success rate on reflashing.
  • Make sure you re-pair and test the sensor with z2m before putting back in the ceiling (I didn't get one failure after flashing)!
  • When you initially restore a sensor after power outage, you sometimes need to trigger the sensor and leave again before it starts to record presence correctly (e.g. it can start stuck in an on or off state). I think that when you first power up (particularly if it was previous in an on state) it needs to 'see' the difference between presence and no presence before it starts working properly. Once done for the first time, it seems to be fine afterwards. Note, I experienced this behaviour before the firmware update so that's not related to this issue - just don't panic when you first power up if it happens.
  • My largest network (currently 127 devices) is running on mini-PC and is the most reliable, despite being under the heaviest load. My smaller network (currently 90 devices) is running on a Rasberry Pi and has been failing most frequently. Usually, it starts reporting failed (SRSP - AF - dataRequest after 6000ms)) errors before my HAOS automation detect that it is no longer sending regular messages and initiates a remote reboot. So if you're running larger networks, probably don't rely on a Pi. [Ninja Edit: I forgot about this issue, and sure enough my Pi had USB autosuspend enabled, I've disabled and hope it will address the reliability issues).
  • Zigbee 3.0 requires the coordinator to know about every device on it's network, due to memory limitations this means most co-ordinates have a hard limit of 200 devices - despite it being a mesh network. I have run z2m reliably on the mini-PC HAOS addon with 197 devices - so long as they're not chatty.

I also tested one of the newer _TZE204_ya4ft0w4, which is supposed to fix the 'issues' by providing a switch for distance reporting. Frankly, the older devices with this firmware are significantly better, which provides a bit of a dilemma when you're trying to source the correct solution.

This is a significant step forward after a year of presence sensor hell, so thank you @Andrik45719. Longer term it would be nice to crack the OTA approach as it is frankly dangerous replacing ceiling sensors for many people. Other features that would be nice:

  • Back port a distance reporting switch to all devices.
  • Add configs for the various timeouts to allow people to tweak dynamically.
  • Implement OTA - this will need the version to be updated by the firmware.
  • Have them respect removal from the network and automatically enter re-pairing mode when no longer paired (pressing the button on the ceiling mounted sensors is a huge burden)

However, that's a lot more work than just changing some of the default values already encoded in the existing firmware.

For now, my sincere thanks!

@Andrik45719
Copy link

ZY-M100-24GV3_TZE204_ya4ft0w4_increased_report_interval

@JackTalisker
Copy link

JackTalisker commented Oct 10, 2024

I want to thank @tandarra for the really useful starting point he gave with his post, btw I have to clarify some details to help those who want to try their hand:

  • Since pacman was unable to find the package, the right command to install openocd with MSYS2 MSYS is "pacman -Sy mingw-w64-x86_64-openocd" (there was an "x" missing);
  • In my case the 4 directories Tandarra missed are 4 files that where correctly created by the installer;
  • To run openocd I had to launch it with MSYS2 MINGW64 (because openocd is a Mingw-w64 executable);
  • In my kind of setup the backupped bin file went to C:\msys64\home\YourUser (you have to copy there the new modified bin file as well).

Now a big thank you to @Andrik45719 for giving us the modified firmware!
I was finally able to flash my _TZE204_ijxvkhd0

@tandarra
Copy link

Cheers, updated the spelling mistake in pacman command.

@jvdburgt
Copy link

@JackTalisker and @tandarra : many thanks and perfect timing! My ST-Link v2 should arrive tomorrow and I'll get to it immediately 😬

@JackTalisker
Copy link

@Andrik45719
As I wrote yesterday here I successfully flashed your "TagetDistance_disabled" fw to my _TZE204_ijxvkhd0 and there is a a significant reduction in mqtt messages, especially those about distance that used to arrive every second (now suppressed) but there is a behaviour which (imho) is really weird (this happened with original fw too).
The device instead of sending one mqtt state message about every minute, it sends from 8 to 12 message at a time (screenshot below).

Is there a way to correct it?
Thank you for your patience.
Screenshot 2024-10-11 094132

@begemotik
Copy link

I have a similar problem with Moes BHT-002/BHT-006 Thermostat. It seems that it uses the same chip inside. Is there any chance some similar setting might be applied for it as well?

@thargy
Copy link

thargy commented Oct 11, 2024

@Andrik45719 As I wrote yesterday here I successfully flashed your "TagetDistance_disabled" fw to my _TZE204_ijxvkhd0 and there is a a significant reduction in mqtt messages, especially those about distance that used to arrive every second (now suppressed) but there is a behaviour which (imho) is really weird (this happened with original fw too). The device instead of sending one mqtt state message about every minute, it sends from 8 to 12 message at a time (screenshot below).

I've noticed a lot spamming of identical message as well. The issue is the current fix is just some tweaks of timeouts, addressing unnecessary spam messages directly would require recoding which I'm not sure is as easy.

@mremedi2023
Copy link

mremedi2023 commented Oct 11, 2024 via email

@thargy
Copy link

thargy commented Oct 11, 2024

I want to thank @tandarra for the really useful starting point he gave with his post, btw I have to clarify some details to help those who want to try their hand:

  • Since pacman was unable to find the package, the right command to install openocd with MSYS2 MSYS is "pacman -Sy mingw-w64-x86_64-openocd" (there was an "x" missing);
  • In my case the 4 directories Tandarra missed are 4 files that where correctly created by the installer;
  • To run openocd I had to launch it with MSYS2 MINGW64 (because openocd is a Mingw-w64 executable);
  • In my kind of setup the backupped bin file went to C:\msys64\home\YourUser (you have to copy there the new modified bin file as well).

Now a big thank you to @Andrik45719 for giving us the modified firmware! I was finally able to flash my _TZE204_ijxvkhd0

If you download OpenOCD from it's releases page. The .tar.gz can be unzipped and you will find a windows executable in bin\openOCD.exe.

Open a terminal window and navigate to the bin directory and then you can execute the command directly:

e.g. from a Powershell terminal:

./openocd.exe -f interface/stlink.cfg -f target/gd32e23x.cfg -c init -c "reset halt" -c "flash read_bank 0 ZY-M100-{YOUR MODEL}.bin" -c "reset" -c shutdown

You do not need to install msys2 for it to work, and this is a much easier way of doing it on Windows. I've updated well over 20 devices using this method so far. At least I certify it as 'Tested as Works 4 Me ® ™' 🤣

@JackTalisker
Copy link

If you download OpenOCD from it's releases page. The .tar.gz can be unzipped and you will find a windows executable in bin\openOCD.exe.

Open a terminal window and navigate to the bin directory and then you can execute the command directly:

e.g. from a Powershell terminal:

./openocd.exe -f interface/stlink.cfg -f target/gd32e23x.cfg -c init -c "reset halt" -c "flash read_bank 0 ZY-M100-{YOUR MODEL}.bin" -c "reset" -c shutdown

You do not need to install msys2 for it to work, and this is a much easier way of doing it on Windows. I've updated well over 20 devices using this method so far. At least I certify it as 'Tested as Works 4 Me ® ™' 🤣

I've already had MSYS installed for other reasons but your advice will help who is going to start from scratch 👌

@jonathanathe
Copy link

Change made to my 6 devices ZY-M100-S_2_TZE204_qasjif9e: I can tell that the drop in calls has drastically reduced, but before confirming that it works, I want to wait a bit more than a week since, on many occasions, my Zigbee network didn’t drop immediately, and I want to check its stability.

Thank you very much!

Honestly, very happy, and the sensors are still working perfectly. Thank you.

@mindtripper
Copy link

Using @tandarra steps I was able to successfully firmware update two TS0601_TZE204_ijxvkhd0 and three TS0601_TZE204_sxm7l9xa. Using ST-Link V2 clone and a DuPont Wire Kit. No soldering. Just plugged them in the holes on the board. Worked on 5 out of 5 without issues.

The devices have been moved back to my primary ZigBee network and it is stable.

Thank you @tandarra!

@jvdburgt
Copy link

jvdburgt commented Oct 15, 2024

Okay guys (and gals), I can't believe how easy that was!

I mean, standing on your shoulders with you having done all the hard work. But I have to say that the instructions come across as way scary and complex (at least for a n00b like me), while in reality I set it up and executed it on multiple devices in mere minutes.

To whomever is doubting whether to do this: climb on the shoulders of the giants who went before us, honestly it's a breeze :)

@thargy
Copy link

thargy commented Oct 16, 2024

I have now updated multiple types of sensor, in both ceiling and wall. I've noticed that the newer sensors have had several improvements made, including a cover over where the ceiling reset button used to be exposed, and an additional led on the wall mounted sensor. Also some of the ceiling sensors now use standard Philips screws.

For the ZY-M100-S_2_TZE204_qasjif9e and ZY-M100-24GV3_TZE204_ya4ft0w4 ceiling sensors (both 5 & 24 GHz), I noted that the original JTAG pins are no longer in the same place, nor is the vertical daughter board. Instead, 4x 2mm holes (instead of the usual 2.54mm) can be found on the very bottom of the board:

IMG_0324

I used some right angle pins to allow me to get a good grip and reduce the spacing.

Note the order is also different, with SWCLK and SWDIO swapped from the older models:

Hole Connection
Sqaure 3.3V
2 Ground
3 SWClk
4 SWDIO

The same model wall sensors still have the older hole layout.

Also, I notice a lot of people are still following the instructions from @tandarra - but it is important to note this comment, which details a much easier and cleaner way to use openocd on windows.

@jvdburgt
Copy link

Took out and flashed all 17 (in-ceiling) presence sensors, and now the network is quiet like a Summer meadow :)

@jvdburgt
Copy link

Okay, allthough the sensors generally are working fine after the update, my log is now full of errors with regard to automations that turn on the lights based on presence, of the type "ZIGBEE_MAX_MESSAGE_LIMIT_REACHED: 3075".

I'm not sure what to make of this, the presence sensors are on a dedicated MQTT network, while the lights are on a separate ZHA network.

Not sure what is causing this, and if/how it is related to flashing the sensors. Any ideas anyone?

@cowbe0x004
Copy link

cowbe0x004 commented Oct 20, 2024

EDIT: direct link http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/utility/stsw-link004.zip

can anyone share the necessary software to flash this? I keep getting errors download st software even if I sign up for an account.

@cowbe0x004
Copy link

cowbe0x004 commented Oct 20, 2024

EDIT: had to apply pressure to the wires so they have good contact, able to flash without error.

I'm getting write error, anyone know what might be wrong here? I can backup fine.
image
image
PXL_20241020_020741310

@bundoon
Copy link

bundoon commented Oct 20, 2024

I see you didn't rename your downloaded file to : ZY-M100_L-TargetDistance_disable

You did manage to download your existing firmware from the device, so it is working.

Don't know if it make a difference but I followed these commands and it wotked.

You should put your new renamed file in the same folder that your existing firmware wrote to.

Download correct firmware for your device and rename it to "ZY-M100_L-TargetDistance_disable"

Now we flash using "openocd -f interface/stlink-v2.cfg -f target/gd32e23x.cfg -c init -c "reset halt" -c "flash erase_sector 0 0 last" -c "flash write_bank 0 ZY-M100_L-TargetDistance_disable.bin" -c "flash verify_bank 0 ZY-M100_L-TargetDistance_disable.bin" -c "reset" -c shutdown"

@jvdburgt
Copy link

As for the pins, to ensure they make contact, what I did was bend them a little, and let the module "hang" on the cables (instead of laying it down on the desk), which ensures all pins will make contact.

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

No branches or pull requests