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

Get the data from the BLE advertisements #1

Open
jcea opened this issue Feb 4, 2021 · 6 comments
Open

Get the data from the BLE advertisements #1

jcea opened this issue Feb 4, 2021 · 6 comments

Comments

@jcea
Copy link

jcea commented Feb 4, 2021

Please, support getting the data from the periodic (in my device every 2.5 seconds) advertisements, instead of establishing a BT connection, to keep battery usage low.

@uduncanu
Copy link
Owner

I'm struggling to find any information about the broadcast data, although I can seem some sources saying that it may be encrypted (which isn't something I've had to deal with so far). Are you aware of any more information about it anywhere?

@afer92
Copy link

afer92 commented Feb 20, 2022

View lywsd03mmc fork. With AtcMiThermometerClient you can retrieve thermometers data without connecting. Limitations : can't get firmware and hardware revisions, can't get history.

from lywsd03mmc import AtcMiThermometerClient
# AtcMiThermometerClient(scan_for=15.0, retry=3, debug=False)
client = AtcMiThermometerClient()

client.get_datas()

for thermometer in client.thermometers:
    print('----\n', thermometer) # print all data `)

Result:

Discovered device a4:c1:38:xx:xx:xx
Discovered device a4:c1:38:yy:yy:yy
Device disconnected
Proceed...
Discovered device a4:c1:38:xx:xx:xx
Discovered device a4:c1:38:yy:yy:yy
Received new data from a4:c1:38:xx:xx:xx
----
 mac:   A4:C1:38:xx:xx:xx - ATC_xxxxxx
temp:   22.8 °C
hum:    37 %
batt:   86 %
volts:  2.98 V
rssi:   -54 dB
skip:   False
----
 mac:   A4:C1:38:yy:yy:yy - ATC_yyyyyy
temp:   21.7 °C
hum:    42 %
batt:   88 %
volts:  2.996 V
rssi:   -71 dB
skip:   False

@jcea
Copy link
Author

jcea commented Feb 23, 2022

This is nice, @afer92, but it requires a modified firmware.

@afer92
Copy link

afer92 commented Feb 23, 2022

This is nice, @afer92, but it requires a modified firmware.

Indeed. The interest of the modified firmware is to preserve the battery. The draw back is the lack of history. To choose is to renounce.

@arizzi
Copy link

arizzi commented Jan 29, 2023

@afer92
Copy link

afer92 commented Feb 5, 2023

I will have a look, it's a good idea. I use advertissements for miflora sensors (sea device-mqtt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants