home-assistant-configuration/config/templates/twitter_stats.yaml

42 lines
3.2 KiB
YAML
Raw Normal View History

2019-07-14 01:38:53 +00:00
>
{# Twitter Stats #}
{%- macro getRandomStat() -%}
{{- [
"Thanks to Home Assistant and Amazon Polly and #AWS I have spoken for {{ states.sensor.speech_time.attributes.value }} in the last 7 days.",
"I am constantly monitoring Anchorage House. For instance I know that the washer has ran for {{ states.sensor.washer_time.attributes.value }} in the last 7 days.",
"I am using {{ states.sensor.sensor_count.state }} sensors to power {{ states.sensor.automation_count.state}} automations and {{ states.sensor.script_count.state}} scripts to automate Anchorage House thanks to Home Assistant.",
2019-07-18 02:08:28 +00:00
"My config on Github (https://github.com/thejeffreystone/home-assistant-configuration) has {{ states.sensor.home_assistant_configuration.attributes.stargazers}} stars and counting. Currently with {{ states.sensor.github_stats.attributes.open_issues }} open #Todo items.",
"I am running Home Assistant version {{ states.sensor.installed_version.state }} (https://github.com/thejeffreystone/home-assistant-configuration)",
2019-07-14 01:38:53 +00:00
"My configuration is at https://github.com/thejeffreystone/home-assistant-configuration and currently has {{ states.sensor.home_assistant_configuration.attributes.stargazers}} stargazers. You could be one too.",
"My configuration is at https://github.com/thejeffreystone/home-assistant-configuration .The last commit was {{ states.sensor.home_assistant_configuration.attributes.latest_commit_message}}.",
"The average temperature inside Anchorage House is {{states.sensor.inside_temp_stats.attributes.mean | round}} degrees fahrenheit.",
"I have been running non-stop for {{states.sensor.time_online.state}} days",
"We have watched the Roku for a total of {{states.sensor.roku_theater_time.attributes.value}} in the last 24 hours.",
"The outside lights were on for a total of {{states.sensor.outside_lights.attributes.value}} in the last 24 hours.",
"The average temperature in the garage is {{states.sensor.garage_temp_stats.attributes.mean | round}} degrees fahrenheit.",
"The HVAC has cooled the house for {{states.sensor.cooling_last_month.attributes.value}} and heated for {{states.sensor.heating_last_month.attributes.value}} in the last month",
"The HVAC has cooled the house for {{states.sensor.cooling_last_day.attributes.value}} and heated for {{states.sensor.heating_last_day.attributes.value}} in the last 24 hours",
"Clouds cover {{states.sensor.cloud_coverage_stats.attributes.mean | round}} of the sky above Anchorage House on average.",
2020-01-03 17:26:25 +00:00
"Amazon Polly enables me to sound more lifelike by incorporate breathing into my speech. #AWS"
2019-07-14 01:38:53 +00:00
] | random -}}
{%- endmacro -%}
{%- macro getTags() -%}
2019-11-15 01:36:20 +00:00
#homeassistant #iot #smarthome #Randomstats
2019-07-14 01:38:53 +00:00
{%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{{ getRandomStat() }}
{{ getTags() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}