System Monitor components - CPU load in percent and status of CPU fan?

Hello,
how can I display CPU usage in percent and not just 0.05? Or how to multiply it with 100?
And is it possible to display if fan on my NUC is on/off? cat /sys/class/thermal/cooling_device4/cur_state —> 1 = on and 0 = off?

Thank you.

@bigmike

You’ll want to use a template sensors. Here’s an example for the Template Sensor and Binary Template Sensor:

sensor:
  - platform: template
    sensors:
      cpu_usage:
        friendly_name: "CPU Usage"
        unit_of_measurement: '%'
        value_template: "{{ states.sensor.YOURSENSORNAME.state * 100 }}"
binary_sensor:
  - platform: template
    sensors:
      cpu_fan:
        friendly_name: "CPU Fan"
        value_template: >-
          {% if is_state('sensor.YOURSENSORNAME", 1) %}on
          {% else %}off
          {% endif %}

Thank you!