Merged @zac300's changes back into the repo. nice enhancements.

This commit is contained in:
ccostan 2018-03-24 20:06:16 -04:00
parent b4ec85fd8f
commit 4dd62c457b
2 changed files with 59 additions and 11 deletions

View File

@ -68,12 +68,54 @@ sensor:
duration: duration:
days: 7 days: 7
# - platform: rest ### Building some interesting stats for tweeting. ###
# name: July 4th Countdown - platform: template
# resource: http://api.wolframalpha.com/v1/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%204th%20July%202018 sensors:
# value_template: "{{ (value|replace(' days', '')) | int }}" sensor_count:
# unit_of_measurement: Days friendly_name: 'Number of Sensors'
# scan_interval: 43200``` value_template: >
{%- set domains = ['sensor'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] -%}
{% if loop.first %}
{{loop.length}}
{% endif %}
{%- endfor -%}
{%- endfor -%}
automation_count:
friendly_name: 'Number of Automations'
value_template: >
{%- set domains = ['automation'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] -%}
{% if loop.first %}
{{loop.length}}
{% endif %}
{%- endfor -%}
{%- endfor -%}
script_count:
friendly_name: 'Number of Scripts'
value_template: >
{%- set domains = ['script'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] -%}
{% if loop.first %}
{{loop.length}}
{% endif %}
{%- endfor -%}
{%- endfor -%}
binary_sensor_count:
friendly_name: 'Number of Binary Sensors'
value_template: >
{%- set domains = ['binary_sensor'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] -%}
{% if loop.first %}
{{loop.length}}
{% endif %}
{%- endfor -%}
{%- endfor -%}
group: group:
tweet_stats: tweet_stats:
@ -140,8 +182,8 @@ automation:
hide_entity: True hide_entity: True
trigger: trigger:
- platform: time - platform: time
hours: '/3' hours: '/2'
minutes: 01 minutes: 45
seconds: 00 seconds: 00
condition: condition:
- condition: template - condition: template
@ -159,7 +201,7 @@ automation:
{% set pick = [ {% set pick = [
"minecraft", "minecraft",
"solar", "solar", "solar", "solar",
"robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot","robot","robot",
"door", "door", "door", "door", "door", "door",
"weather", "weather", "weather", "weather", "weather", "weather", "weather", "weather", "weather", "weather", "weather", "weather",
"internet", "internet", "internet", "internet", "internet", "internet", "internet", "internet",

View File

@ -30,7 +30,9 @@ tweet_engine_setup:
"My Home Assistant Database is currently using {{ states('sensor.database_sensor') }} MBs. To get this #Stat for your HA, visit (https://github.com/robmarkcole/HASS-filesize-sensor)", "My Home Assistant Database is currently using {{ states('sensor.database_sensor') }} MBs. To get this #Stat for your HA, visit (https://github.com/robmarkcole/HASS-filesize-sensor)",
"I am running Home Assistant version {{ states('sensor.ha_installed_version') }} (https://github.com/CCOSTAN/Home-AssistantConfig#logo)", "I am running Home Assistant version {{ states('sensor.ha_installed_version') }} (https://github.com/CCOSTAN/Home-AssistantConfig#logo)",
"Home Assistant has been running for {{ states('sensor.ha_uptime') }}. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)", "Home Assistant has been running for {{ states('sensor.ha_uptime') }}. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)",
"My Home Assistant has been tested by Travis-CI and {{states('sensor.ccostanhomeassistantconfig_state')}}. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)" "My Home Assistant has been tested by Travis-CI and {{states('sensor.ccostanhomeassistantconfig_state')}}. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)",
"{{((states.sensor.sensor_count.state | int) + (states.sensor.binary_sensor_count.state | int))}} sensors feed my Smart Home #data. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)",
"{{states.sensor.automation_count.state}} automations and {{states.sensor.script_count.state}} scripts make my home smart (https://github.com/CCOSTAN/Home-AssistantConfig#logo)"
], ],
"door": [ "door": [
@ -96,7 +98,11 @@ tweet_engine_setup:
"/config/www/custom_ui/floorplan/images/branding/servers4.png", "/config/www/custom_ui/floorplan/images/branding/servers4.png",
"/config/www/custom_ui/floorplan/images/branding/robot.png", "/config/www/custom_ui/floorplan/images/branding/robot.png",
"/config/www/custom_ui/floorplan/images/branding/keyboard.png", "/config/www/custom_ui/floorplan/images/branding/keyboard.png",
"/config/www/custom_ui/floorplan/images/branding/repo_ad4.png" "/config/www/custom_ui/floorplan/images/branding/repo_ad4.png",
"/config/www/custom_ui/floorplan/images/branding/repo_ad2.png",
"/config/www/custom_ui/floorplan/images/branding/repo_ad3.png",
"/config/www/custom_ui/floorplan/images/branding/repo_ad.png"
], ],
"door": [ "door": [