Skip to content

Commit

Permalink
Add more information to README
Browse files Browse the repository at this point in the history
  • Loading branch information
pathofleastresistor committed May 6, 2023
1 parent 6fe53ca commit 9acbf4e
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,37 @@ 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)

## More information
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 |
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 -%}
{%- if activity.state|as_datetime < now() and activity.attributes.category=="Workout" -%}
{{ new_line() }}{{ " - "}}{{ activity.name }}
{%- endif -%}
{%- endfor %}
data:
priority: high
ttl: 0
importance: high
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.

0 comments on commit 9acbf4e

Please sign in to comment.