Uptime sensor history visualization

Hi,

I created a new ESPHome device with an uptime sensor. However, when I open history, it shows a graph with numbers of seconds which is not very user-friendly (lower one in the screenshot). I noticed that some devices (such as SLZB-06M) show data in a different format that I like better (upper one in the screenshot).

Is it possible to change that somehow?

Uptime sensors should report the date and time the device started, not the number of seconds since the last restart. Using seconds floods the recorder database with unneeded updates every time the number of seconds changes.

This WTH month does not cover ESPHome. However your fix is simple. Change your ESPHome config from this:

sensor:
  - platform: uptime
    type: seconds
    name: Uptime Sensor

To this:

sensor:
  - platform: uptime
    type: timestamp
    name: Uptime Sensor

And add a time component: https://esphome.io/#time-components

This is covered in the uptime sensor documentation: https://esphome.io/components/sensor/uptime.html#configuration-variables

1 Like

Thanks a lot. I was looking in wrong place… in UI.

1 Like