2018-01-02 00:00:45 +00:00
#-------------------------------------------
2019-07-17 00:10:43 +00:00
# This is the configuration account for @BearStoneHA - My Homes automated twitter account.
2018-01-02 00:00:45 +00:00
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
#-------------------------------------------
2023-06-19 20:12:32 +00:00
### Building out some Historical stats for tweeting. #####################
command_line :
- sensor :
name : 'Lines of Code'
unique_id : lines_of_code
command : "find /config -name '*.yaml' | xargs cat | wc -l"
scan_interval : 20000
command_line :
- 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
2018-01-02 00:00:45 +00:00
notify :
- name : BearStoneHA
platform : twitter
consumer_key : !secret twitter_consumer_key
consumer_secret : !secret twitter_consumer_secret
access_token : !secret twitter_access_token
access_token_secret : !secret twitter_access_token_secret
2018-05-11 21:09:54 +00:00
- name : ccostan
2018-05-11 20:39:54 +00:00
platform : twitter
consumer_key : !secret twitter_consumer_key2
consumer_secret : !secret twitter_consumer_secret2
access_token : !secret twitter_access_token2
access_token_secret : !secret twitter_access_token_secret2
2018-05-11 21:09:54 +00:00
2022-04-23 22:37:22 +00:00
# - platform: history_stats
# name: Doorbell Presses
# entity_id: binary_sensor.skybell_front_door_button
# state: 'on'
# type: count
# end: '{{ now() }}'
# duration:
# hours: 24
2023-06-19 20:12:32 +00:00
sensor :
2018-01-22 19:58:22 +00:00
- platform : history_stats
name : Speech time
entity_id : media_player.livingroomCC
state : 'playing'
type : time
end : '{{ now() }}'
duration :
hours : 24
2018-01-07 01:09:59 +00:00
2018-03-01 20:39:35 +00:00
- platform : history_stats
name : TV time
entity_id : media_player.living_room_ultra
state : 'playing'
type : time
end : '{{ now() }}'
duration :
hours : 24
2018-01-02 00:00:45 +00:00
- platform : history_stats
name : Landscaping Light time
entity_id : group.landscaping
state : 'on'
type : time
end : '{{ now() }}'
duration :
hours : 24
2018-03-01 20:39:35 +00:00
- platform : history_stats
2021-07-12 14:00:06 +00:00
name : Tesla Charging time
2018-03-01 20:39:35 +00:00
entity_id : sensor.carlojuice_charging_status
state : 'charging'
type : time
end : '{{ now() }}'
duration :
days : 7
2020-06-24 17:40:34 +00:00
2018-03-25 00:06:16 +00:00
### Building some interesting stats for tweeting. ###
- platform : template
sensors :
sensor_count :
friendly_name : 'Number of Sensors'
2019-09-30 16:57:55 +00:00
value_template : >-
{{ states.sensor | list | count }}
2018-03-25 00:06:16 +00:00
automation_count :
friendly_name : 'Number of Automations'
2019-09-30 16:57:55 +00:00
value_template : >-
{{ states.automation| list | count }}
2018-03-25 00:06:16 +00:00
script_count :
friendly_name : 'Number of Scripts'
value_template : >
2019-09-30 16:57:55 +00:00
{{ states.script | list | count }}
2018-03-25 00:06:16 +00:00
binary_sensor_count :
friendly_name : 'Number of Binary Sensors'
2019-09-30 16:57:55 +00:00
value_template : >-
{{ states.binary_sensor | list | count }}
2018-03-30 14:52:43 +00:00
tracker_count :
friendly_name : 'Number of Devices'
2019-09-30 16:57:55 +00:00
value_template : >-
{{ states.device_tracker| list | count }}
2018-03-30 14:52:43 +00:00
lights_count :
friendly_name : 'Number of Lights'
value_template : >
2019-09-30 16:57:55 +00:00
{{ states.light | list | count }}
2018-04-08 16:03:42 +00:00
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 %}
2018-06-13 01:55:02 +00:00
camera_count :
friendly_name : 'Number of online Cameras'
value_template : >
2019-09-30 16:57:55 +00:00
{{ states.camera | list | count }}
2018-06-13 01:55:02 +00:00
2018-01-02 00:00:45 +00:00
#############################################################
automation :
2020-06-24 17:13:32 +00:00
2018-01-02 00:00:45 +00:00
- alias : 'New Twitter follower!'
2020-07-20 18:33:03 +00:00
id : 61cd0bab-4743-4392-8e43-b204d7ebe817
2018-01-02 00:00:45 +00:00
trigger :
2020-02-14 07:24:03 +00:00
platform : event
event_type : ifttt_webhook_received
event_data :
action : new_follower
2020-02-15 21:22:42 +00:00
2018-01-02 00:00:45 +00:00
condition :
- condition : state
entity_id : group.bed
state : 'off'
2020-06-24 17:40:34 +00:00
2018-01-02 00:00:45 +00:00
action :
- service : media_player.play_media
2020-09-26 14:52:45 +00:00
data :
2018-01-02 00:00:45 +00:00
entity_id :
- media_player.livingroomCC
- media_player.bedroom_alarm_panel
2018-03-01 01:00:44 +00:00
media_content_id : "https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/twitter-chirp.mp3"
2018-01-02 00:00:45 +00:00
media_content_type : audio/mp4
- alias : 'Random House stats'
2020-07-20 18:33:03 +00:00
id : b274a40d-cb67-4d6a-94d1-5fa685ae5ea4
2020-09-18 00:09:56 +00:00
mode : single
2018-01-02 00:00:45 +00:00
trigger :
2019-02-23 23:03:43 +00:00
- platform : time_pattern
2018-03-25 00:06:16 +00:00
hours : '/2'
minutes : 45
2020-09-27 18:09:45 +00:00
2018-01-05 19:45:57 +00:00
condition :
2020-09-27 18:09:45 +00:00
- condition : template
value_template : >
{%- if states.automation.random_house_stats.attributes.last_triggered -%}
{{ (as_timestamp(now()) - as_timestamp(states.automation.random_house_stats.attributes.last_triggered)) > 10000 }}
{%- else -%}
true
{%- endif -%}
2020-09-18 00:09:56 +00:00
2018-01-02 00:00:45 +00:00
action :
2018-06-14 19:33:39 +00:00
- delay : '0{{ range(0,2) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}'
2020-06-27 17:24:25 +00:00
- service : script.tweet_engine_random
2020-09-26 14:52:45 +00:00
data :
2018-03-16 19:23:09 +00:00
pick : >-
{% set pick = [
2019-08-24 18:10:14 +00:00
"solar" ,
"robot" ,
"door" ,
"weather" ,
2018-03-29 13:36:18 +00:00
"cloud" ,
2019-08-24 18:10:14 +00:00
"speedtest" ,
"internet" ,
"stocks" ,
2019-07-23 16:28:29 +00:00
"night" ,
2019-08-24 18:10:14 +00:00
"tv" ,
"promo" ,
2019-07-16 19:40:16 +00:00
"joke"
2018-03-16 19:23:09 +00:00
] %}
{{ pick|random }}
2019-08-02 18:00:49 +00:00
2019-08-02 23:51:35 +00:00
- alias : 'Random YouTube Videos BearStone'
2020-07-20 18:33:03 +00:00
id : b6554d97-a3d1-48e4-9035-632ac622504b
2019-08-02 18:00:49 +00:00
trigger :
- platform : time_pattern
2019-11-24 16:52:54 +00:00
hours : '/7'
2019-08-02 23:51:35 +00:00
minutes : 18
2020-09-27 18:09:45 +00:00
2019-08-02 18:00:49 +00:00
condition :
2020-09-27 18:09:45 +00:00
- condition : template
value_template : >
{%- if states.automation.random_youtube_videos_bearstone.attributes.last_triggered -%}
{{ (as_timestamp(now()) - as_timestamp(states.automation.random_youtube_videos_bearstone.attributes.last_triggered)) > 10000 }}
{%- else -%}
true
{%- endif -%}
2020-09-18 00:09:56 +00:00
2019-08-02 18:00:49 +00:00
action :
- delay : '0{{ range(0,2) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}'
- service : script.tweet_youtube_engine_setup
2020-09-26 14:52:45 +00:00
data :
2020-06-15 21:52:36 +00:00
pick : !include ../templates/speech/youtube_picker.yaml
2019-08-02 23:51:35 +00:00
- alias : 'Random YouTube Videos CCostan'
2020-07-20 18:33:03 +00:00
id : 3e8a4db0-165b-4e1b-acb0-ac4503525660
2020-09-18 00:09:56 +00:00
mode : single
2020-02-06 19:32:18 +00:00
2019-08-02 23:51:35 +00:00
trigger :
- platform : time_pattern
hours : '/22'
minutes : 45
2020-09-18 00:34:57 +00:00
2019-08-02 23:51:35 +00:00
condition :
2020-09-27 18:09:45 +00:00
- condition : template
value_template : >
{%- if states.automation.random_youtube_videos_ccostan.attributes.last_triggered -%}
{{ (as_timestamp(now()) - as_timestamp(states.automation.random_youtube_videos_ccostan.attributes.last_triggered)) > 10000 }}
{%- else -%}
true
{%- endif -%}
2020-09-18 00:09:56 +00:00
2019-08-02 23:51:35 +00:00
action :
- service : script.tweet_youtube_engine_setup
2020-09-26 14:52:45 +00:00
data :
2019-08-02 23:51:35 +00:00
who : 'ccostan'
2020-06-15 21:52:36 +00:00
pick : !include ../templates/speech/youtube_picker.yaml