Revision history for MiBluetoothTempESPHome
No Differences
Additions:
CategoryAddedToZorruno
No Differences
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.
==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:
-- 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.
No Differences
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.
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.
No Differences
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.
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:
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.
No Differences
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:
No Differences
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.
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:
Use esphome in an ESP32 dev board to pull the values of these temp sensors and integrate them into home assistant.
No Differences
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"}}
No Differences
Additions:
{{lastedit show="3"}}
--
CategoryHomeAutomation
CategoryESP32
CategoryHomeAssistant
CategoryMQTT
CategoryESPHome
--
CategoryHomeAutomation
CategoryESP32
CategoryHomeAssistant
CategoryMQTT
CategoryESPHome
No Differences
Additions:
{{image url="https://zorruno.com/wp-content/uploads/2022/05/LYWSD03MMC.png" title=" Xiaomi BLE LCD Thermometer" alt=" Xiaomi BLE LCD Thermometer"}}
No Differences
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)
-- 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:
-- 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)
No Differences
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)"
%%
%%
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)"
%%
No Differences
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.
--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:
--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
No Differences
Additions:
======Cheap Mi Xiaomi BLE LCD Thermometers into Home Assistant======
Deletions:
No Differences
Additions:
======Mi Xiaomi Bluetooth Thermometers into Home Assistant======
Deletions:
No Differences