Revision history for MiBluetoothTempESPHome


Revision [8000]

Last edited on 2022-07-06 04:27:28 by ZorrUno

No Differences

Revision [7999]

Edited on 2022-07-06 04:27:27 by ZorrUno
Additions:
CategoryAddedToZorruno


Revision [7932]

Edited on 2022-05-27 01:15:24 by ZorrUno

No Differences

Revision [7931]

Edited on 2022-05-27 01:15:24 by ZorrUno
Additions:
I couldn't wait for some Dev boards from China and Jaycar had some half price ESP32 boards so I grabbed a couple to play with
==CH340 Serial-USB in Ubuntu==
Getting the CH340 based serial working in ubuntu was annoying, I suspect however in windows you'd need to install the driver. The link I used to troubleshoot is below as errors show up in logs for BRLTTY. This is apparently what unix uses to gain access to serial ports by users.
==Wifi Issues==
These were a problem (I had a couple of esphome based projects I wanted to play with) as when I connected them, the logs showed they wouldn't connect to wifi. Logs showed this:
There is a bit of a jumble of information in there, but it appears it is a voltage issue when using the UART. I found a solution that if I pulled the 0 pin to ground via a resistor (they suggest 330 Ohm) it seems to boot and connect to wifi stably. Time will tell. Also pulling 0 low was often easier to flash the firmware when needed. Having the resistor off seems to not work reliability.
Deletions:
-- I couldn't wait for some Dev boards from China and Jaycar had some half price ESP32 boards so I grabbed a couple to play with
-- Getting the serial usb port for these working in ubuntu was annoying, I suspect however in windows you'd need to install the driver. The link I used to troubleshoot is below as errors show up in logs for BRLTTY. This is apparently what unix uses to gain access to serial ports by users.
-- These were a problem (I had a couple of esphome based projects I wanted to play with) as when I connected them, the logs showed they wouldn't connect to wifi. Logs showed this:
There is a bit of a jumble of information in there, but I found a solution that if I pulled the 0 pin to ground via a resistor (they suggested 330 Ohm, but currently I have about 480Ohm) it seems to boot and connect to wifi stably. Time will tell. Also pulling 0 low was often easier to flash the firmware when needed. Having the resistor off seems to not work reliability... except when connected via USB and serial logging. Booting just with 5V (from a battery pack and microUSB for testing) seems to require the resistor. Very confusing.


Revision [7930]

Edited on 2022-05-27 01:11:29 by ZorrUno

No Differences

Revision [7929]

Edited on 2022-05-27 01:11:29 by ZorrUno
Additions:
-- Getting the serial usb port for these working in ubuntu was annoying, I suspect however in windows you'd need to install the driver. The link I used to troubleshoot is below as errors show up in logs for BRLTTY. This is apparently what unix uses to gain access to serial ports by users.
https://unix.stackexchange.com/questions/670636/unable-to-use-usb-dongle-based-on-usb-serial-converter-chip
$ for f in /usr/lib/udev/rules.d/*brltty*.rules; do
sudo ln -s /dev/null "/etc/udev/rules.d/$(basename "$f")"
done
$ sudo udevadm control --reload-rules
$ sudo systemctl mask brltty.path
Created symlink /etc/systemd/system/brltty.path → /dev/null.


Revision [7928]

Edited on 2022-05-26 03:10:52 by ZorrUno

No Differences

Revision [7927]

Edited on 2022-05-26 03:10:52 by ZorrUno
Additions:
Sensors are around NZ$8.50 incl GST when I bought 4 of them.
Use esphome in an ESP32 dev board to pull the values of these temp sensors and integrate them into home assistant.
There is a bit of a jumble of information in there, but I found a solution that if I pulled the 0 pin to ground via a resistor (they suggested 330 Ohm, but currently I have about 480Ohm) it seems to boot and connect to wifi stably. Time will tell. Also pulling 0 low was often easier to flash the firmware when needed. Having the resistor off seems to not work reliability... except when connected via USB and serial logging. Booting just with 5V (from a battery pack and microUSB for testing) seems to require the resistor. Very confusing.
Deletions:
Sensors are around NZ$8.50 incl GST when I bought 4 of them (they even have batteries installed, a CR2032)
Use Esphome and an ESP32 dev board (with nothing except 5V connected to it) to pull the values of these temp sensors and integrate them into home assistant.
-- The website says they will measure down to 0 degrees, and the original plan was to use in my fridges and freezers so some might need to be repurposed.
There is a bit of a jumble of information in there, but I found that if I pulled the 0 pin to ground via a resistor (they suggested 330 Ohm, but currently I have about 480Ohm) it seems to boot and connect to wifi stably. I only had to do this once, and it seems like it connects on a reboot but time will tell. Also pulling 0 low was often easier to flash the firmware when needed.


Revision [7926]

Edited on 2022-05-26 02:55:13 by ZorrUno

No Differences

Revision [7925]

Edited on 2022-05-26 02:55:13 by ZorrUno
Additions:
There is a bit of a jumble of information in there, but I found that if I pulled the 0 pin to ground via a resistor (they suggested 330 Ohm, but currently I have about 480Ohm) it seems to boot and connect to wifi stably. I only had to do this once, and it seems like it connects on a reboot but time will tell. Also pulling 0 low was often easier to flash the firmware when needed.
Deletions:
There is a bit of a jumble of information in there, but I found that if I pulled the 0 pin to ground via a resistor (they suggested 330 Ohm, but currently I have about 480Ohm) it seems to boot and connect to wifi stably. Time will tell. Also pulling 0 low was often easier to flash the firmware when needed.


Revision [7924]

Edited on 2022-05-26 02:43:04 by ZorrUno

No Differences

Revision [7923]

Edited on 2022-05-26 02:43:04 by ZorrUno
Additions:
Sensors are around NZ$8.50 incl GST when I bought 4 of them (they even have batteries installed, a CR2032)
Use Esphome and an ESP32 dev board (with nothing except 5V connected to it) to pull the values of these temp sensors and integrate them into home assistant.
-- The website says they will measure down to 0 degrees, and the original plan was to use in my fridges and freezers so some might need to be repurposed.
Deletions:
Sensors are around NZ$8.50 incl GST when I bought 4 of them.
Use esphome in an ESP32 dev board to pull the values of these temp sensors and integrate them into home assistant.


Revision [7922]

Edited on 2022-05-26 02:32:38 by ZorrUno [added images]

No Differences

Revision [7921]

Edited on 2022-05-26 02:32:38 by ZorrUno [added images]
Additions:
{{image url="https://zorruno.com/wp-content/uploads/2022/05/XC3810-duinotech-wearable-esp32-development-boardImageMain-515.jpg" title="ESP32 Duinotech" alt="ESP32 Duinotech"}}


Revision [7920]

Edited on 2022-05-26 02:31:27 by ZorrUno [added images]

No Differences

Revision [7919]

Edited on 2022-05-26 02:31:27 by ZorrUno [added images]
Additions:
{{lastedit show="3"}}
--
CategoryHomeAutomation
CategoryESP32
CategoryHomeAssistant
CategoryMQTT
CategoryESPHome


Revision [7918]

Edited on 2022-05-26 02:29:16 by ZorrUno [added images]

No Differences

Revision [7917]

Edited on 2022-05-26 02:29:16 by ZorrUno [added images]
Additions:
{{image url="https://zorruno.com/wp-content/uploads/2022/05/LYWSD03MMC.png" title=" Xiaomi BLE LCD Thermometer" alt=" Xiaomi BLE LCD Thermometer"}}


Revision [7916]

Edited on 2022-05-26 02:22:24 by ZorrUno [added images]

No Differences

Revision [7915]

Edited on 2022-05-26 02:22:24 by ZorrUno [added images]
Additions:
-- Use ESPHome to flash the ESP32 (instructions, including the Home Assistant integration is elsewhere, but it is pretty simple once the concepts are grasped)
-- An example (my esphome config file) is below. You as minimum need to remember the esp32_ble_tracker: line and one config for each sensor.
-- Note that the Bindkey is a dummy key (with the ATC firmware you just need the dummy key)
Deletions:
-- Use ESPHome to flash the ESP32 (instructions elsewhere)
-- An example (my file) is below. You need the esp32_ble_tracker: line and one config for each sensor.
-- Note that the Bindkey is a dummy key (with the ATC firmware you need the dummy key)


Revision [7914]

Edited on 2022-05-26 02:17:45 by ZorrUno [added images]

No Differences

Revision [7913]

Edited on 2022-05-26 02:17:45 by ZorrUno [added images]
Additions:
Esphome config
%%
esphome:
name: bttemps
esp32:
board: nodemcu-32s
# framework:
# type: arduino

esp32_ble_tracker:
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
ota:
password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "BtTemps Fallback Hotspot"
password: "xxxxxxxxxxxxxxxxxxxx"
captive_portal:
# Web server for monitoring and control
web_server:
port: 80
auth:
username: user
password: !secret web_server_password

# MQTT Monitoring
mqtt:
broker: 192.168.1.256
topic_prefix: esphome/bttemps
username: username
password: !secret mqtt_password
###################################################################################
## Help with Mi Bluetooth Temp Sensors
## Youtube Howto https://www.youtube.com/watch?v=l5ea7lQWpMk&t=0s
## https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html
## https://esphome.io/components/sensor/xiaomi_ble.html?highlight=ble#lywsd03mmc
## Tasmota Info: https://tasmota.github.io/docs/Bluetooth/
###################################################################################
sensor:
- platform: xiaomi_lywsd03mmc
# ATC_121212
mac_address: "A4:C1:38:12:12:12"
#dummy bindkey
bindkey: "e2f413da42899a0c1c8f3bfa17e4511d5"
temperature:
name: "Fridge Temperature (BTTS01)"
humidity:
name: "Fridge Humidity (BTTS01)"
battery_level:
name: "Fridge Monitor Battery Level (BTTS01)"
- platform: xiaomi_lywsd03mmc
# ATC_343434
mac_address: "A4:C1:38:34:34:34"
#dummy bindkey
bindkey: "e5f418daf699a0c188f7bf917e1565d8"
temperature:
name: "Freezer Temperature (BTTS02)"
humidity:
name: "Freezer Humidity (BTTS02)"
battery_level:
name: "Freezer Monitor Battery Level (BTTS02)"
- platform: xiaomi_lywsd03mmc
# ATC_5A5A5A
mac_address: "A4:C1:38:5A:5A:5A"
#dummy bindkey
bindkey: "eef418eaf69910c18843bfd17e4565d7"
temperature:
name: "Lower Fridge Temperature (BTTS03)"
humidity:
name: "Lower Fridge Humidity (BTTS03)"
battery_level:
name: "Lower Fridge Battery Level (BTTS03)"
- platform: xiaomi_lywsd03mmc
# ATC_BCBCBC
mac_address: "A4:C1:38:BC:BC:BC"
#dummy bindkey
bindkey: "eaf415daf699a0c188f3bfd17e4565d6"
temperature:
name: "Lower Freezer Temperature (BTTS04)"
humidity:
name: "Lower Freezer Humidity (BTTS04)"
battery_level:
name: "Lower Freezer Monitor Battery Level (BTTS04)"
%%


Revision [7912]

Edited on 2022-05-26 02:11:37 by ZorrUno [added images]

No Differences

Revision [7911]

Edited on 2022-05-26 02:11:37 by ZorrUno [added images]
Additions:
--Use the tool to connect to the device, and grab the Mi Keys. Note them down. You won't need them if flashing the custom ATC firmware (this is a better way), but keep for future if ever needed. it is possible though to do this with the stock Xiaomi firmware.
--Flash the latest custom ATC firmware (it is already loaded in the web page)
--Check the website below if you want to know what the settings do (eg you can change to Fahrenheit, remove the little comfort smiley face, and extend the battery life with less reporting)
https://github.com/atc1441/ATC_MiThermometer
-- Put the MAC address for the device(s) and label the Temp/Humidity/Battery for each of the devices with unique names. The MACS all appear to start with A4:C1:38 (and then the rest is contained in the name). You can find the full MAC with the TELink page if needed.
=====Notes=====
-- Remember the devices will only connect to one host at a time, so if it is connected to the ESP32 you can't change parameters with the TELink app.
=====Jaycar Specific Duinotech ESP32 Notes=====
-- I couldn't wait for some Dev boards from China and Jaycar had some half price ESP32 boards so I grabbed a couple to play with
https://www.jaycar.co.nz/duinotech-wearable-esp32-development-board/p/XC3810
-- These were a problem (I had a couple of esphome based projects I wanted to play with) as when I connected them, the logs showed they wouldn't connect to wifi. Logs showed this:
%%"[W][wifi_esp32:495]: Event: Disconnected ssid='myaccesspoint' bssid=[redacted] reason='Auth Expired'"%%
I tried with multiple wifi settings and a couple of access points.
I was about to send them back and wait for the chinese boards, but found this:
https://github.com/espressif/arduino-esp32/issues/2144
There is a bit of a jumble of information in there, but I found that if I pulled the 0 pin to ground via a resistor (they suggested 330 Ohm, but currently I have about 480Ohm) it seems to boot and connect to wifi stably. Time will tell. Also pulling 0 low was often easier to flash the firmware when needed.
Deletions:
--Use the tool to connect to the device, and grab the Mi Keys. Note them down. You won't need them if flashing the custom ATC firmware, but keep for future if needed.
--Flash the latest custom firmware (it is already loaded in the web page)
--Check the website here: if you want to know what the settings do (eg you can change to Fahrenheit, remove the little comfort smiley face, and extend the battery life with less reporting)
-- Put the MAC address for the device(s) and label the Temp/Humidity/Battery for each of the devices with unique names


Revision [7910]

Edited on 2022-05-26 01:58:45 by ZorrUno [added images]

No Differences

Revision [7909]

Edited on 2022-05-26 01:58:45 by ZorrUno [added images]
Additions:
======Cheap Mi Xiaomi BLE LCD Thermometers into Home Assistant======
Deletions:
======Mi Xiaomi Bluetooth Thermometers into Home Assistant======


Revision [7908]

Edited on 2022-05-26 01:57:40 by ZorrUno [added images]

No Differences

Revision [7907]

Edited on 2022-05-26 01:57:40 by ZorrUno [added images]
Additions:
======Mi Xiaomi Bluetooth Thermometers into Home Assistant======
Deletions:
=====Mi Xiaomi Bluetooth Thermometers into Home Assistant=======


Revision [7906]

Edited on 2022-05-26 01:57:22 by ZorrUno [added images]

No Differences

Revision [7905]

The oldest known version of this page was created on 2022-05-26 01:57:21 by ZorrUno [added images]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki