Skip to content

Commit

Permalink
Update docs to match 0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
pathofleastresistor committed Dec 22, 2023
1 parent c15a3b2 commit 52f2a32
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# EARLY RELEASE

This was designed to solve a personal need and I'm now trying to prepare it for others to use. That means several things can break between releases.

# activity-manager
Expand All @@ -19,7 +20,7 @@ The core idea is that an activity happens on a recurring basis, which is stored

Clone or download this repository and copy the "nfl" directory to your "custom_components" directory in your config directory

```<config directory>/custom_components/activity-manager/...```
`<config directory>/custom_components/activity-manager/...`

### HACS

Expand All @@ -30,28 +31,30 @@ Clone or download this repository and copy the "nfl" directory to your "custom_c
5. In the window that opens when you select it click om "Install This Repository in HACS"

## Usage

Once installed, you can use the link below to add the integration from the UI.

[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=activity_manager)

If you're using the [Activity Manager Card](https://github.com/pathofleastresistor/activity-manager-card), then you all you need to do is add the Activity Manager Card to your dashboard. When you're creating the card, you'll have to supply a `category` attribute to the card.

### Notifications

Because entities are exposed for each activity, you can build custom notifications. The example below runs an automation at sunrise to remind the user if they are past due on workout activities:

```
service: notify.mobile_android_phone
data:
title: >-
Workout reminder{% if (states.activity_manager |
Workout reminder{% if (states.sensor | selectattr('attributes.integration', 'eq', 'activity_manager') |
selectattr('attributes.category', 'equalto', 'Workout') |
map(attribute='state') | map('as_datetime') | reject(">", now()) | list |
count > 1)%}s{% endif %}
message: >-
{{ "Remember to stay healthy and go do: " }}
{%- set new_line = joiner("<br />") %}
<br />
{%- for activity in states.activity_manager -%}
{%- for activity in states.sensor | selectattr('attributes.integration', 'eq', 'activity_manager') -%}
{%- if activity.state|as_datetime < now() and activity.attributes.category=="Workout" -%}
{{ new_line() }}{{ " - "}}{{ activity.name }}
{%- endif -%}
Expand All @@ -63,8 +66,8 @@ data:
notification_icon: "mdi:dumbbell"
```


### More information
* Activities are stored in .activities_list.json in your `<config>` folder
* An entity is created for each activity (e.g. `activity_manager.<category>_<activity>`). The state of the activity is when the activity is due. You can use this entity to build notifications or your own custom cards.
* Three services are exposed: `activity_manager.add_activity`, `activity_manager.update_activity`, `activity_manager.remove_activity`. The update activity can be used to reset the timer.

- Activities are stored in .activities_list.json in your `<config>` folder
- An entity is created for each activity (e.g. `sensor.<category>_<activity>`). The state of the activity is the datetime of when the activity is due. You can use this entity to build notifications or your own custom cards.
- Three services are exposed: `activity_manager.add_activity`, `activity_manager.update_activity`, `activity_manager.remove_activity`. The update activity can be used to reset the timer.

0 comments on commit 52f2a32

Please sign in to comment.