Hi,
I have a USB HD connected to my RasPi that I mount manually.
I want to display the disk use percent when the disk is mounted but I obtain the text “{{ states.sensor.disk_use_percent_usbhd }}”
This is my code in configuration.yaml:
platform: template
sensors:
usbhd_status:
friendly_name: “USB HD Status”
value_template: >-
{% if is_state(‘binary_sensor.usbhd’, ‘on’) %}
“{{ states.sensor.disk_use_percent_usbhd }}”
{% else %}
Disconnect
{% endif %}
Thanks in advance
Gabriel