Enhance stats.yaml by adding new sensors for GitHub open issues and stargazers, updating existing sensor configurations for better measurement clarity. Adjust unit_of_measurement and state_class for improved data representation.

pull/1524/head
Carlo Costanzo 7 months ago
parent 3ea4050f64
commit 43299b9039

@ -11,16 +11,30 @@ command_line:
unique_id: lines_of_code unique_id: lines_of_code
command: "find /config -name '*.yaml' | xargs cat | wc -l" command: "find /config -name '*.yaml' | xargs cat | wc -l"
scan_interval: 20000 scan_interval: 20000
value_template: "{{ value | int }}"
unit_of_measurement: "lines"
state_class: measurement
device_class: measurement
- sensor: - sensor:
name: 'GitHub Stats' name: 'GitHub Open Issues'
unique_id: github_stats_command unique_id: github_open_issues
command: 'curl https://api.github.com/repos/ccostan/home-assistantconfig' command: 'curl -s https://api.github.com/repos/ccostan/home-assistantconfig'
scan_interval: 20000 scan_interval: 20000
value_template: '{{ value_json.name }}' value_template: '{{ value_json.open_issues }}'
json_attributes: unit_of_measurement: 'issues'
- open_issues state_class: measurement
- stargazers_count device_class: count
- sensor:
name: 'GitHub Stargazers'
unique_id: github_stargazers
command: 'curl -s https://api.github.com/repos/ccostan/home-assistantconfig'
scan_interval: 20000
value_template: '{{ value_json.stargazers_count }}'
unit_of_measurement: 'stars'
state_class: measurement
device_class: count
sensor: sensor:
- platform: history_stats - platform: history_stats
@ -66,22 +80,29 @@ sensor:
friendly_name: 'Number of Sensors' friendly_name: 'Number of Sensors'
value_template: >- value_template: >-
{{ states.sensor | list | count }} {{ states.sensor | list | count }}
unit_of_measurement: 'count'
icon_template: mdi:counter
automation_count: automation_count:
friendly_name: 'Number of Automations' friendly_name: 'Number of Automations'
value_template: >- value_template: >-
{{ states.automation| list | count }} {{ states.automation | list | count }}
unit_of_measurement: 'count'
icon_template: mdi:robot
script_count: script_count:
friendly_name: 'Number of Scripts' friendly_name: 'Number of Scripts'
value_template: > value_template: >-
{{ states.script | list | count }} {{ states.script | list | count }}
unit_of_measurement: 'count'
icon_template: mdi:script-text
binary_sensor_count: binary_sensor_count:
friendly_name: 'Number of Binary Sensors' friendly_name: 'Number of Binary Sensors'
value_template: >- value_template: >-
{{ states.binary_sensor | list | count }} {{ states.binary_sensor | list | count }}
unit_of_measurement: 'count'
icon_template: mdi:binary-sensor
tracker_count: tracker_count:
friendly_name: 'Number of Devices' friendly_name: 'Number of Devices'
value_template: >- value_template: >-

Loading…
Cancel
Save

Powered by TurnKey Linux.