Coder Social home page Coder Social logo

anniversaries's Introduction

Anniversaries

hacs_badge GitHub release (latest by date) GitHub Release Date GitHub

Maintenance GitHub issues

Buy me a coffee

Support Pinkywafer on Patreon

The 'anniversaries' component is a Home Assistant custom sensor which counts down to a recurring date such as birthdays, but can be used for any anniversary which occurs annually on the same date.

1.0.0 includes BREAKING CHANGES read the release notes.

Table of Contents

Installation

MANUAL INSTALLATION

  1. Download the anniversaries.zip file from the latest release.
  2. Unpack the release and copy the custom_components/anniversaries directory into the custom_components directory of your Home Assistant installation.
  3. Configure the anniversaries sensor.
  4. Restart Home Assistant.

INSTALLATION VIA HACS

  1. Ensure that HACS is installed.
  2. Search for and install the "anniversaries" integration.
  3. Configure the anniversaries sensor.
  4. Restart Home Assistant.

Configuration

Anniversaries can be configured on the integrations menu or in configuration.yaml

Config Flow

In Configuration/Integrations click on the + button, select Anniversaries and configure the options on the form.

configuration.yaml

Add anniversaries sensor in your configuration.yaml. The following example adds two sensors - Shakespeare's birthday and wedding anniversary!

# Example configuration.yaml entry

anniversaries:
  sensors:
  - name: Shakespeare's Birthday
    date: '1564-04-23'
  - name: Shakespeare's Wedding Anniversary
    date: '1582-11-27'

CONFIGURATION PARAMETERS

Parameter Optional Description
name No Friendly name
date No date in format 'YYYY-MM-DD' (or 'MM-DD' if year is unknown)
icon_normal Yes Default icon Default: mdi:calendar-blank
icon_today Yes Icon if the anniversary is today Default: mdi:calendar-star
days_as_soon Yes Days in advance to display the icon defined in icon_soon Default: 1
icon_soon Yes Icon if the anniversary is 'soon' Default: mdi:calendar
date_format Yes formats the returned date Default: '%Y-%m-%d' for reference, see http://strftime.org/
show_half_anniversary Yes true or false. Enables the half_anniversary_date and days_until_half_anniversary attributes. Default: false

State and Attributes

State

  • The number of days remaining to the next occurance.

Attributes

  • years at next anniversary: number of years that will have passed at the next occurrence (NOT displayed if year is unknown)
  • current years: number of years have passed since the first occurance (ie, current age) (NOT displayed if year is unknown)
  • date: The date of the first occurence (or the date of the next occurence if year is unknown) (formatted by the date_format attribute if set)
  • weeks_remaining: The number of weeks until the anniversary
  • unit_of_measurement: 'Days' By default, this is displayed after the state. this is NOT translate-able. See below for work-around
  • half_anniversary_date: The date of the next half anniversary (if enabled by show_half_anniversary)
  • days_until_half_anniversary: The number of days until the next half anniversary

Notes about unit of measurement

Unit_of_measurement is not translate-able. You can, however, change the unit of measurement with a customization. There are two ways to do this:

  • NOTE that each sensor would require it's own customization

This example would replace Days with Dias

  • In customize.yaml:

    sensor.your_sensor_id:
      unit_of_measurement: Dias
  • Use the Customizations from the Configuration menu:

    1. Select your sensor
    2. under "Pick an attribute to override" select unit_of_measurement
    3. Type Dias in the box
    4. Press save

anniversaries's People

Contributors

pinkywafer avatar guille-mas-coll avatar sebrut avatar yuvalabou avatar fredrikbaberg avatar nicolaivds avatar reconos87 avatar kernehed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.