Skip to content

Commit

Permalink
Update info.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Forth committed Jul 23, 2019
1 parent 7333715 commit 05d2866
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions info.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## How it works
This script creates a sensor that a counts down to the next occurrance of a date, like a birthday or anniversary and gives the number of years as an attribute

Requires python_script: to be enabled in you configuration

## Script arguments
key | required | type | description
-- | -- | -- | --
Expand All @@ -13,32 +11,41 @@ key | required | type | description
## Usage
Each sensor **requires**:

```
name: NAME_OF_DATE
type: TYPE_OF_DATE
date: DD/MM/YYYY_OF DATE
```

examples:

```
name: John
type: birthday
date: 17/08/1971
```

or

```
name: Our wedding
type: anniversary
date: 14/02/1994
```

## Generated sensors
Each sensor is given the following automatically:

```
entity_id: sensor.<type>_<name>
friendly_name: <name> 's <type>
state: <Days to the date from today>
years: <Number of years it will be>
```

So, the two sensors we created above would come out as:

```
sensor.birthday_john
friendly_name: John’s birthday
state: However many days it is until 17th August
Expand All @@ -48,6 +55,7 @@ sensor.anniversary_our_wedding
friendly_name: Our wedding anniversary
state: However many days to 14th February
years: How many years you will have been married on that day
```

## Example configuration.yaml entry
An example automation to create and refresh the above two sensors daily would be:
Expand Down

0 comments on commit 05d2866

Please sign in to comment.