Skip to content
Discussion options

You must be logged in to vote

It's already there, just not called "uptime". Nodes, VMs and containers each get a Last boot sensor (PROXMOX_SENSOR_UPTIME in sensor.py, built from the uptime the Proxmox API reports). It's a timestamp sensor (now - uptime), so Home Assistant shows it as "3 days ago", which is the uptime. It's enabled by default, so check the node's device page.

If you want the uptime as a number (for graphs or automations), a template sensor on top of it works:

template:
  - sensor:
      - name: "PVE uptime"
        unit_of_measurement: "d"
        state: >
          {{ ((now() - as_datetime(states('sensor.YOUR_NODE_last_boot'))).total_seconds() / 86400) | round(1) }}

Replace sensor.YOUR_NODE_last_boot …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shurakenas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants