Hi everyone,
I’ve been using Home Assistant with Xiaomi LYWSD03MMC temperature and humidity sensors, and I’m really happy with how they work. However, I’ve noticed an issue when a sensor is unavailable—for example, if the battery dies or it goes out of range. Instead of showing ‘N/A’ or some indication that the sensor isn’t working, it just keeps displaying the last recorded value. This can be misleading because it looks like everything is fine when, in reality, the sensor isn’t reporting anymore.
I’d love to find a way to make it clear when a sensor is unavailable. Ideally, the graph in my dashboard would show a break or interruption when there’s no data, and the current value would display ‘N/A’ or something similar. This would help me quickly identify if a sensor has gone offline without having to check the history manually.
Here’s the configuration I’m using for the sensors:
yaml
esphome:
name: esphome-web-c4b644
friendly_name: ESP32-xiaomi-teplota
esp32:
board: esp32dev
framework:
type: arduino
logger:
api:
encryption:
key: “"
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: ""
password: ""
captive_portal:
esp32_ble_tracker:
scan_parameters:
interval: 300ms
window: 300ms
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”
I’ve tried looking into the sensor settings and the frontend configuration, but I can’t seem to find an option to change how unavailable states are displayed. Is there a way to modify the sensor settings or the frontend to achieve this? Maybe through a custom card or some automation?
Any suggestions or workarounds would be greatly appreciated! I’m really enjoying using Home Assistant, and I’d love to make it even more reliable and user-friendly.
Thanks in advance!
Best regards,
[Your Name]