jcallaghan / home-assistant-config

My Home Assistant configuration & documentation.
https://www.jcallaghan.com/
MIT License
175 stars 8 forks source link

Project and code template sensors #76

Closed jcallaghan closed 4 years ago

jcallaghan commented 4 years ago

Create template sensors to provide a summary of how many entities, automation and lines of code is within my Home Assistant instance. This will be fun to track in Grafana and review when starting/finishing projects.

Consider a social media sharing function.

{{ states | length }}
{{ states.automation | list | count }}

While {{ find /volume1/docker/home-assistant-config/ -name '*.yaml' | xargs cat | wc -l }} works in the command line, it needs to be adjusted to work within the Home Assistant Core Docker container.

platform: command_line
name: "Total Lines Code (yaml)"
command: " find /config/ -name '*.yaml' | xargs cat | wc -l"

Inspired by Carlo.

jcallaghan commented 4 years ago

I wish I had this when I started out with Home Assistant. This will be fun to keep an eye on and track.

image

jcallaghan commented 4 years ago

Added lights {{ states.light | list | count }}.

jcallaghan commented 4 years ago

image