From 9eed84ee34b3abfb4b5fb9e5edf081f1a5e801c1 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Mon, 17 Jan 2022 20:19:42 +0100 Subject: [PATCH] added scripts et al --- automations.yaml | 1 - configuration.yaml | 7 +- include/automations/countdown.yaml | 47 ++++ include/automations/receiver_sonos.yaml | 39 +++ include/binary_sensors/hue.yaml | 2 + include/binary_sensors/motion_stue.yaml | 11 + include/binary_sensors/workday.yaml | 56 +++++ include/lights/daniel.yaml | 6 + include/lights/gang.yaml | 6 + include/lights/grupper.yaml | 136 +++++++++++ include/lights/sovevaerelse.yaml | 14 ++ include/scripts/andreas_color_scene.yaml | 70 ++++++ include/scripts/andreas_scene.yaml | 210 ++++++++++++++++ include/scripts/bed_color_scene.yaml | 70 ++++++ include/scripts/bed_scene.yaml | 210 ++++++++++++++++ include/scripts/daniel_color_scene.yaml | 70 ++++++ include/scripts/daniel_scene.yaml | 294 +++++++++++++++++++++++ include/scripts/have_color_scene.yaml | 70 ++++++ include/scripts/have_scene.yaml | 294 +++++++++++++++++++++++ include/scripts/monthly_color_scene.yaml | 70 ++++++ include/scripts/monthly_scene.yaml | 294 +++++++++++++++++++++++ include/scripts/sonos_announce.yaml | 61 +++++ include/scripts/sonos_say.yaml | 24 ++ include/sensors/countdowns.yaml | 22 ++ 24 files changed, 2082 insertions(+), 2 deletions(-) delete mode 100755 automations.yaml create mode 100644 include/automations/countdown.yaml create mode 100644 include/automations/receiver_sonos.yaml create mode 100644 include/binary_sensors/hue.yaml create mode 100644 include/binary_sensors/motion_stue.yaml create mode 100644 include/binary_sensors/workday.yaml create mode 100644 include/lights/daniel.yaml create mode 100644 include/lights/gang.yaml create mode 100644 include/lights/grupper.yaml create mode 100644 include/lights/sovevaerelse.yaml create mode 100644 include/scripts/andreas_color_scene.yaml create mode 100644 include/scripts/andreas_scene.yaml create mode 100644 include/scripts/bed_color_scene.yaml create mode 100644 include/scripts/bed_scene.yaml create mode 100644 include/scripts/daniel_color_scene.yaml create mode 100644 include/scripts/daniel_scene.yaml create mode 100644 include/scripts/have_color_scene.yaml create mode 100644 include/scripts/have_scene.yaml create mode 100644 include/scripts/monthly_color_scene.yaml create mode 100644 include/scripts/monthly_scene.yaml create mode 100644 include/scripts/sonos_announce.yaml create mode 100644 include/scripts/sonos_say.yaml create mode 100644 include/sensors/countdowns.yaml diff --git a/automations.yaml b/automations.yaml deleted file mode 100755 index 0637a08..0000000 --- a/automations.yaml +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml index f32e32b..c833ad7 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -90,7 +90,12 @@ weather: group: !include_dir_merge_named include/groups/ sensor: !include_dir_merge_list include/sensors/ +automation: !include_dir_merge_list include/automations/ -automation: !include automations.yaml + script: !include scripts.yaml scene: !include scenes.yaml + + +# PYTHON +python_script: diff --git a/include/automations/countdown.yaml b/include/automations/countdown.yaml new file mode 100644 index 0000000..962f0b1 --- /dev/null +++ b/include/automations/countdown.yaml @@ -0,0 +1,47 @@ +- alias: Update countdowns + trigger: + - platform: time + at: "00:00:01" + - platform: homeassistant + event: start + action: + - service: python_script.date_countdown + data: + name: Nytaar + type: nedtaelling + date: 31/12/2021 + - service: python_script.date_countdown + data: + name: Juleaften + type: nedtaelling + date: 24/12/2021 + - service: python_script.date_countdown + data: + name: Vores bryllupsdag + type: begivenhed + date: 21/09/2013 + - service: python_script.date_countdown + data: + name: Anne + type: fodselsdag + date: 12/09/1976 + - service: python_script.date_countdown + data: + name: Andreas + type: fodselsdag + date: 04/01/2010 + - service: python_script.date_countdown + data: + name: Daniel + type: fodselsdag + date: 21/09/2011 + - service: python_script.date_countdown + data: + name: Claus + type: fodselsdag + date: 24/12/1971 + - service: python_script.date_countdown + data: + name: Ferie + type: nedtaelling + date: 19/02/2022 diff --git a/include/automations/receiver_sonos.yaml b/include/automations/receiver_sonos.yaml new file mode 100644 index 0000000..617e877 --- /dev/null +++ b/include/automations/receiver_sonos.yaml @@ -0,0 +1,39 @@ + - alias: "Receiver On when Sonos plays in stue" + trigger: + - platform: state + entity_id: media_player.stue + from: 'paused' + to: 'playing' + action: + - service: media_player.turn_on + entity_id: media_player.denon_avr_x2300w + - delay: '00:00:10' + - service: media_player.select_source + data: + entity_id: media_player.denon_avr_x2300w + source: Sonos + - service: media_player.volume_set + data: + entity_id: media_player.stue + volume_level: 1.00 + - service: media_player.volume_set + data: + entity_id: media_player.denon_avr_x2300w + volume_level: 0.30 + - alias: "Receiver Off when Sonos stops playing in stue" + trigger: + - platform: state + entity_id: media_player.stue + from: 'playing' + to: 'paused' + action: + - service: media_player.select_source + data: + entity_id: media_player.denon_avr_x2300w + source: TV Audio + - service: media_player.volume_set + data: + entity_id: media_player.denon_avr_x2300w + volume_level: 0.30 + - service: media_player.turn_off + entity_id: media_player.denon_avr_x2300w diff --git a/include/binary_sensors/hue.yaml b/include/binary_sensors/hue.yaml new file mode 100644 index 0000000..dfc8dc7 --- /dev/null +++ b/include/binary_sensors/hue.yaml @@ -0,0 +1,2 @@ +# - platform: huesensor + diff --git a/include/binary_sensors/motion_stue.yaml b/include/binary_sensors/motion_stue.yaml new file mode 100644 index 0000000..3f4eb59 --- /dev/null +++ b/include/binary_sensors/motion_stue.yaml @@ -0,0 +1,11 @@ + - platform: rest + name: "Stue Motion Sensor" + resource: !secret stue_url + device_class: motion + scan_interval: 10 + value_template: >- + {%- if "2" in value -%} + {{ true }} + {%- else -%} + {{ false }} + {%- endif -%} diff --git a/include/binary_sensors/workday.yaml b/include/binary_sensors/workday.yaml new file mode 100644 index 0000000..fd54841 --- /dev/null +++ b/include/binary_sensors/workday.yaml @@ -0,0 +1,56 @@ + - platform: workday + name: Arbejdsdag + country: DK + add_holidays: + - '2020-03-13' + - '2020-03-14' + - '2020-03-16' + - '2020-03-17' + - '2020-03-18' + - '2020-03-19' + - '2020-03-20' + - '2020-03-23' + - '2020-03-24' + - '2020-03-25' + - '2020-03-26' + - '2020-03-27' + - '2020-03-30' + - '2020-03-31' + - '2020-04-01' + - '2020-04-02' + - '2020-04-03' + - '2020-04-06' + - '2020-04-07' + - '2020-04-08' + - '2020-05-22' + - '2020-06-05' + - '2020-07-13' + - '2020-07-14' + - '2020-07-15' + - '2020-07-16' + - '2020-07-17' + - '2020-07-20' + - '2020-07-21' + - '2020-07-22' + - '2020-07-23' + - '2020-07-24' + - '2020-07-27' + - '2020-07-28' + - '2020-07-29' + - '2020-07-30' + - '2020-07-31' + - '2020-10-12' + - '2020-10-13' + - '2020-10-14' + - '2020-10-15' + - '2020-10-16' + - '2020-12-22' + - '2020-12-23' + - '2020-12-24' + - '2020-12-25' + - '2020-12-26' + - '2020-12-27' + - '2020-12-28' + - '2020-12-29' + - '2020-12-30' + - '2020-12-31' diff --git a/include/lights/daniel.yaml b/include/lights/daniel.yaml new file mode 100644 index 0000000..d95422e --- /dev/null +++ b/include/lights/daniel.yaml @@ -0,0 +1,6 @@ +- platform: group + name: Daniels værelse + entities: + - light.daniel + - light.bamse + diff --git a/include/lights/gang.yaml b/include/lights/gang.yaml new file mode 100644 index 0000000..6752973 --- /dev/null +++ b/include/lights/gang.yaml @@ -0,0 +1,6 @@ +#- platform: group +# name: Gang +# entities: +# - light.gang_nord +# - light.gang_syd + diff --git a/include/lights/grupper.yaml b/include/lights/grupper.yaml new file mode 100644 index 0000000..f72aa38 --- /dev/null +++ b/include/lights/grupper.yaml @@ -0,0 +1,136 @@ +- platform: group + name: gang + entities: + - light.fordelingsgang_1 + - light.fordelingsgang_2 + - light.fordelingsgang_3 + - light.fordelingsgang_4 + - light.fordelingsgang_5 + +- platform: group + name: Indendørslamper + entities: + - light.andreas + - light.hue_lightstrip_plus_1 + - light.daniel + - light.bamse + - light.hue_lightstrip_plus_1_2 + - light.raket + - light.stol + - light.stue + - light.badevaerelse + - light.sovevaerelse + - light.gang + - light.forgang + - light.sauna + - light.sonoff_10006a2cdd + +- platform: group + name: badevaerelse + entities: + - light.hue_color_spot_1 + - light.hue_color_spot_2 + - light.hue_color_spot_1_2 + - light.hue_color_spot_2_2 + +- platform: group + name: livingroom + entities: + - light.raket + - light.stol + - light.stue + +- platform: group + name: kids + entities: + - light.andreas + - light.daniel + - light.bamse + +- platform: group + name: bed + entities: + - light.anne + - light.claus + - light.bamse + +- platform: group + name: bedroom + entities: + - light.anne + - light.claus + - light.sovevaerelse_loft + +- platform: group + name: Indkørsel + entities: + - light.indkorsel_plug + - light.udendors_forgang + +- platform: group + name: Udendørslamper + entities: + - light.garage + - light.indkorsel_plug + - light.fordoer + - light.sonoff_100069a6cc # 1 (rønnebær) + - light.sonoff_10006a2cdd # 2 (juletræ) + - light.sonoff_1000a77121 # 4 (terasse) + - light.sonoff_1000a76e41 # 3 (paradisæbletræ) + +# - switch.sonoff_100069a6cc +# - switch.sonoff_10006a2cdd +# - switch.sonoff_1000a76e41 + +- platform: group + name: drivhus + entities: + - light.sonoff_1000a76e41 # 3 (drivhus) + +- platform: group + name: ronnebaer + entities: + - light.sonoff_100069a6cc # 1 (rønnebær) + +- platform: group + name: koste + entities: + - light.sonoff_10006a2cdd # 2 (koste) + +- platform: group + name: terasse + entities: + - light.sonoff_1000a77121 #4 (terasse) + +- platform: group + name: paradis + entities: + - light.sonoff_1000a721a1 #10 (paradis) + +- platform: group + name: julelys + entities: + - light.ronnebaer + - light.koste + - light.terasse + - light.paradis + +# - light.sonoff_1000a77121 # 4 (terasse) +# - light.sonoff_1000a76e41 # 3 (paradisæbletræ) +# - light.sonoff_1000a70ca0 # 6 (juletræ) + +- platform: group + name: Havelys + entities: + - light.hue_outdoor_spot_1 + - light.hue_outdoor_spot_2 + - light.hue_outdoor_spot_3 + +- platform: group + name: Alle lys + entities: + - light.indendorslamper + - light.udendorslamper + + + diff --git a/include/lights/sovevaerelse.yaml b/include/lights/sovevaerelse.yaml new file mode 100644 index 0000000..11a9920 --- /dev/null +++ b/include/lights/sovevaerelse.yaml @@ -0,0 +1,14 @@ +#- platform: group +# name: Sovevaerelse_loft +# entities: +# - light.sov1 +# - light.sov2 + +- platform: group + name: Soveværelse + entities: +# - light.sov1 +# - light.sov2 + - light.claus + - light.anne + diff --git a/include/scripts/andreas_color_scene.yaml b/include/scripts/andreas_color_scene.yaml new file mode 100644 index 0000000..0a48e18 --- /dev/null +++ b/include/scripts/andreas_color_scene.yaml @@ -0,0 +1,70 @@ +#------------------------------------------- +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Youtube Video description of how I use this script +# https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html +# http://www.vmwareinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html +# https://www.vcloudinfo.com/2019/02/breaking-down-the-flag-sensor-in-home-assistant.html +###################################################################################################### +###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down. +# action: +# - service: script.monthly_color_scene +# +# scenes should be named month_[01-12]_colors (month_06_colors) +# Color help - http://www.esbnyc.com/explore/tower-lights/calendar +###################################################################################################### + +andreas_color_scene: + sequence: +# - condition: state +# entity_id: sun.sun +# state: 'below_horizon' + + - service: script.turn_on + data_template: + entity_id: > + script.andreas_ + {%- if now().strftime("%m%d")|int == 101 -%} + new_years_day + {%- elif now().strftime("%m%d")|int >= 210 + and now().strftime("%m%d")|int <= 214 -%} + valentine + {%- elif now().strftime("%m%d")|int == 305 -%} + mardi_gras + {%- elif now().strftime("%m%d")|int == 314 -%} + pi + {%- elif now().strftime("%m%d")|int >= 315 + and now().strftime("%m%d")|int <= 317 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 324 + and now().strftime("%m%d")|int <= 330 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 401 + and now().strftime("%m%d")|int <= 413 -%} + easter + {%- elif now().strftime("%m%d")|int == 504 -%} + starwars + {%- elif now().strftime("%m%d")|int == 505 -%} + cinco_de_mayo + {%- elif now().strftime("%m%d")|int == 510 -%} + mothers_day + {%- elif now().strftime("%m%d")|int == 605 -%} + fathers_day + {%- elif now().strftime("%m%d")|int >= 1029 + and now().strftime("%m%d")|int <= 1031 -%} + halloween + {%- elif now().strftime("%m%d")|int >= 1128 + and now().strftime("%m%d")|int <= 1130 -%} + thanksgiving + {%- elif now().strftime("%m%d")|int >= 1125 + and now().strftime("%m%d")|int <= 1230 -%} + christmas + {%- elif now().strftime("%m%d")|int == 1231 -%} + new_years_day + {%- else -%} + standard + {%- endif -%}_colors + + +# http://www.calendar-365.com/holidays/2020.html +# Updated for 2020 diff --git a/include/scripts/andreas_scene.yaml b/include/scripts/andreas_scene.yaml new file mode 100644 index 0000000..470dec3 --- /dev/null +++ b/include/scripts/andreas_scene.yaml @@ -0,0 +1,210 @@ +andreas_standard_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + +andreas_valentine_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Crimson' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Crimson' + brightness_pct: 80 +# transition: 30 + +andreas_mardi_gras_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Purple' + brightness_pct: 80 +# transition: 30 + +andreas_pi_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + rgb_color: [3,14,159] + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + rgb_color: [3,14,159] + brightness_pct: 80 +# transition: 30 + +andreas_st_patty_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Green' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Green' + brightness_pct: 80 +# transition: 30 + +andreas_easter_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Yellow' + brightness_pct: 80 +# transition: 30 + +andreas_starwars_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + rgb_color: [204,0,0] + brightness_pct: 80 +# transition: 30 + +andreas_cinco_de_mayo_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + rgb_color: [204,0,0] + brightness_pct: 80 +# transition: 30 + +andreas_mothers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + rgb_color: [244,187,255] + brightness_pct: 80 +# transition: 30 + +andreas_fathers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Orange' + brightness_pct: 80 +# transition: 30 + +andreas_halloween_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + rgb_color: [235,97,35] + brightness_pct: 80 +# transition: 30 + +andreas_thanksgiving_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Orange' + brightness_pct: 80 +# transition: 30 + +andreas_christmas_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Red' + brightness_pct: 80 +# transition: 30 + +andreas_new_years_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.andreas + color_name: 'Gold' + brightness_pct: 80 +# transition: 30 + - service: light.turn_on + data: + entity_id: light.andreas_lysstrip + color_name: 'Blue' + brightness_pct: 80 +# transition: 30 + diff --git a/include/scripts/bed_color_scene.yaml b/include/scripts/bed_color_scene.yaml new file mode 100644 index 0000000..b93fe3c --- /dev/null +++ b/include/scripts/bed_color_scene.yaml @@ -0,0 +1,70 @@ +#------------------------------------------- +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Youtube Video description of how I use this script +# https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html +# http://www.vmwareinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html +# https://www.vcloudinfo.com/2019/02/breaking-down-the-flag-sensor-in-home-assistant.html +###################################################################################################### +###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down. +# action: +# - service: script.monthly_color_scene +# +# scenes should be named month_[01-12]_colors (month_06_colors) +# Color help - http://www.esbnyc.com/explore/tower-lights/calendar +###################################################################################################### + +bed_color_scene: + sequence: +# - condition: state +# entity_id: sun.sun +# state: 'below_horizon' + + - service: script.turn_on + data_template: + entity_id: > + script.bed_ + {%- if now().strftime("%m%d")|int == 101 -%} + new_years_day + {%- elif now().strftime("%m%d")|int >= 210 + and now().strftime("%m%d")|int <= 214 -%} + valentine + {%- elif now().strftime("%m%d")|int == 305 -%} + mardi_gras + {%- elif now().strftime("%m%d")|int == 314 -%} + pi + {%- elif now().strftime("%m%d")|int >= 315 + and now().strftime("%m%d")|int <= 317 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 324 + and now().strftime("%m%d")|int <= 330 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 401 + and now().strftime("%m%d")|int <= 413 -%} + easter + {%- elif now().strftime("%m%d")|int == 504 -%} + starwars + {%- elif now().strftime("%m%d")|int == 505 -%} + cinco_de_mayo + {%- elif now().strftime("%m%d")|int == 510 -%} + mothers_day + {%- elif now().strftime("%m%d")|int == 605 -%} + fathers_day + {%- elif now().strftime("%m%d")|int >= 1001 + and now().strftime("%m%d")|int <= 1031 -%} + halloween + {%- elif now().strftime("%m%d")|int >= 1128 + and now().strftime("%m%d")|int <= 1130 -%} + thanksgiving + {%- elif now().strftime("%m%d")|int >= 1125 + and now().strftime("%m%d")|int <= 1230 -%} + christmas + {%- elif now().strftime("%m%d")|int == 1231 -%} + new_years_day + {%- else -%} + standard + {%- endif -%}_colors + + +# http://www.calendar-365.com/holidays/2020.html +# Updated for 2020 diff --git a/include/scripts/bed_scene.yaml b/include/scripts/bed_scene.yaml new file mode 100644 index 0000000..87ecda9 --- /dev/null +++ b/include/scripts/bed_scene.yaml @@ -0,0 +1,210 @@ +bed_standard_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + +bed_valentine_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + +bed_mardi_gras_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Purple' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +bed_pi_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + +bed_st_patty_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Green' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +bed_easter_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Yellow' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + rgb_color: [255,193,204] + brightness_pct: 80 + transition: 900 + +bed_starwars_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 900 + +bed_cinco_de_mayo_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 900 + +bed_mothers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 900 + +bed_fathers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Blue' + brightness_pct: 80 + transition: 900 + +bed_halloween_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + rgb_color: [96,0,128] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + rgb_color: [235,97,35] + brightness_pct: 80 + transition: 900 + +bed_thanksgiving_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + +bed_christmas_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Red' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +bed_new_years_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.anne + color_name: 'Blue' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.claus + color_name: 'Yellow' + brightness_pct: 80 + transition: 900 + diff --git a/include/scripts/daniel_color_scene.yaml b/include/scripts/daniel_color_scene.yaml new file mode 100644 index 0000000..8725c2c --- /dev/null +++ b/include/scripts/daniel_color_scene.yaml @@ -0,0 +1,70 @@ +#------------------------------------------- +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Youtube Video description of how I use this script +# https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html +# http://www.vmwareinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html +# https://www.vcloudinfo.com/2019/02/breaking-down-the-flag-sensor-in-home-assistant.html +###################################################################################################### +###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down. +# action: +# - service: script.monthly_color_scene +# +# scenes should be named month_[01-12]_colors (month_06_colors) +# Color help - http://www.esbnyc.com/explore/tower-lights/calendar +###################################################################################################### + +daniel_color_scene: + sequence: +# - condition: state +# entity_id: sun.sun +# state: 'below_horizon' + + - service: script.turn_on + data_template: + entity_id: > + script.daniel_ + {%- if now().strftime("%m%d")|int == 101 -%} + new_years_day + {%- elif now().strftime("%m%d")|int >= 210 + and now().strftime("%m%d")|int <= 214 -%} + valentine + {%- elif now().strftime("%m%d")|int == 305 -%} + mardi_gras + {%- elif now().strftime("%m%d")|int == 314 -%} + pi + {%- elif now().strftime("%m%d")|int >= 315 + and now().strftime("%m%d")|int <= 317 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 324 + and now().strftime("%m%d")|int <= 330 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 401 + and now().strftime("%m%d")|int <= 413 -%} + easter + {%- elif now().strftime("%m%d")|int == 504 -%} + starwars + {%- elif now().strftime("%m%d")|int == 505 -%} + cinco_de_mayo + {%- elif now().strftime("%m%d")|int == 510 -%} + mothers_day + {%- elif now().strftime("%m%d")|int == 605 -%} + fathers_day + {%- elif now().strftime("%m%d")|int >= 1029 + and now().strftime("%m%d")|int <= 1031 -%} + halloween + {%- elif now().strftime("%m%d")|int >= 1128 + and now().strftime("%m%d")|int <= 1130 -%} + thanksgiving + {%- elif now().strftime("%m%d")|int >= 1125 + and now().strftime("%m%d")|int <= 1230 -%} + christmas + {%- elif now().strftime("%m%d")|int == 1231 -%} + new_years_day + {%- else -%} + standard + {%- endif -%}_colors + + +# http://www.calendar-365.com/holidays/2020.html +# Updated for 2020 diff --git a/include/scripts/daniel_scene.yaml b/include/scripts/daniel_scene.yaml new file mode 100644 index 0000000..c8b12c4 --- /dev/null +++ b/include/scripts/daniel_scene.yaml @@ -0,0 +1,294 @@ +daniel_standard_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + +daniel_valentine_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Crimson' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Crimson' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Crimson' + brightness_pct: 80 + transition: 300 + +daniel_mardi_gras_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Purple' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Green' + brightness_pct: 80 + transition: 300 + +daniel_pi_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 300 + +daniel_st_patty_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Green' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Green' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Green' + brightness_pct: 80 + transition: 300 + +daniel_easter_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Yellow' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + rgb_color: [255,193,204] + brightness_pct: 80 + transition: 300 + +daniel_starwars_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 300 + +daniel_cinco_de_mayo_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 300 + +daniel_mothers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 300 + +daniel_fathers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Orange' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Blue' + brightness_pct: 80 + transition: 300 + +daniel_halloween_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + rgb_color: [235,97,35] + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + rgb_color: [127,14,0] + brightness_pct: 80 + transition: 300 + +daniel_thanksgiving_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Orange' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Orange' + brightness_pct: 80 + transition: 300 + +daniel_christmas_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Red' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Green' + brightness_pct: 80 + transition: 300 + +daniel_new_years_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.daniel + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.daniel_lysstrip + color_name: 'Blue' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.bamse + color_name: 'Yellow' + brightness_pct: 80 + transition: 300 + diff --git a/include/scripts/have_color_scene.yaml b/include/scripts/have_color_scene.yaml new file mode 100644 index 0000000..1872429 --- /dev/null +++ b/include/scripts/have_color_scene.yaml @@ -0,0 +1,70 @@ +#------------------------------------------- +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Youtube Video description of how I use this script +# https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html +# http://www.vmwareinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html +# https://www.vcloudinfo.com/2019/02/breaking-down-the-flag-sensor-in-home-assistant.html +###################################################################################################### +###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down. +# action: +# - service: script.have_color_scene +# +# scenes should be named month_[01-12]_colors (month_06_colors) +# Color help - http://www.esbnyc.com/explore/tower-lights/calendar +###################################################################################################### + +have_color_scene: + sequence: +# - condition: state +# entity_id: sun.sun +# state: 'below_horizon' + + - service: script.turn_on + data_template: + entity_id: > + script.have_ + {%- if now().strftime("%m%d")|int == 101 -%} + new_years_day + {%- elif now().strftime("%m%d")|int >= 210 + and now().strftime("%m%d")|int <= 214 -%} + valentine + {%- elif now().strftime("%m%d")|int == 305 -%} + mardi_gras + {%- elif now().strftime("%m%d")|int == 314 -%} + pi + {%- elif now().strftime("%m%d")|int >= 315 + and now().strftime("%m%d")|int <= 317 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 324 + and now().strftime("%m%d")|int <= 330 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 401 + and now().strftime("%m%d")|int <= 413 -%} + easter + {%- elif now().strftime("%m%d")|int == 504 -%} + starwars + {%- elif now().strftime("%m%d")|int == 505 -%} + cinco_de_mayo + {%- elif now().strftime("%m%d")|int == 510 -%} + mothers_day + {%- elif now().strftime("%m%d")|int == 605 -%} + fathers_day + {%- elif now().strftime("%m%d")|int >= 1001 + and now().strftime("%m%d")|int <= 1031 -%} + halloween + {%- elif now().strftime("%m%d")|int >= 1128 + and now().strftime("%m%d")|int <= 1130 -%} + thanksgiving + {%- elif now().strftime("%m%d")|int >= 1125 + and now().strftime("%m%d")|int <= 1230 -%} + christmas + {%- elif now().strftime("%m%d")|int == 1231 -%} + new_years_day + {%- else -%} + standard + {%- endif -%}_colors + + +# http://www.calendar-365.com/holidays/2020.html +# Updated for 2020 diff --git a/include/scripts/have_scene.yaml b/include/scripts/have_scene.yaml new file mode 100644 index 0000000..c2c96fb --- /dev/null +++ b/include/scripts/have_scene.yaml @@ -0,0 +1,294 @@ +have_standard_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 50 + transition: 300 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + +have_valentine_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + +have_mardi_gras_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Purple' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +have_pi_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + +have_st_patty_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Green' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Green' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +have_easter_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Yellow' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + rgb_color: [255,193,204] + brightness_pct: 80 + transition: 900 + +have_starwars_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 900 + +have_cinco_de_mayo_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 900 + +have_mothers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 900 + +have_fathers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Blue' + brightness_pct: 80 + transition: 900 + +have_halloween_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + rgb_color: [235,97,35] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + rgb_color: [235,97,35] + brightness_pct: 80 + transition: 900 + +have_thanksgiving_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + +have_christmas_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Red' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +have_new_years_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_1 + color_name: 'Gold' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_2 + color_name: 'Blue' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.hue_outdoor_spot_3 + color_name: 'Yellow' + brightness_pct: 80 + transition: 900 + diff --git a/include/scripts/monthly_color_scene.yaml b/include/scripts/monthly_color_scene.yaml new file mode 100644 index 0000000..69e75e5 --- /dev/null +++ b/include/scripts/monthly_color_scene.yaml @@ -0,0 +1,70 @@ +#------------------------------------------- +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Youtube Video description of how I use this script +# https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html +# http://www.vmwareinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html +# https://www.vcloudinfo.com/2019/02/breaking-down-the-flag-sensor-in-home-assistant.html +###################################################################################################### +###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down. +# action: +# - service: script.monthly_color_scene +# +# scenes should be named month_[01-12]_colors (month_06_colors) +# Color help - http://www.esbnyc.com/explore/tower-lights/calendar +###################################################################################################### + +monthly_color_scene: + sequence: +# - condition: state +# entity_id: sun.sun +# state: 'below_horizon' + + - service: script.turn_on + data_template: + entity_id: > + script.monthly_ + {%- if now().strftime("%m%d")|int == 101 -%} + new_years_day + {%- elif now().strftime("%m%d")|int >= 210 + and now().strftime("%m%d")|int <= 214 -%} + valentine + {%- elif now().strftime("%m%d")|int == 305 -%} + mardi_gras + {%- elif now().strftime("%m%d")|int == 314 -%} + pi + {%- elif now().strftime("%m%d")|int >= 315 + and now().strftime("%m%d")|int <= 317 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 324 + and now().strftime("%m%d")|int <= 330 -%} + st_patty + {%- elif now().strftime("%m%d")|int >= 401 + and now().strftime("%m%d")|int <= 413 -%} + easter + {%- elif now().strftime("%m%d")|int == 504 -%} + starwars + {%- elif now().strftime("%m%d")|int == 505 -%} + cinco_de_mayo + {%- elif now().strftime("%m%d")|int == 510 -%} + mothers_day + {%- elif now().strftime("%m%d")|int == 605 -%} + fathers_day + {%- elif now().strftime("%m%d")|int >= 1020 + and now().strftime("%m%d")|int <= 1031 -%} + halloween + {%- elif now().strftime("%m%d")|int >= 1128 + and now().strftime("%m%d")|int <= 1130 -%} + thanksgiving + {%- elif now().strftime("%m%d")|int >= 1125 + and now().strftime("%m%d")|int <= 1230 -%} + christmas + {%- elif now().strftime("%m%d")|int == 1231 -%} + new_years_day + {%- else -%} + standard + {%- endif -%}_colors + + +# http://www.calendar-365.com/holidays/2020.html +# Updated for 2020 diff --git a/include/scripts/monthly_scene.yaml b/include/scripts/monthly_scene.yaml new file mode 100644 index 0000000..b446ef8 --- /dev/null +++ b/include/scripts/monthly_scene.yaml @@ -0,0 +1,294 @@ +monthly_standard_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 300 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Gold' + brightness_pct: 80 + transition: 300 + +monthly_valentine_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Crimson' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Crimson' + brightness_pct: 80 + transition: 900 + +monthly_mardi_gras_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Purple' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +monthly_pi_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + rgb_color: [3,14,159] + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + rgb_color: [3,14,159] + brightness_pct: 80 + transition: 900 + +monthly_st_patty_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Green' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Green' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +monthly_easter_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Yellow' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + rgb_color: [255,193,204] + brightness_pct: 80 + transition: 900 + +monthly_starwars_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 900 + +monthly_cinco_de_mayo_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + rgb_color: [204,0,0] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + rgb_color: [245,245,245] + brightness_pct: 80 + transition: 900 + +monthly_mothers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + rgb_color: [244,187,255] + brightness_pct: 80 + transition: 900 + +monthly_fathers_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Blue' + brightness_pct: 80 + transition: 900 + +monthly_halloween_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + rgb_color: [235,97,35] + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + rgb_color: [235,97,35] + brightness_pct: 80 + transition: 900 + +monthly_thanksgiving_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Orange' + brightness_pct: 80 + transition: 900 + +monthly_christmas_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Red' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Green' + brightness_pct: 80 + transition: 900 + +monthly_new_years_day_colors: + sequence: + - service: light.turn_on + data: + entity_id: light.stue + color_name: 'Gold' + brightness_pct: 50 + transition: 900 + - service: light.turn_on + data: + entity_id: light.raket + color_name: 'Blue' + brightness_pct: 80 + transition: 900 + - service: light.turn_on + data: + entity_id: light.stol + color_name: 'Yellow' + brightness_pct: 80 + transition: 900 + diff --git a/include/scripts/sonos_announce.yaml b/include/scripts/sonos_announce.yaml new file mode 100644 index 0000000..c226a52 --- /dev/null +++ b/include/scripts/sonos_announce.yaml @@ -0,0 +1,61 @@ +#https://github.com/arsaboo/homeassistant-config/blob/master/scripts.yaml + sonos_announce: + alias: "Sonos announce script" + sequence: + # - service: scene.create + # data: + # scene_id: before + # snapshot_entities: + # - light.hue_lightstrip_plus_1 + # - light.hue_lightstrip_plus_1_2 + # - service: light.turn_on + # data: + # entity_id: light.hue_lightstrip_plus_1 + # brightness: 255 + # rgb_color: [255, 0, 0] + # flash: long + # - service: light.turn_on + # data: + # entity_id: light.hue_lightstrip_plus_1_2 + # brightness: 255 + # rgb_color: [255, 0, 0] + # flash: long + # - delay: 2 + # - service: scene.turn_on + # entity_id: scene.before + - service: sonos.snapshot + data: + entity_id: + - media_player.andreas + - media_player.daniel + with_group: yes + - service: sonos.unjoin + data: + entity_id: media_player.andreas + - service: sonos.unjoin + data: + entity_id: media_player.daniel + - service: sonos.join + data: + master: media_player.daniel + entity_id: media_player.andreas + - service: media_player.volume_set + data: + entity_id: media_player.daniel + volume_level: 0.4 + - service: media_player.volume_set + data: + entity_id: media_player.andreas + volume_level: 0.4 + - service: tts.google_translate_say + data_template: + entity_id: media_player.daniel + message: "Vi skal spise nu" + - delay: '00:00:10' + - service: sonos.restore + data: + entity_id: + - media_player.andreas + - media_player.daniel + + diff --git a/include/scripts/sonos_say.yaml b/include/scripts/sonos_say.yaml new file mode 100644 index 0000000..181b52c --- /dev/null +++ b/include/scripts/sonos_say.yaml @@ -0,0 +1,24 @@ +#https://github.com/arsaboo/homeassistant-config/blob/master/scripts.yaml + sonos_say: + alias: "Sonos TTS script" + sequence: + - service: sonos.snapshot + data_template: + entity_id: "{{ sonos_entity|default('media_player.alrum') }}" + - service: sonos.unjoin + data_template: + entity_id: "{{ sonos_entity|default('media_player.alrum') }}" + - service: media_player.volume_set + data_template: + entity_id: "{{ sonos_entity|default('media_player.alrum') }}" + volume_level: "{{ volume|default(0.5) }}" + - service: tts.google_translate_say + data_template: + entity_id: "{{ sonos_entity|default('media_player.alrum') }}" + message: "{{ message }}" + - delay: "{{ delay|default('00:00:00') }}" + - wait_template: "{{ is_state(sonos_entity|default('media_player.alrum'), 'playing') }}" + timeout: '00:00:05' + - service: sonos.restore + data_template: + entity_id: "{{ sonos_entity|default('media_player.alrum') }}" diff --git a/include/sensors/countdowns.yaml b/include/sensors/countdowns.yaml new file mode 100644 index 0000000..59a99cf --- /dev/null +++ b/include/sensors/countdowns.yaml @@ -0,0 +1,22 @@ +## Set the dates in ~/.homeassistant/include/automations/countdown.yaml + + +- platform: template + sensors: + dage_til_jul: + friendly_name: "Dage til jul" +# unit_of_measurement: "dage" + value_template: >- + {{ states('sensor.nedtaelling_juleaften') }} + + dage_til_nytaar: + friendly_name: "Dage til nytår" +# unit_of_measurement: "dage" + value_template: >- + {{ states('sensor.nedtaelling_nytaar') }} + + dage_til_ferie: + friendly_name: "Dage til ferie" +# unit_of_measurement: "dage" + value_template: >- + {{ states('sensor.nedtaelling_ferie') }}