112 lines
3.0 KiB
YAML
Executable File
112 lines
3.0 KiB
YAML
Executable File
#-------------------------------------------
|
|
# find me on X @CCOSTAN
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
|
# Updated for AI notifications
|
|
#-------------------------------------------
|
|
|
|
### Building out some Historical stats for AI. #####################
|
|
command_line:
|
|
- sensor:
|
|
name: 'Lines of Code'
|
|
unique_id: lines_of_code
|
|
command: "find /config -name '*.yaml' | xargs cat | wc -l"
|
|
scan_interval: 20000
|
|
|
|
- sensor:
|
|
name: 'GitHub Stats'
|
|
unique_id: github_stats_command
|
|
command: 'curl https://api.github.com/repos/ccostan/home-assistantconfig'
|
|
scan_interval: 20000
|
|
value_template: '{{ value_json.name }}'
|
|
json_attributes:
|
|
- open_issues
|
|
- stargazers_count
|
|
|
|
sensor:
|
|
- platform: history_stats
|
|
name: Speech time
|
|
entity_id: media_player.livingroomCC
|
|
state: 'playing'
|
|
type: time
|
|
end: '{{ now() }}'
|
|
duration:
|
|
hours: 24
|
|
|
|
- platform: history_stats
|
|
name: TV time
|
|
entity_id: media_player.living_room_ultra
|
|
state: 'playing'
|
|
type: time
|
|
end: '{{ now() }}'
|
|
duration:
|
|
hours: 24
|
|
|
|
- platform: history_stats
|
|
name: Landscaping Light time
|
|
entity_id: group.landscaping
|
|
state: 'on'
|
|
type: time
|
|
end: '{{ now() }}'
|
|
duration:
|
|
hours: 24
|
|
|
|
- platform: history_stats
|
|
name: Tesla Charging time
|
|
entity_id: sensor.carlojuice_charging_status
|
|
state: 'charging'
|
|
type: time
|
|
end: '{{ now() }}'
|
|
duration:
|
|
days: 7
|
|
|
|
### Building some interesting stats for tweeting. ###
|
|
- platform: template
|
|
sensors:
|
|
sensor_count:
|
|
friendly_name: 'Number of Sensors'
|
|
value_template: >-
|
|
{{ states.sensor | list | count }}
|
|
|
|
automation_count:
|
|
friendly_name: 'Number of Automations'
|
|
value_template: >-
|
|
{{ states.automation| list | count }}
|
|
|
|
script_count:
|
|
friendly_name: 'Number of Scripts'
|
|
value_template: >
|
|
{{ states.script | list | count }}
|
|
|
|
binary_sensor_count:
|
|
friendly_name: 'Number of Binary Sensors'
|
|
value_template: >-
|
|
{{ states.binary_sensor | list | count }}
|
|
|
|
tracker_count:
|
|
friendly_name: 'Number of Devices'
|
|
value_template: >-
|
|
{{ states.device_tracker| list | count }}
|
|
lights_count:
|
|
friendly_name: 'Number of Lights'
|
|
value_template: >
|
|
{{ states.light | list | count }}
|
|
|
|
protect_count:
|
|
friendly_name: 'Number of Smoke Detectors'
|
|
value_template: >
|
|
{% if states('group.protects') == 'on' %}
|
|
{% for e in states.group.protects.attributes.entity_id if states(e) == 'on' %}
|
|
{% if loop.last %}
|
|
{{ loop.index }}
|
|
{% endif %}
|
|
{%- endfor -%}
|
|
{% else %}
|
|
0
|
|
{% endif %}
|
|
camera_count:
|
|
friendly_name: 'Number of online Cameras'
|
|
value_template: >
|
|
{{ states.camera | list | count }}
|
|
|
|
#############################################################
|