It should work out of the box, no need to install anything when using HassOs (except ble_monitor of course). Did you set your encryption key in your configuration?
Thank you Ernst. now it looks like it work. i think i have made some mistake. i tried to config it with the gui and there was only the hci interface showing. thats why i tought i need the hcitool.
0.9.11 has been released with the following changes.
Changes in 0.9.11
- Remove jagged humidity measurements for sensors with ATC firmware
- Added support for Bluetooth 5 advertisements (extended format) for sensors with ATC firmware
- Improved support for motion sensor of MJYD02YL Xiaomi Motion Activated Night Light sensor (thanks for the support of @andrewjswan and @skynetua).
It’s time to move to 1.0.0! We were running out of numbers, so it was about time to move on and start with the magic number 1.0.0.
Changes in 1.0.0
To celebrate, we have added more settings that can be set/overruled for individual devices. decimals
, use_median
and restore_state
can now be set at device level. We have removed the rounding
option, as it wasn’t adding much. The same can be achieved by using a large number of decimals.
We also fixed a bug for sensors with ATC firmware, which were not working in combination with discovery: False
Just wanted to say thanks for all your work! I just added six LYWSD03MMC sensors and it was super easy. Dug up a cheap Android phone and used the TelinkFlasher website as per your instructions and flashed the ATC firmware. It took 15 minutes to set up all 6. They were all detected by HA on a Pi (2 floors above me) within seconds of flashing, didn’t need to do a thing. Very pleased since they are to replace Xiaomi zigbee sensors that I know dont work at that same range. Plus they were a third of the price and have a screen
I am trying to edit the friendly name for these sensors, but it always puts the ble_temperature/ble_humidity in front.
Can the friendly name be fully configurable, please?
This was the solution Map new sensor to old sensor name
Updated the Raspbian this system works on and I noted a bug whereby if there is an external dongle, the internal BT sensor does not work. - Pi-bluetooth bug external and internal devices. I did revert the fix (as I have a local dongle and a remote one).
However, I am seeing these errors that eventually results in the HCI interface going down. I saw the errors before I applied the fix, after I applied the fix and again once I reverted back to the up to date version.
Feb 05 11:23:38 hassio kernel: Bluetooth: hci0: Received unexpected HCI Event 00000000
Feb 05 11:23:38 hassio kernel: Bluetooth: hci0: Received unexpected HCI Event 00000000
Feb 05 11:23:39 hassio kernel: Bluetooth: hci0: command 0x040c tx timeout
Feb 05 11:23:40 hassio kernel: Bluetooth: hci0: hardware error 0x00
Feb 05 11:23:40 hassio kernel: debugfs: File 'force_bredr_smp' in directory 'hci0' already present!
Feb 05 11:25:09 hassio kernel: Bluetooth: hci1: hardware error 0x03
Feb 05 11:25:09 hassio kernel: debugfs: File 'force_bredr_smp' in directory 'hci1' already present!
Feb 05 11:25:26 hassio kernel: Bluetooth: hci0: advertising data len corrected 28 -> 4
Feb 05 11:25:26 hassio kernel: Bluetooth: hci0: Received unexpected HCI Event 00000000
Feb 05 11:25:36 hassio kernel: Bluetooth: hci1: hardware error 0x0e
Feb 05 11:25:36 hassio kernel: debugfs: File 'force_bredr_smp' in directory 'hci1' already present!
These errors are repeated over and over in the syslog.
While migrating between the old BLE integration and the new one (so no BLE activity) no errors were seen.
[edit]
I’ll add that the data received is significantly worse than the old mitemp_bt passive system I had running. Where I used to get 10 or so readings in a 60s period, I now see a max of 5.
Not sure what I am doing wrong. I have three LYWSD03MMC sensors that have been automatically recognized by BLE Monitor. But only one is showing readings. This has been a long process so let me explain.
The two that are not showing readings were first programmed with the ATC custom firmware and I tried to install them manually using the HACS BLE app. They installed but did not read. While doing that and checking in BLE Options, I noticed that my third unit that had never been reprogrammed and was using the stock firmware was already recognized by BLE.
A noted difference was that the device (#3-stock firmware) had the MAC address (seen in BLE, options, devices {down arrow}) had no colons just the numbers and letters of the MAC address alone with no spaces. But the two other units (#1 & #2 w/ATC firmware) that were manually installed were listed with their respective MAC addresses with colons. Not sure why the difference.
So I uninstalled these two units (#1 & #2) then reprogrammed them both back to the stock firmware. These two were quickly auto recognized by BLE but no reading have ever shown in Development Tools, Current Devices. Again, all three are listed for Temp, Humid, and Battery but only the unit #3 that was never reprogrammed with ATC firmware is showing any readings.
So, could use some help if anyone can see what I have screwed up. Thanks
P.S.
(I also have one more unit that I have not removed from the box).
I have updated BLE to Version 1.0 recently after all the above with no change.
Running on Intel I7 Processor system with linux.
UPDATE:
I was able to get all three working correctly. I reprogrammed #2 & #3 with Pvvx Ver.20 custom firmware. Then BLE Monitor started to show the data. #1 was already working and kept working correctly after I reprogrammed it with the same custom firmware.
Hi,
I also have an openmqttgateway to collect broadcasted BLE info. How did you decrypt the messages from the LYWSD03MMC ?
I do have the bindkey but I don’t know how to get the data out of the servicedata or servicedatauuid since I expect this contains the encrypted info.
I flashed the alternative firmware.
so with the alternative firmware I don’t need to decode ?
I did flash the alternative firmware but is still don’t see the mqttgataway publishing the temp, hum, bat, …
I gave up on rpi and linux python to bluetooth after a lot of frustrating trying. It is just not robust enough in the area of processing advertising packets. I wrote a simple c program that collects the advertising packets and publishes them to MQTT. No need for HA to try and do any bluetooth stuff, I think this is a good thing. It has been running 2 months no problems on rpi 3 with internal bluetooth adapter, works fine with external as well or both at same time. Currently collecting from 20 BLE sensors of several types.
If you have an extra rpi or linux machine with bluetooth, you can just install it in parallel with whatever you are currently doing. Don’t change any of your HA stuff at first, the program will just publish to MQTT server and you can get a gauge if it is better. Program will publish hourly stats on number of packets received from each temperature sensor you configure, helps to position both sensors and collector machine for optional reception.
I use an ESP 32 with the openmqttgateway on it. It works fine for me at this moment.
So do I. Works very good.
Hi guys
this is a nice integration, thank you for it
I have the temperature/humidity sensor (not encrypted) and it worked fine for about half a year.
Then last month the entities (temp, hum, battery) were suddenly unavailable. I managed to get them back after a lot of fiddling, resetting the device, re-pairing with the phone, reinstalling everything in HA etc
yesterday it happened again, but this time I could not get it to work no matter what I did.
I suspect that these problems have something to do with updates to the repository or to the HA, as I have not changed anything else.
I appreciate any help, thank you.
this is my yaml entry that worked but no longer works;
ble_monitor:
hci_interface: 0
discovery: True
active_scan: False
report_unknown: False
batt_entities: True
decimals: 1
period: 60
log_spikes: False
use_median: False
restore_state: False
devices:
- mac: '59:3D:44:21:16:A7'
name: 'Xi'
temperature_unit: C
ther also used to be “rounding” there but I took it out as I understand it is deprecated
My hci interfaces are both dying regularly since I ran the Raspbian update. It is a real PITA. Should have not fixed something that wasn’t broken
@baz123 Thanks a lot, that means I’m not alone…
I ordered a new bluetooth dongle to see if something changes, but if you have the same problems…
Do you have an idea where to start the search for a solution?
With ble_monitor, there is no need to enter an encryption key when using ATC firmware. You can use the mi-like format or the custom format, the last is more precise. In ble_monitor 1.0.0 I fixed a bug for Bluetooth 5.0 dongles in combination with the ATC firmware, which might explain why you didn’t get readings in your first attempts. Not sure this was your issue, but to to hear that it works now.
Your configuration looks ok. Rounding is removed, but that can’t have anything to do with your problem. I propose you make a new issue on github, where we can help you solve your problem. Please report your type of sensor in the issue and any errors in the logs.
Update: reinstalled the repository today, used the current yaml code from the github page, changed the name of the sensor vs previous and - magic - it is working again.
Thanks for the reply. It’s a great integration, I am now planning to add more bluetooth devices, could use e.g. some miflora sensors for my plants.
It’s just that I’ve become a little bit reluctant to update
Have three LYWSD03MMC sensors reporting Temp, Humid, Battery % seemingly solid for now. But the Battery Voltage works at start after reprogramming with pvvx custom firmware V 2.1. Then shortly becomes Unavailable in Development/States.
Using BLE Monitor Version 1.0 via HACS.
Does anyone have a solution for this problem? Thanks