Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 108213

Command Line Integration in configuration.yaml

$
0
0

I wanted to share my configuration.yaml and how access RAM and CPU parameters and request feedback from the community. Thanks and hopefully it helps others!

# Example configuration.yaml entry
command_line:
  - sensor:
      name: CPU Temperature
      command: "cat /sys/class/thermal/thermal_zone0/temp"
      # If errors occur, make sure configuration file is encoded as UTF-8
      unit_of_measurement: "°C"
      value_template: "{{ value | multiply(0.001) | round(1) }}"


  - sensor:
      name: CPU Usage
      command: 'echo $(top -n 1 | sed -n "2p") | sed -e "s/.*CPU: \(.*\)% usr.*/\1/"'
      unit_of_measurement: "%"
      value_template: "{{ value }}"

  - sensor:
      name: RAM Usage
      command: 'echo $(top -n 1 | sed -n "1p") | sed -e "s/.*Mem: \(.*\)K used.*/\1/"'
      unit_of_measurement: "GB"
      value_template: "{{ value | multiply(0.000001) | round(1) }}"


1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 108213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>