Closed ivanpavlina closed 3 years ago
I have never heard of faulty devices before. I think you should ask a question in the custom firmware repository.
The only thing I can say is that the sensors send a lot of packets, but not all of them contain useful data. They may contain a Payload, but there is no data on temperature, humidity, battery. If a sensor in HA has an UNKNOWN
state (instead of UNAVAILABLE
), then the component receives packets from the sensor, but among them there has not yet been a single one with data on the status of the sensor. That is, if the status of an entity is unknown, then everything is fine, the reception works. At the same time, in both "empty" and "full" packets, in any case, there must be 0x1695FE
bytes (this is a sure sign that the packet is from the Xiaomi Mijia ecosystem device, actually 0x16=Service Data, 0x95FE=Xiaomi UUID)
Thanks for the response, yeah, it would probably be better to ask this question in ATC's repo, sorry.
Sensor is always in UNAVAILABLE
state.. Also when i remove it from 'devices' list and turn on discovery
that device is never discovered, while other one that works fine is..
I will try other repo, i also just ordered 10 of those sensors so i hope they will work fine :) Keep up the good work.
Here are the differences between payload for short and full packets in a nutshell (this is how the LYWSD03MMC service data looks with the original firmware, that is, the payload is encrypted). For the rest of the sensors, everything looks about the same, just the PAYLOAD data is open:
---------------------------------------------------------------------------------------------------
len AD Xiaomi Frame Device Frame MAC (LE) ----------------PAYLOAD-------------- RSSI
type UUID ctrl type cnt cypher ext.cnt MAC tag
---------------------------------------------------------------------------------------------------
0F 16 95 FE 30 58 5B 05 BF 6B 87 2F 38 C1 A4 08 E3
1A 16 95 FE 58 58 5B 05 C0 6B 87 2F 38 C1 A4 63 02 92 E6 37 21 00 00 E5 E9 32 F7 E2
If there is no data from the sensor, but it is close enough to the host, then in the case of original firmware I would say that it is not activated (if the sensor is not added to the official MiHome application, then it does not send packets with service data at all).
Thanks for the info, this could be usefull in the future, but both sensors are flashed with custom firmware, i just tried adding 'faulty' sensor to mihome app but it fails, which is expected.
I will look a bit more into the packets that sensor is sending, i agree that its weird that Xiaomi UUID is not present in messages.
Refer to this issue in other repo, I can keep the conversation going if need be.
Nice, thanks, let me just 'catch' some more messages from this sensor to make sure that there isn't any 'normal' messages
Oooooh
... The following settings can be send to the RxTx Characteristics 0x1F10/0x1f1f These settings will not get saved on power loss, maybe that will change in future but normaly the battery will be in there for a while ...
I am removing battery to make it send messages (in retrospect, probably a stupid idea :D ), it could be that it forgets 'Mi Like' Advertising Type and defaults to 'Custom'. Let me try it without removing the battery.
Ha! I remembered what I saw somewhere a custom firmware, in which the MiLike option is enabled by default...
Look at this: https://github.com/atc1441/ATC_MiThermometer/issues/37
:( 404 on all links. I'm gonna build my own compile env.... with blackjack and hookers :)
Problem solved, i flashed both sensors with new firmware which has MiLike Advertising type and they both work. Yay \o/ I'm attaching this firmware here so that it helps any poor soul like me.
Thank you for the help dude, you rock, now i finally have some proper and cheap option to measure temperatures in all corners of my house :D ATC_Thermometer-05122020-mi_like-adv.zip
OK, thank you.
Hi,
I bought two LYWSD03MMC sensors, flashed custom firmware through Telink Flasher and one is working great, i get temp/humidity/battery readings as expected but i have a problem with other one.
This is my config:
Device with MAC A4:C1:38:00:AE:2A is working good, but A4:C1:38:E1:8C:8D is not getting any values in Hass. I turned on report_unknown, but still there aren't any messages about the 'unknown' device.
I downloaded app BLE Scanner on my phone and i see messages from both devices - This is raw data for mac A4:C1:38:00:AE:2A which is working fine:
151695FE50305B05242AAE0038C1A40A10012A0000000B094154435F303041453241
and this is raw data for faulty mac A4:C1:38:E1:8C:8D:
10161A18A4C138E18C8D00FB21640C310B0B094154435F453138433844
Message from faulty device is shorter, i looked through the code a bit and i see there should be bytes \x16\x95\xFE present in message but i dont see those in message from a faulty device.
I tried reflashing the custom firmware on the faulty device, shorting reset pins above the battery but nothing seems to help. Also i made sure that Advertising Type 'Mi Like' is set, that button was pressed about thousand times now while the device is connected to my phone :)
So, do I have a faulty device on my hand or is there some kind of remedy for this? Thank you in advance