-
-
Notifications
You must be signed in to change notification settings - Fork 504
/
Copy pathmonthly_color_scene.yaml
executable file
·72 lines (70 loc) · 2.91 KB
/
monthly_color_scene.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#-------------------------------------------
# @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
# https://www.vcloudinfo.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: scene.turn_on
data:
entity_id: >
scene.month_
{%- if states.sensor.flag.state == "True" -%}
RWB
{%- elif 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 states('sensor.easter_countdown') | int < 4 -%}
easter
{%- elif now().strftime("%m%d")|int == 504 -%}
starwars
{%- elif now().strftime("%m%d")|int == 505 -%}
cinco_de_mayo
{%- elif states('sensor.mothers_countdown') | int < 4 -%}
mothers_day
{%- elif states('sensor.fathers_countdown') | int < 4 -%}
fathers_day
{%- elif states('sensor.memorial_day_countdown') | int < 3 -%}
RWB
{%- elif now().strftime("%m%d")|int == 704 -%}
RWB
{%- elif states('sensor.labor_day_countdown') | int < 3 -%}
RWB
{%- elif now().strftime("%m%d")|int >= 1001
and now().strftime("%m%d")|int <= 1031-%}
halloween
{%- elif now().strftime("%m%d")|int == 1111 -%}
veterans
{%- elif states('sensor.thanksgiving_day_countdown') | int < 4 -%}
thanksgiving
{%- elif states('sensor.chanukkah_countdown') | int <= 1 -%}
hanukkah
{%- elif states('sensor.christmas_countdown') | int <= 25 -%}
christmas
{%- elif now().strftime("%m%d")|int == 1231 -%}
new_years_day
{%- else -%}
standard
{%- endif -%}_colors