Display "system uptime" for humans (via MQTT)

In my Tinkerforge2mqtt -> HomeAssistant i expose the “uptime” of the host system in seconds via MQTT:

grafik

Another value is the “run time of the script” in seconds:

grafik

I exposed this values with:

  • state_class: measurement
  • device_class: null
  • unit_of_measurement: seconds
  • suggested_display_precision: 0

How can I change this so that the user can get reasonable values in the UI?

Maybe i should try to look into System monitor - Home Assistant sources?!?

That is a terribly inefficient way to do it.

Look at how the HA uptime sensor works.

It sends a timestamp when the system starts.

Which is displayed in the dashboard as:

Screenshot 2024-03-26 at 12-57-39 Administration – Home Assistant

1 Like

Ah. Great. That’s easy. Thanks!

It’s fixed:

grafik

1 Like