A Home Assistant sensor that tells you what holiday is next

Overview

Next Holiday Sensor

This sensor tells you what holiday is coming up next. You can use it to set holiday light colors or other scenes.

The state of the sensor tells you what the upcoming holiday is. If today is a holiday, the state will be that holiday. There are sensor attributes showing all the holidays for the year, whether or not today is a holiday, and how many days there are before the next holiday. The component will look ahead into the next year for the next holiday.

Holidays are recomputed every year. In the config you can specify what holidays you want to track. The holidays and config are based on the https://github.com/dr-prodigy/python-holidays

An example screenshot

Configuration

Configuration is set as a sensor of the next_holiday platform. You make a list of sources, each of which can have the following attributes:

Attribute Type Description Example
country str A country to load holidays from 'USA'
state str A state within the country for state holidays 'WA'
province str A province within the country for state holidays 'ON'
multiday bool If true (default), holidays that span multiple days will be shown mulitiple times. Otherwise, only the first day will be shown true
observed bool If true (default), observed holidays will be included in addition to real ones true
filter list of str A filter where only holidays matching the query will be added [See below]

Multiple country/state/provinces and filters may be combined to get a pretty flexible list of holidays.

Lists of valid states and province abbreviations can be found in the underlying library, e.g. here for Canada

Example

Add a sensor to your configuration along the lines of:

sensor:
  - platform: next_holiday
    sources: 
     - country: "USA"
       state: "WA"
     - country: "Israel"
       multiday: false
       filter:
         - 'hanukkah'

This loads all normal holidays for the US State of Washington and also throws in Hanukkah by loading the Israel holidays and filtering everything but Hanukkah out.

You might also like...
Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

emhass: Energy Management for Home Assistant
emhass: Energy Management for Home Assistant

emhass EMHASS: Energy Management for Home Assistant Context This module was conceived as an energy management optimization tool for residential electr

 Python script: Enphase Envoy mqtt json for Home Assistant
Python script: Enphase Envoy mqtt json for Home Assistant

A Python script that takes a real time stream from Enphase Envoy and publishes to a mqtt broker. This can then be used within Home Assistant or for other applications. The data updates at least once per second with negligible load on the Envoy.

Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Huawei Solar sensors for Home Assistant
Huawei Solar sensors for Home Assistant

Huawei Solar Sensors This integration splits out the various values that are fetched from your Huawei Solar inverter into separate HomeAssistant senso

Connect a TeslaMate instance to Home Assistant, using MQTT

TeslaBuddy Connect a TeslaMate instance to Home Assistant, using MQTT. It allows basic control of your Tesla vehicle via Home Assistant (currently, ju

Baseline model for Augmented Home Assistant

Dataset Preparation Step 1. Rename the Virtual-Home output directory to 'vh.[name]', for example: 'vh.door' Make sure the directory contains 100+ fram

Better support for Nuki devices to the Home Assistant
Better support for Nuki devices to the Home Assistant

Another attempt to add a better support for Nuki devices to the Home Assistant Features: Lock interface implementation Uses local webhook from bridge

Comments
  • Feature request: ignore holidays

    Feature request: ignore holidays

    Thanks for creating this useful sensor!

    In Sweden, every Sunday is considered as a holiday. This means that this sensor always returns 0-6 in "days until next holiday", and that the list of holidays is very long.

    I am aware that I can explicitly list the holidays I want in my sensor, but I'd rather exclude the ones I don't want - such as the Sundays, in this case. Would you consider that?

    image

    Edit: I just saw some related discussion that referred to "include sundays" which can be passed when initializing the library. If it was possible to pass this parameter to the Holidays library it would solve my issue.

    opened by jhqv 3
  • Added next holiday in future (after current holiday)

    Added next holiday in future (after current holiday)

    It is very nice to know, when the next holiday in future is (looking forward to the next holiday 😉)

    Co-Authored-By: Niklas Stegmann [email protected]

    opened by robin-heidrich 1
  • "today_is_holiday" attribute shown as number in HA?

    Hi! I have an odd case: I have installed your sensor and i use attribute "today_is_holiday" as trigger condition in my automation: it will trigger only if it's false (so automation doesn't trigger when it's holiday). I entered automation via UI interface, and it never triggers. The cause is that automation assumes that result "false" is a string and creates this:

    because this doesn't work:
    condition: state
    entity_id: sensor.next_holiday
    state: 'false'
    attribute: today_is_holiday
    

    which doesn't work - automation ends with:

    result: false state: false 
    wanted_state: 'false'
    

    If i correct it manually in YAML editor to this (note that false is without quotes):

    condition: state
    entity_id: sensor.next_holiday
    state: false
    attribute: today_is_holiday
    

    Then it works. The point is that FIRST example is created by UI automation, while second is corrected in YAML editor. Of course with corrected automation HA complains with this error: The provided value for 'state' is not supported by the visual editor. We support (string) but received (false) Do you have any explanation for this behaviour or is it normal?

    opened by Protoncek 2
  • Feature Request: Timestamp of next holiday (for countdown templates strings)

    Feature Request: Timestamp of next holiday (for countdown templates strings)

    Hello,

    The countdown of days in attributes is useful.

    However, with an ISO8601 date time string exposed as an attribute for the next holiday, we can manually customise a countdown sensor or use it with other time related automations.

    If it's not too difficult, it could be a nice to have extra attribute to expose with an optional config.

    opened by samuelthng 0
Owner
Nick Touran
Nuclear engineer in Seattle. Into energy and other neat problems.
Nick Touran
BMP180 sensor driver for Home Assistant used in Raspberry Pi

BMP180 sensor driver for Home Assistant used in Raspberry Pi Custom component BMP180 sensor for Home Assistant. Copy the content of this directory to

747Developments 1 Dec 17, 2021
A DiY holiday project to demonstrate how you can send data from adafruitIO cloud to a balena edge device

holiday-star balena ❤️ adafruitIO Introduction A DiY holiday project to demonstrate how you can send data from adafruitIO cloud to a balena edge devic

Ayan Pahwa 3 Dec 20, 2021
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

null 1.9k Jan 2, 2023
Volkswagen ID component for Home Assistant

Volkswagen ID component for Home Assistant This folder contains both a generic Python 3 library for the Volkswagen ID API and a component for Home Ass

null 55 Jan 7, 2023
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

VMG 17 Sep 7, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 3, 2023
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Alexander Ryazanov 27 Nov 5, 2022
Provide Unifi device info via api to Home Assistant that will give ap sensors

Unifi AP Device info Provide Unifi device info via api to Home Assistant that will give ap sensors

null 12 Jan 7, 2023
Switch predictor for Home Assistant with AppDeamon

Home Assistant AppDeamon - Event predictor WORK IN PROGRESS - CURRENTLY NOT COMPLETE AND NOT WORK This is an idea under development (when I have free

null 37 Dec 17, 2022
Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant

Duke Energy Gateway This is a custom integration for Home Assistant. It pulls near-real-time energy usage from Duke Energy via the Duke Energy Gateway

Michael Meli 28 Dec 23, 2022