######################################################################################################
###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_template:
        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 == 228 -%}
          marti_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 >= 328
          and now().strftime("%m%d")|int <= 401-%}
          easter
          {%- elif now().strftime("%m%d")|int == 422 -%}
          st_patty
          {%- elif now().strftime("%m%d")|int == 504 -%}
          starwars
          {%- elif now().strftime("%m%d")|int == 505 -%}
          cinco_de_mayo
          {%- elif now().strftime("%m%d")|int == 514 -%}
          valentine
          {%- elif now().strftime("%m%d")|int == 617 -%}
          fathers_day
          {%- elif now().strftime("%m%d")|int >= 1001
          and now().strftime("%m%d")|int <= 1031-%}
          halloween
          {%- elif now().strftime("%m%d")|int >= 1122
          and now().strftime("%m%d")|int <= 1123-%}
          thanksgiving
          {%- elif now().strftime("%m%d")|int >= 1125
          and now().strftime("%m%d")|int <= 1201-%}
          christmas
          {%- elif now().strftime("%m%d")|int >= 1202
          and now().strftime("%m%d")|int <= 1210-%}
          hanukkah
          {%- elif now().strftime("%m%d")|int >= 1211
          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/2018.html
# 213 Mardi Gras (purple, green, gold )
# 330 Good Friday
# 401 Easter
# 513 Mother's Day (pink, red) - Same as Valentine
# 617 Fathers day (Orange, Blue)
# 1122 Thanksgiving
# 1202 Hanukkah start 8 days.
