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 · 233 comments
Open

ZY-M100-S_1 sensors report every second #19045

seblu opened this issue Sep 21, 2023 · 233 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

@java-devil
Copy link

@markhaines I have the exact same PIN lineup (so... that's pretty suspicious). I also adjusted the cables. And my presence sensor also blinks and communicates with Home Assistant as if it was "properly" powered up. It's simply not properly discovered by the OS, that's all.

@markhaines
Copy link

@markhaines I have the exact same PIN lineup (so... that's pretty suspicious). I also adjusted the cables. And my presence sensor also blinks and communicates with Home Assistant as if it was "properly" powered up. It's simply not properly discovered by the OS, that's all.

I managed to get it working on MacOS straight away in the end so assume it was just a windows / driver thing.

@dr1rrb
Copy link

dr1rrb commented Nov 24, 2024

For ref, based on detailed comment from @tandarra, my simplified steps for a ZY-M100-24G on windows:

  1. Download and install STM32 ST-LINK Utility (STSW-LINK004), this will also install the needed drivers for the ST-Link v2
  2. Download and extract opencd

    I used the "latest" pre-released version published on 23/11/2024

  3. Download the right bin file from https://github.com/Andrik45719/ZY-M100?tab=readme-ov-file in the opencd/bin folder

    I used the latest version published on 13/09/2024 perm link)

  4. Open a command prompt in the opencd/bin folder (you should have a openocd.exe file there)
  5. Backup the current firmware

    openocd.exe -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

  6. Install the new firmware

    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-24G_TZE204_ijxvkhd0-TargetDistance_disable.bin" -c "flash verify_bank 0 ZY-M100-24G_TZE204_ijxvkhd0-TargetDistance_disable.bin" -c "reset" -c shutdown

image

image

image

@R3uvysiXozq4Fr3Skmrs
Copy link

I flashed 5 pcs TZE204_qasjif9e and the sensors work great!

My network is finally working properly. Thank you❤️

@pcieszkowski
Copy link

thank you all!
TZE204_qasjif9e, after year of sending garbage into my network works like a charm.. big up !

@jvdburgt
Copy link

New problem here. I now discovered that my BHT-006 (Tuya/Moes) thermostats are also spamming the network like crazy. Any ideas on how to get new firmware for this?

1 similar comment
@jvdburgt
Copy link

New problem here. I now discovered that my BHT-006 (Tuya/Moes) thermostats are also spamming the network like crazy. Any ideas on how to get new firmware for this?

@JackTalisker
Copy link

New problem here. I now discovered that my BHT-006 (Tuya/Moes) thermostats are also spamming the network like crazy. Any ideas on how to get new firmware for this?

I think you should open a new issue for that device.

@orzechszek
Copy link

orzechszek commented Dec 18, 2024

I just bought Wenzhi presence sensor (Zigbee 24G). In Z2M I've noticed "Found switch (distance switch)". When I turn it off I see less reports in logs. It means that I have already proper firmware and don't need to flash additionaly or should I because it's not enough to keep it stable?
Additionally what I've noticed is that - when sensor loose power "Find switch" back to ON.

@bsaurusrex
Copy link

bsaurusrex commented Dec 18, 2024 via email

@orzechszek
Copy link

I've flashed _TZE204_ya4ft0w4 with mentioned procedure - should I additionaly disable with Find_switch?

@mauricecyril
Copy link

I'm trying to connect a ST-Link V2 to the ZY-M100-V1.4-24G wall mounted board (the box says it's a WZ-M100-W) and homeassistant reports this as TS0601 by _TZE204_ya4ft0w4 . However when the wires are connected the red LED lights up but then shuts off. When trying to run the firmware backup:

openocd.exe -f interface/stlink-v2.cfg -f target/gd32e23x.cfg -c init -c "reset halt" -c "flash read_bank 0 ZY-M100_TZE204_ya4ft0w4_Original_FW.bin" -c "reset" -c shutdown

I get

Open On-Chip Debugger 0.12.0+dev-01812-gcd9e64a25 (2024-12-22-09:55) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg Info : auto-selecting first available session transport "dapdirect_swd". To override use 'transport select <transport>'. Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.193220 Error: init mode failed (unable to connect to the target)

@orzechszek
Copy link

orzechszek commented Dec 30, 2024

Try to switch data cables on the board, power cables should be ok, I had similar problem and it helps.

@calexgit
Copy link

glad I found this thread. thank you all! got a few TZE204_qasjif9e and TZE204_sxm7l9xa flashed and quietened down

@mauricecyril
Copy link

mauricecyril commented Dec 31, 2024

Try to switch data cables on the board, power cables should be ok, I had similar problem and it helps.

Thank you so much this resolved my issue. When I flashed the "ZY-M100-24GV3_TZE204_ya4ft0w4_increased_report_interval_TD_0_disable.bin", HA now shows the device as TS0601by _TZE200_ya4ft0w4 instead of TS0601by _TZE204_ya4ft0w4 on a second unit.

But I forgot to do the backup step on my second unit :( Hope I didn't brick it.

@mauricecyril
Copy link

mauricecyril commented Dec 31, 2024

I also tried flashing the other variants in https://github.com/Andrik45719/ZY-M100?tab=readme-ov-file and the device always show TZE200 instead of TZE204.

So first attempt after flashing shows TS0601by _TZE200_ya4ft0w4

Subsequent attempts with other variants of ZY-M100-24G firmware makes HA display the devices as:
TS0601by _TZE200_ijxvkhd0
TS0601by _TZE200_7gclukjs

@estevao90
Copy link

Hello, I followed the instructions and I have the same issue: unable to connect to the target

Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J28S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.263492
Error: init mode failed (unable to connect to the target)

I tried many approaches, like changing the cable, changing the sensor (I have many of them), etc., and nothing.

How can I debug it to understand and fix the issue?

@pmrosa
Copy link

pmrosa commented Jan 8, 2025

> Error: init mode failed (unable to connect to the target)

I tried many approaches, like changing the cable, changing the sensor (I have many of them), etc., and nothing.

How can I debug it to understand and fix the issue?

How are you connecting the programmer to the sensor? Are you sure that there is good contact and all pins in the right order? I had that error when the contact with the board was not good (I did not solder it).

@estevao90
Copy link

How are you connecting the programmer to the sensor? Are you sure that there is good contact and all pins in the right order? I had that error when the contact with the board was not good (I did not solder it).

I'm using a jumper cable like this without soldering it. Do you suggest something easier? I don't have a way to solder the cable in the board, unfortunately.
image

All the pins are correct. By the way, what's the expected behavior of the red light? As soon as you connect it to the ST-link, does this light start to flash? Or only after you run the commands? I searched for a quick demo video about that, but I did not find it. If you could send me a quick video showing the process, it would be very helpful because I can compare the steps and identify the issue. Thank you!

In my case, I only see the red light when I connect the cables, and then it stops flashing, and nothing happens. I bought a new ST-link to make sure it works, and I'll re-test it later.

Thanks a lot.

@davidruigrok
Copy link

davidruigrok commented Jan 9, 2025

I tried many approaches, like changing the cable, changing the sensor (I have many of them), etc., and nothing.

How can I debug it to understand and fix the issue?

I had the same issue a couple of times, for me it was just bad contacts on the pins. Used dupont cables and no soldering, so needed to hold them in place correctly.

By the way, what's the expected behavior of the red light? As soon as you connect it to the ST-link, does this light start to flash? Or only after you run the commands?

Some flashing when plugging in the ST Link (so providing power to the board). It will also flash if you just power the board with 3.3 volts and have the data pins incorrectly placed. If I remember correctly it will not flash any more after plugging in the ST Link

@bapesupreme
Copy link

Hello, I followed the instructions and I have the same issue: unable to connect to the target

Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J28S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.263492
Error: init mode failed (unable to connect to the target)

I tried many approaches, like changing the cable, changing the sensor (I have many of them), etc., and nothing.

How can I debug it to understand and fix the issue?

I had the same error. This error is caused when you have not connected the cables from the board to ST Link correctly.

The square pad always goes to 3v3 on ST Link (you might have two so try either one)
The next pad always goes to ground on ST Link (you might have two also so try either one)

You can try switching SWDIO and SWCLK on ST Link.

The best way is to post a picture of your ST Link.

@estevao90
Copy link

I finally found the problem. It was my ST-Link device. I bought a new one and it worked like a charm! Thanks!

@bapesupreme
Copy link

bapesupreme commented Jan 13, 2025

There is a new version out which has the Find switch/distance switch in Z2M. _TZE204_ya4ft0w4/ZY-M100-24GV3

Still spams the network.

image

I have attached the original firmware.

Hopefully @Andrik45719 or someone else can create a new firmware for this device.

_TZE204_ya4ft0w4_ZY-M100-24GV3.zip

If anyone else has problems connecting to their ST-Link, try switching the connection points for SWDIO and SWCLK from the guide.

I don't think there is a set order the manufacturer of these devices follow for which pad is SWDIO and SWCLK. Ever board I have gotten seems to have a different order of pads for SWDIO and SWCLK.

@lolcatnip
Copy link

I’ve tested this custom firmware on my ZY-M100-24G too, but it still sends bursts of duplicate messages and delays illuminance, which is important to me.

@returnofthem
Copy link

There is a new version out which has the Find switch/distance switch in Z2M. _TZE204_ya4ft0w4/ZY-M100-24GV3

Still spams the network.

image

I have attached the original firmware.

Hopefully @Andrik45719 or someone else can create a new firmware for this device.

_TZE204_ya4ft0w4_ZY-M100-24GV3.zip

If anyone else has problems connecting to their ST-Link, try switching the connection points for SWDIO and SWCLK from the guide.

I don't think there is a set order the manufacturer of these devices follow for which pad is SWDIO and SWCLK. Ever board I have gotten seems to have a different order of pads for SWDIO and SWCLK.

I have this version too and I'm struggling to tell whether setting the find switch to on or to off is supposed to reduce the spam if I'm honest - does anyone know?

@djcrawleravp
Copy link

"After 2 years of almost trouble-free use, my Z2M suddenly started experiencing disconnections and my networks became unstable. I'm unsure if this is related to my 7 ZY-M100 sensors or if it's a specific issue with Z2M 2.0.

I still have a backup of my old VM from before the 2.0 update, but attempting to restore it yesterday didn't resolve the issue. Both versions are behaving the same way.

Here's a screenshot."

Image

@Burned695
Copy link

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)

If anyone is interested, I've managed to flash WZ-M100-W with the modified firmware for ZY-M100-S_1 following the steps by @tandarra

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