Hello.
I am trying to create an uptime sensor showing the number of days a server has been online.
I have an attribute of an entity which gives me the number of hours the server has been online, I just need this in days.
Below is what I have but just get unavailable on the created sensor.
I have other sensors that are using similar math so have no idea why this one just won’t play ball.
- name: ESXi Days Uptime
unit_of_measurement: days
state: >
{{ ((sensor.esxi_vmhost_1.attributes.uptime_hours|int) /24)|round(1) }}
Any assistance would be hugely appreciated. Thanks.