Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
blakadder committed Oct 17, 2023
2 parents b10ee0d + a2ddeb3 commit d761175
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 712 deletions.
54 changes: 5 additions & 49 deletions docs/Bluetooth_MI32.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,22 @@
# MI32 legacy

The MI32-driver focuses on the passive observation of BLE sensors of the Xiaomi/Mijia universe, thus only needing a small memory footprint. This allows to additionally run a dedicated software bridge to Apples HomeKit with very few additional configuration steps. Berry can be used to create generic applications.
Currently supported are the original ESP32, the ESP32-C3 and the ESP32-S3.
The MI32-driver focuses on the passive observation of BLE sensors of the Xiaomi/Mijia universe, thus only needing a small memory footprint. Berry can be used to create generic applications.
Currently supported are the original ESP32, the ESP32-C2/C3/C6 and the ESP32-S3.

## Usage

This driver is not part of any standard build. To self compile it is recommended to add build environments to `platformio_tasmota_cenv.ini`. This file needs to be created first.
Add these sections:
Add this section (change accordingly for the other chipsets):
```
[env:tasmota32-mi32-homebridge]
[env:tasmota32-mi32-legacy]
extends = env:tasmota32_base
build_flags = ${env:tasmota32_base.build_flags}
-DUSE_MI_ESP32
-DUSE_MI_EXT_GUI
-DUSE_MI_HOMEKIT=1 ; 1 to enable; 0 to disable
lib_extra_dirs = lib/libesp32, lib/libesp32_div, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_ssl
lib_ignore = ESP8266Audio
ESP8266SAM
TTGO TWatch Library
Micro-RTSP
epdiy
esp32-camera
[env:tasmota32c3-mi32-homebridge]
extends = env:tasmota32c3
build_flags = ${env:tasmota32_base.build_flags}
-DUSE_MI_ESP32
-DUSE_MI_EXT_GUI
-DUSE_MI_HOMEKIT=1 ; 1 to enable; 0 to disable
lib_extra_dirs = lib/libesp32, lib/libesp32_div, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_ssl
lib_ignore = ESP8266Audio
ESP8266SAM
TTGO TWatch Library
Micro-RTSP
epdiy
esp32-camera
```

It is probably necessary to restart your IDE (i.e. Visual Studio Code) to see the option to build these environments.
It is probably necessary to restart your IDE (i.e. Visual Studio Code) to see the option to build this environment.

## Tasmota and BLE-sensors

Expand Down Expand Up @@ -290,29 +269,6 @@ MI32Option4|`0` = use passive scanning (default)<br>`1` = use active scanning, n

The driver provides an extended web GUI to show the observed Xiaomi sensors in a widget style, that features a responsive design to use the screen area as effective as possible. The other advantage is, that only the widget with new data gets redrawn (indicated by a fading circle) and no unnecessary refresh operations will happen. A simple graph shows if valid data for every hour was received in the last 24h, where only one gap for the coming hour is not a sign of an error. Configured sensors with no received packet since boot or key/decryption errors are dimmed.

## HomeKit Bridge

If activated at compile time the driver will start the HAP core (= the main task of the HomeKit framework) after successfully reading a valid **mi32cfg** file after the start. It will create a 'bridge accessory' presenting all configured BLE devices to HomeKit. You can add the ESP32 as such a **Mi-Home-Bridge** to HomeKit in the native way, like you would add a commercial product to you local HomeKit network. The setup key is derived from the Wifi MAC of your ESP32 to easily allow many ESP32 to be used as a HomeKit bridge in your local network.
Besides the driver will also manage up to four relays and sync them with HomeKit.
There is nothing more to configure, the driver will automatically translate the data packets back and forth.
It just works ... except, when it does not.

!!! danger "Known issues"

The underlying HAP framework will expose incompatible network configurations, which will likely be related to mDNS and IGMP settings. There is nothing, that the Tasmota side can fix here.

!!! danger "If it is not broken, do not upgrade"

Although the driver does not write to the NVS section and the usage of a modified HAP framework (using a NVS wrapper) the behavior of Tasmota firmware upgrades is undefined with regards to a working HomeKit installation. Similar things can also happen using much bigger projects like "Homebridge". So it might be necessary to completely erase the Mi-Bridge from your "Home" in Homekit and doing a flash erase of the ESP32 after a firmware upgrade of the ESP32. It is recommend to first create a final mi32cfg file before you add the Mi-Home-Bridge to your "Home".

### HomeKit QR-Code-Generator - Web App

This will generate a QR-Code based on the MAC address of the ESP32 which runs Tasmotas Homekit-Bridge. Use the camera of your iPhone or iPad to easily start the setup procedure.

<script src="../extra_javascript/mi32/qrcode.js"></script>
<input size="40" type="text" id="Wifi-MAC" value="" placeholder="Input WiFi MAC of the ESP32" style="font-size:1.5em;"><br>

<object data="../extra_javascript/mi32/hk_qrcode.svg" id="hk_qrcode" type="image/svg+xml" height="0"></object>

## Homeassistant and Tasmota - BLE sensors

Expand Down
6 changes: 5 additions & 1 deletion docs/TuyaMCU-Devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ Bought from [ebay](https://www.ebay.co.uk/itm/Smart-Wifi-Dimmer-Switch-Support-T

## Ketotek KTEM06

The KTEM06 is a single phase energy meter with a relay for switching for DIN rail mounting.
The KTEM06 is a single phase energy meter with a relay for switching for DIN rail mounting. This device is identical in construction with the TYWE3S-based version of HIKING DDS238-2.

![KTEM06 open](./_media/devices/Ketotek-KTEM06-01x.jpg)

### Flashing

Open the case to see the board with the display and the TYWE3S module on the backside. Remove the board and flip it around.
Expand Down Expand Up @@ -244,6 +245,9 @@ Different than described elsewhere it was not helpful to connect EN to 3.3V.

RST needed to be disconnected from GND to start flashing.

Some users report that flashing does not work because the serial programmer does not supply enough power. Using serial programmers based on CH340 seem to work. A workaround is to use an additional power supply.

### Product Links

[KETOTEK Smart 1 Phasen Stromzähler](https://www.amazon.de/KETOTEK-Stromz%C3%A4hler-Digitalenergiez%C3%A4hler-Fernbedienung-Energiez%C3%A4hler/dp/B09XXG4L2C)
[HIKING DDS238-2](https://de.aliexpress.com/item/4000571797301.html?gatewayAdapt=glo2deu)
48 changes: 0 additions & 48 deletions docs/extra_javascript/mi32/hk_qrcode.svg

This file was deleted.

Loading

0 comments on commit d761175

Please sign in to comment.