Skip to content

Commit ea7f49f

Browse files
committed
Merge branch 'master' of https://github.com/tasmota/docs
2 parents cf0cc4c + 2e65a7b commit ea7f49f

File tree

4 files changed

+148
-0
lines changed

4 files changed

+148
-0
lines changed

Bluetooth.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
<<<<<<< HEAD
12
?> Presence detection with iBeacons or BLE sensor gateway using HM-1x or nRF24L01(+) peripherals
3+
=======
4+
Tasmota provides limited Bluetooth functionality through the use of external hardware. Two different drivers support the use of bluetooth beacons or several BLE sensors from the Mijia/Xiaomi-universe.
5+
6+
>>>>>>> 2e65a7b49ad13c05bce0b7d40783d4adb71f0833
27
38
## iBeacon
49
**This feature is included only in tasmota-sensors.bin**
@@ -50,12 +55,112 @@ Cheap "iTag" beacons with a beeper. The battery on these lasts only about a mont
5055
- [eBay](https://www.ebay.de/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw=Smart-Tag-GPS-Tracker-Bluetooth-Anti-verlorene-Alarm-Key-Finder-Haustier-Kind&_sacat=0)
5156
- [Amazon.com](https://www.amazon.com/s?k=itag+tracker+4.0)
5257

58+
<<<<<<< HEAD
5359
<img src="/_media/bluetooth/itag.png" width=225><img src="/_media/bluetooth/itag2.png" width=225><img src="/_media/bluetooth/itag3.png" width=225>
5460

5561
> [!TIP]
5662
You can activate a beacon with a beeper using command `IBEACON_%BEACONID%_RSSI 99` (ID is visible in webUI and SENSOR reports). This command can freeze the Bluetooth moduel and beacon scanning will stop. After a reboot of Tasmota the beacon will start beeping and scanning will resume.
5763

5864
## BLE Sensors using HM-1x
65+
=======
66+
With the arrival of the (cheap) LYWSD03 came the problem of encrypted data in MiBeacons, which to date has only been successfully decrypted in open source projects in a quite complicated way (getting the 16-byte-key with 3rd-party-software while pairing the device with the original Xiaomi-Apps).
67+
At least the device allows the use of a simple BLE connection without any encrypted authentication and the reading of the sensor data using normal subscription methods to GATT-services. This is more power hungry than the passive reading of BLE advertisements.
68+
69+
### Working principle of both Tasmota drivers (>8.2.0.1)
70+
71+
The idea is to provide drivers with as much automatic functions as possible. Besides the hardware setup, there are zero or very few things to configure. It is not necessary to pair the sensors with any of the vendor apps.
72+
The sensor namings are based on the original sensor names and shortened if appropriate (Flower care -> Flora). A part of the MAC will be added to the name as a suffix.
73+
All sensors are treated as if they are physically connected to the ESP8266-device.
74+
75+
76+
## Tasmota-HM10-driver
77+
78+
### prerequisites:
79+
-firmware 707 (other versions may work, but this is undefined behavior)
80+
-simple serial cable connection
81+
-HM-10 is set to default baud rate of 115200 (if not look for HM10BAUD-command)
82+
-uncomment #ifdef USE_HM10 in my_user_config.h
83+
-select GPIO-pins "HM10 RX" and "HM10 TX"
84+
85+
!> **Most of the self-flashed modules will still have their factory default with a baud rate of 9600 !!**
86+
Please try:
87+
`
88+
HM10BAUD 9600`
89+
`
90+
HM10AT RENEW
91+
`
92+
Then reboot ESP8266.
93+
94+
95+
96+
### expected behavior:
97+
1. The driver will set a few options of the HM-10
98+
2. A discovery scan will search for known sensors (Mi Flora, MJ_HT_V1, LYWSD02, LYWSD03, CGG1, CGD1)
99+
3. Supported sensors will be connected at a given interval, a subscription is established for ~5 seconds and temperature/humidity/battery will be read.
100+
4. After deconnection return to point 3 after the interval.
101+
102+
### command interface:
103+
+ hm10scan
104+
start new discovery scan
105+
+ hm10period x
106+
set or show interval in seconds between sensor read cycles (is set to the value of teleperiod at start). hm10period 1 will trigger one read cycle and not change the period.
107+
+ hm10baud x
108+
set or show the speed of the serial interface of the esp8266, not of the hm10
109+
+ hm10at xxxx
110+
sends AT-commands,e.g. hm10at verr? results in AT+VERR?
111+
+ hm10time x
112+
sets the time of sensor x (if it is a LYWSD02) to the system-UTC-time and the timezone of Tasmota. Sensors are ordered from 0 to n in the order of the arrival.
113+
+ hm10auto x
114+
start an automatic discovery scan with an interval of x seconds to receive data in BLE-advertisements periodically. This an active scan and it should only be used, if necessary. This might change in the future, if a newer firmware of the HM-10 will support passive scan.
115+
+ hm10 page x
116+
shows a maximum of x sensors at a time in the web UI, if there are more sensors than x, the driver will cycle through multiple pages.
117+
118+
119+
### Features:
120+
+ RULES
121+
After a discovery scan the driver will report the number of found sensors. As the driver can not know, how many sensors are to be found, this can be used to force a re-scan.
122+
`Rule1 on hm10#found<6 do ADD1 1 endon on Var1#state<=3 do hm10scan endon` - will re-scan up to 3 times, if less than 6 sensors were found.
123+
+ DEW POINT
124+
Dew point will be calculated.
125+
126+
127+
### Supported sensors:
128+
129+
+ LYWSD02
130+
This device has an E-Ink-Display, works with 2 x CR2032-coin-cells and the driver can read temperature, humidity and battery. In addition the clock of the device can be set tot the system-time of Tasmota via command "hm10time".
131+
132+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/lywsd02.jpg?raw=true" style="width:200px"></img>
133+
134+
135+
+ LYWSD03MMC
136+
Small, rectangular form, 1 x CR2032-coin-cell. The driver can read temperature, humidity and battery.
137+
138+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/lywsd03.png?raw=true" style="width:200px"></img>
139+
140+
141+
+ Flower Care ("Flora")
142+
Works with a CR2032-coin-cell and provides temperature, illuminance, (soil-)humidity, (soil-)fertility and battery.
143+
144+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/miflora.png?raw=true" style="width:200px"></img>
145+
146+
+ MJ_HT_V1
147+
Model: LYWSDCGQ/01ZM
148+
This device works with an AAA-battery for several months and the driver can read temperature, humidity and battery level. Needs HM10AUTO to update sensor data.
149+
150+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/mj_ht_v1.png?raw=true" style="width:200px"></img>
151+
152+
153+
+ CGD1 (Alarm clock)
154+
The driver can read temperature, humidity and battery. Time or alarm functions are not supported.
155+
156+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/CGD1.png?raw=true" style="width:200px"></img>
157+
158+
#### not supported:
159+
CGG1 should be found and may give readings via MiBeacons, but is untested.
160+
161+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/CGG1.png?raw=true" style="width:200px"></img>
162+
163+
>>>>>>> 2e65a7b49ad13c05bce0b7d40783d4adb71f0833
59164
60165
!> **This feature is included only in tasmota-sensors.bin**
61166

@@ -151,6 +256,42 @@ Internally from time to time "fake" sensors will be created, when there was data
151256
!> **It can not be ruled out, that changes in the device firmware may break the functionality of this driver completely!**
152257

153258
The naming conventions in the product range of bluetooth sensors in XIAOMI-universe can be a bit confusing. The exact same sensor can be advertised under slightly different names depending on the seller (Mijia, Xiaomi, Cleargrass, ...).
259+
<<<<<<< HEAD
260+
=======
261+
262+
#### MJ_HT_V1:
263+
Model: LYWSDCGQ/01ZM
264+
This device works with an AAA-battery for several months and the driver can read temperature, humidity and battery level.
265+
266+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/mj_ht_v1.png?raw=true" style="width:200px"></img>
267+
268+
269+
#### Flower Care ("Flora"):
270+
Works with a CR2032-coin-cell and provides temperature, illuminance, (soil-)humidity and (soil-)fertility.
271+
272+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/miflora.png?raw=true" style="width:200px"></img>
273+
274+
275+
#### LYWSD02:
276+
This device has an E-Ink-Display, works with 2 x CR2032-coin-cells and the driver can read temperature and humidity.
277+
278+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/lywsd02.jpg?raw=true" style="width:200px"></img>
279+
280+
281+
#### CGG1:
282+
This device has an E-Ink-Display, with CR2430-coin-cell and the driver can read temperature, humidity and battery.
283+
284+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/CGG1.png?raw=true" style="width:200px"></img>
285+
286+
287+
#### CGD1:
288+
Alarm clock powered by 2 AA-batteries. Driver can read temperature and humidity.
289+
290+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/CGD1.png?raw=true" style="width:200px"></img>
291+
292+
293+
294+
>>>>>>> 2e65a7b49ad13c05bce0b7d40783d4adb71f0833
154295
155296
<table>
156297
<tr>
@@ -178,7 +319,14 @@ The naming conventions in the product range of bluetooth sensors in XIAOMI-unive
178319

179320
#### Unsupported Devices
180321

322+
<<<<<<< HEAD
181323
For LYWSD03MMC the sensor data in the advertisements is encrypted. It is highly unlikely to read data with the NRF24L01 out-of-the-box in the future. You can use an HM-1x module for this sensor.
324+
=======
325+
The situation for the LYWSD03MMC (small, rectangular form) is different, as the sensor data in the advertisements is encrypted. It is highly unlikely to read data with the NRF24L01 out-of-the-box in the future.
326+
327+
<img src="https://github.com/tasmota/docs/blob/master/_media/peripherals/lywsd03.png?raw=true" style="width:200px"></img>
328+
329+
>>>>>>> 2e65a7b49ad13c05bce0b7d40783d4adb71f0833
182330
183331
## Getting data from BT Xiaomi Devices
184332

_media/peripherals/CGD1.png

236 KB
Loading

_media/peripherals/CGG1.png

137 KB
Loading

_media/peripherals/lywsd03.png

131 KB
Loading

0 commit comments

Comments
 (0)