Custom Component: Asana

Content Edited in protest for the bad direction of the Home-Asisstant project.

If you are interested in integrating Asana, visit the repository on GitHub.

2 Likes

The way I use is:

  1. Monitor productivity and bandwidth, on my Quantified Self view page.

    • Monitor number of pending tasks today, tomorrow, 7 days and 30 days to know how much load and bandwidth I have.
    • Monitor number of completed tasks yesterday, within 7 days and within 30 days to know how my productivity is evolving (and help me compare to workload).
    • The previous two I display them with custom:mini-graph-card and custom:bignumber-card to make it quite visual. This required using a template sensor to extract attributes into sensors.
  2. Monitor list of pending tasks for the next 7 days, on my Planning view page.

    • For this, I use custom:flex-table-card which can read the array on the attribute as a list directly.

great project

@ramibouaoun Thank you! Happy to hear it’s useful :slight_smile:

For those who asked before:

HACS support would not be implemented unless YAML (or equivalent non-UI configuration) becomes a supported mode for integrations (reference).

Hey, @nitobuendia.
Thanks for the great integration component. Sad to see that you won’t release the component into HACS, but that’s a topic for another discussion :smile:
I am setting up you integration and was wondering if you could please share your configurations with custom:flex-table-card with a list of tasks? Maybe that could even be notes as an example section on your repo’s README? I believe quite some ppl would find it very useful. Thanks in advance!

Hi @Ilja_Leiko

Glad to see this is helpful. This is my lovelace for the component:

      # Row: Tasks.
      - type: custom:flex-table-card
        title: Tasks
        entities:
          include: sensor.asana
        columns:
          - name: " "
            attr_as_list: list_future_7days

Make sure you add list_future_7days as per the sensor config example.

1 Like

Hey, @nitobuendia.
Awesome integration and thanks for the help setting up table-card.
I was wondering if there is any configuration for update interval of fetched data? It would probably be very useful to introduce somewhat of an configuration entry where one can specify how often the integration should fetch/update the data? :slight_smile:

Also, as of now the integration fetches tasks which are ONLY self-assigned as well as with a deadline. It would be so so so great if we could fetch also the tasks which do not have a set deadline or not self-assigned. What do you think about it? In my use case - i love your integration to have as a dashboard on a working desk. So the task which needs to be done, but have no set deadline - would still be super useful to show.

Do we currently have any way to fetch subtasks as well?

Hi @Ilja_Leiko

I think most of this is feasible.

Do you mean how often the data is fetched? If yes, scan interval is that:

    scan_interval: 3600  # 1h

If you mean querying a certain interval, I would imagine something like:

sensor:
  - platform: asana
    monitored_variables:
      - list_interval_{startDate}_{endDate}
      - counter_interval_{startDate}_{endDate}

      - list_before_{endDate}
      - counter_before_{endDate}

      - list_after_{startDate}
      - counter_after_{startDate}

The logic is not too different on what is done today; except the date is explicitly set by the user. However, I am not too clear on the use case if this is what you meant.

I think I briefly touch on this query on this section. Some of this may require Asana Search API, which is paid only. However, we can work with whatever the Tasks API provides; which I think may be enough.

Assignment
For adding not assigned, maybe we would need to add an optional configuration like:

assignee: me
project: {project_id}
workspace: {workspace_id}

(The effort of adding assignee would be similar to adding all, to be honest).

Where by default is you but the parameters can be changed based on the API support.

To get tasks without a deadline, maybe it should be something similar to the interval section with these options:

      - list_all
      - counter_all

      - list_no_deadline
      - counter_no_deadline

The first one will return all periods. The latter one only without deadline.

Potentially, the best next step would be filing a feature request on GitHub. Each individual request on a different issue. For example, fetching unassigned and with no deadline are 2 different requests.

Being completely honest and transparent, I do not think I will be working on those changes in the near future. However, (1) I am happy on providing some guidance (like here) on how to implement; (2) I am happy to review pull requests which intend to implement it and (3) if I have the time, happy to have a look myself.

1 Like

Sounds great, @nitobuendia ! Thanks for a friendly and elaborate explanations!
I will add those into my “pending” projects too and if i get a free evening or two, i ll happily hack something together and open PRs.

1 Like