I’m not sure what the issue is. I added the lines
sensor: !include sensors.yaml
template: !include template.yaml
to my config.yaml file. Then added to the template.yaml file.
# Trash Holidays: new years, independ, memorial, labor, christ, thanks
template:
- trigger:
- platform: time
at: "00:01:00"
- platform: state
entity_id: input_button.update_holiday_sensors
- platform: homeassistant
event: start
Finally added to the sensors.yaml file
# FIXED DATE
sensor:
- name: "New Years Day"
unique_id: "37319374975705055206"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(1, 1)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(1, 1)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Dia de Los Reyes"
unique_id: "1984497531937520705056"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(1, 6)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(1, 6)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Valentines Day"
unique_id: "22719844595073910047"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(2, 14)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(2, 14)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Saint Patricks Day"
unique_id: "44595073912271980047"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(3, 17)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(3, 17)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Halloween
unique_id: "947396278926815041"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(10, 31)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(10, 31)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Dia de Muertos
unique_id: "9750858485431103467"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(11, 2)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(11, 2)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Rex Manning Day
unique_id: "4690662543745975107"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(4, 8)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(4, 8)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Christmas
unique_id: "14318885502034384968"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(12, 25)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(12, 25)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Veterans Day"
unique_id: "31975705053740693752"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(11, 11)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(11, 11)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Independence Day
unique_id: "9084317551034684857"
state: >
{% from 'easy_time.jinja' import month_day %}
{{ (month_day(7,4)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_day %}
{%- set x = ((month_day(7, 4)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
# VARIABLE DATE
## MONTH WEEK DAY
- name: "Martin Luther King Jr"
unique_id: "496217893819475026"
state: >
{% from 'easy_time.jinja' import month_week_day %}
{{ (month_week_day(1, 3, 0)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_week_day %}
{%- set x = ((month_week_day(1, 3, 0)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Mothers Day"
unique_id: "749819475062189326"
state: >
{% from 'easy_time.jinja' import month_week_day %}
{{ (month_week_day(5, 2, 6)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_week_day %}
{%- set x = ((month_week_day(5, 2, 6)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Fathers Day"
unique_id: "962741899473268150"
state: >
{% from 'easy_time.jinja' import month_week_day %}
{{ (month_week_day(6, 3, 6)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_week_day %}
{%- set x = ((month_week_day(6, 3, 6)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Thanksgiving
unique_id: "69425309251060427914"
state: >
{% from 'easy_time.jinja' import month_week_day %}
{{ (month_week_day(11, 4, 3)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_week_day %}
{%- set x = ((month_week_day(11, 4, 3)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Memorial Day
unique_id: "20611770923315821822"
state: >
{% from 'easy_time.jinja' import month_week_day %}
{{ (month_week_day(5, 5, 0)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_week_day %}
{%- set x = ((month_week_day(5, 5, 0)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: Labor Day
unique_id: "78754309251267813130"
state: >
{% from 'easy_time.jinja' import month_week_day %}
{{ (month_week_day(9, 1, 0)|as_datetime).date() }}
attributes:
days_until: >
{%- from 'easy_time.jinja' import month_week_day %}
{%- set x = ((month_week_day(9, 1, 0)|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
## LUNAR-DERIVED
- name: "Mardi Gras"
unique_id: "734459509122779462132"
state: >
{% from 'easy_time.jinja' import easter %}
{{ (easter()|as_datetime - timedelta(days=47)).date() }}
attributes:
days_until: >
{% from 'easy_time.jinja' import easter %}
{% set x = ((easter()|as_datetime
- timedelta(days=47)) - today_at()).days%}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
- name: "Easter"
unique_id: "189497506268132794"
state: >
{% from 'easy_time.jinja' import easter %}
{{ easter() }}
attributes:
days_until: >
{% from 'easy_time.jinja' import easter %}
{% set x = ((easter()|as_datetime) - today_at()).days %}
{{ iif(x < 1, x + 365, x) }}
availability: "{{ now() is defined }}"
# SEASONS
binary_sensor:
- name: Christmas Season
unique_id: christmas_season_0001
state: |
{% set n = now() %}
{% set offset = 'T00:00:00-05:00' %}
{{ (states('sensor.thanksgiving')~offset)|as_datetime <= n or
n < (states('sensor.dia_de_los_reyes')~offset)|as_datetime }}
When I check my configuration in developer tools I get
“Invalid config for ‘sensor’ at configuration.yaml, line 31: required key ‘platform’ not provided”