HassOS Uptime Sensor

Whats the best way to get an sensor for the uptime of my HassOS instance? (I’ve got one for the uptime for HA)

On my other VM and physical servers I use an SNMP sensor

EDIT - im an idiot - the systemmonitor integration has a last_boot option, which I’ve been able to convert to something better to read via this

          {%- set time = as_timestamp(now()) - as_timestamp(states.sensor.last_boot.state) | int %}
          {%- set minutes = ((time % 3600) // 60) | int %}
          {%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
          {%- set hours = ((time % 86400) // 3600) | int %}
          {%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
          {%- set days = (time // 86400) | int %}
          {%- set days = '{}d '.format(days) if days > 0 else '' %}
          {{ 'Less than 1 min' if time < 60 else days + hours + minutes }}
1 Like

And you can use this integration

in configuration.yaml >

sensor: 
  - platform: uptime
    name: Time Online
    unit_of_measurement: minutes

‘unit_of_measurement’ no longer listed in the documentation. Was it removed? How do I use this sensor now ?