Hi,
I want to use Home Assistant (running on Rapsberry PI3) as my home temperature and humidity monitor. I bought 2 XIaomi LYWSD03MMC temperature/humidity sensors, obtained a bind key and flashed the apropriate yaml config to an esp32 dev board:
esphome:
name: esphome-web-c4b644
friendly_name: ESP32-xiaomi-teplota
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "*****************************"
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "************"
password: "***********"
captive_portal:
esp32_ble_tracker:
scan_parameters:
interval: 300ms # try with 300ms if you don't have LAN module
window: 300ms # try with 300ms if you don't have LAN module
active: false
sensor:
- platform: xiaomi_lywsd03mmc
mac_address: "A4:C1:**:**:**:**"
bindkey: "*******************************"
temperature:
name: "LYWSD03MMC Temperature"
humidity:
name: "LYWSD03MMC Humidity"
battery_level:
name: "LYWSD03MMC Battery Level"
- platform: xiaomi_lywsd03mmc
mac_address: "A4:C1:**:**:**:**"
bindkey: "*******************************"
temperature:
name: "Izba Teplota"
humidity:
name: "Izba Vlhkost"
battery_level:
name: "Izba LYWSD03MMC Battery Level"
Everything works fine - I have historical graphs in my HA dashboard and I see the current value of the entity (temperature, humidity, battery) there as well.
But the problem is when a sensor is not available. I reproduced it by removing battery from 1 sensor. I see the last measured temperature and humidity is being kept in the graph - there is a straight line keeps going. Also I see value 25.0 from “3 hours ago”. And also I think it is a bit weird it will show you points wit 5 minutes interval when you hover over the graph line - so you have assumption it works and you just have steady 25.0 degrees all the time.
Is there a way how can i configure it in a way it will be understandable from checking the graph the sensor is not available (battery drain or out of reach for instance)? I mean if the temperature or humidity would not fluctuate much, one would say all works but it can be the sensor broke.
Ideally I would like to have interrupt in the graph line for instance. And also I would think displaying “null” or “n/a” or something like that when I check the entity’s value would make sense.
Thanks much for potential ideas!