ESPHOME unknownn Sensor


I got a Temp sensor configured in ESPHOME on a D1 mini
After latest update… the sensor last value does not stay.
How can I let the last value stay…got an automation running on values.

Thnx in advance.
Below is the Config.

name: lya-sensor

board: d1_mini_lite

Enable logging


Enable Home Assistant API



ssid: “”
password: “”

Set this to the IP of the ESP

# Set this to the IP address of the router. Often ends with .1
# The subnet of the network. works for most home networks.

output_power: 8.5dB
power_save_mode: high

Enable fallback hotspot (captive portal) in case wifi connection fails

ssid: “Lya-Sensor Fallback Hotspot”
password: “”


sda: GPIO04
scl: GPIO05
scan: True
id: bus_a


  • platform: bme280
    name: “Lyang Temperature”
    oversampling: 16x
    name: “Lyang Pressure”
    name: “Lyang Humidity”
    address: 0x76
    update_interval: 60s

run_duration: 70s
sleep_duration: 3min

Hi - please follow the guidelines for posting YAML, outlined in this post:

Specifically - post the YAML in pre-formatted text tags - which can be accessed by using the </> button on the posting toolbar.

Sounds like the same issue that I have.

Esphome sensor with 10 minutes deep sleep. Measure, connect, transmit, deep sleep.

Before upstate:
Last value is shown in dashboard and history graph solid line.

After april update:
Last value is unknown and history graph dashed/dotted line.

The value is only shown in the very short time period the sensor is connected to HA.

My other sensor that are always on and connected to HA api, show values.

I have the impression that HA switches to unknown as soon as esphome client disconnects and does not retain the last value in dashboard and history graph.

Same issue - after last update all esphome sensors are in “Unknown” state while device in deep sleep

When you say “last update”, do you mean the ESPHome version to say 2023.3.2? Or the Home Assistant update?

Nothing jumps out in the breaking changes for either…

I think it is the april HA update that was released yesterday. Here in the screenshot you can see it.

21:45 I did the update. Before the line was solid and HA displayed the last value in dashboard. After HA april update 2023.04.0 (it was displayed as Supervisor 2023.04.0 update), the line gets dashed and the value in dashboard is unknown - unless the short periode the sensor connects to api.

I read in release logs, that something in recorder has been modified. Maybe this triggers this effect.

I mostly use MQTT rather than the API for deep sleep devices, along with fast connect WiFi and static IP.

I wonder if that will make a difference? It will be a couple of days before I upgrade HA to test.

1 Like

@zoogara It still works over MQTT for me. I do have both birth and will message set to none though,

1 Like

After updating home assistant to 2023.4.0 and i’m using native api, not mqtt.
Line in the graph became dashed until i’ve downgraded core back to 2023.3.6

Those that have this occurring should probably log an issue on GitHub.

Open a new issue - then each person affected add logs and relevant data to that issue.

Opened issue:

Feel free to contribute

Update: Issue has been located, PR for fix done. Next step: Test needed. More Info in above link.

1 Like

Looks like there is a PR to fix this issue.

Ooops - missed the update on your post :grinning:

Just installed update 2023.4.1. The issue had been fixed. Sensors show last value again till next update. :grinning: