ynab icon indicating copy to clipboard operation
ynab copied to clipboard

Request: Original Budgeted Amount

Open dannyhanes opened this issue 3 years ago • 4 comments

In addition to importing the amount I have left in my budget, I would love to see it also include the original budgeted amount.

This way I can create my budgets in YNAB and have my custom bar-card update automatically with the correct graph information.

And example of this is below.

type: custom:bar-card
entities:
  - entity: sensor.template_ynab_groceries
    unit_of_measurement: $
    icon: mdi:cart
    severity:
      - from: '0'
        to: '100'
        color: rgba(222,91,107,1)
      - from: '101'
        to: '300'
        color: var(--label-badge-yellow)
      - from: '301'
        color: var(--label-badge-green)
    min: '0'
    max: '500'

Ideally, I want the max value to be imported as well, with that being what I had originally budgeted.

dannyhanes avatar Aug 05 '21 13:08 dannyhanes

I think I understand what you're asking, but lets clarify.

Are you talking about the optional categories? For example, if you've added a category to track where you budgeted 100 and spend 40, the sensor would return 60, but you're also looking to see the 100?

wxt9861 avatar Aug 25 '21 01:08 wxt9861

Correct.

When I build a gauge in home assistant I would set the range to be 0-100 with the data point showing 60 since 60 is what I have left. It would count down from budgeted amount to zero.

dannyhanes avatar Aug 25 '21 18:08 dannyhanes

I am not sure that is going to work in all situations. Here is an example where this would not work:

To help understand, The API returns 3 values related to this:

  • Budgeted (what you assigned for that particular month)
  • Activity (what you spent)
  • Balance (what is available to spend)

You assign 100 in July and only use 60. You are left over with 40 dollars which gets carried over into August as Balance. In August you assign another 100. So you have 100 budgeted and 140 balance (100 from this month + 40 carried over from last month). In this scenario, your gauge will be off the chart because your available amount is higher than budgeted.

In the example above, the gauge will read above budgeted until your spend (ie, activity) is more than last month's carry over, which may or may not happen.

wxt9861 avatar Aug 26 '21 00:08 wxt9861

I think that in this case, we should return the current (total) balance budgeted for the categories.

jeffersantoss avatar Jan 11 '22 16:01 jeffersantoss

I would also love to see this implemented.

bitboxer avatar Mar 18 '23 11:03 bitboxer

I made a change, lets see how well it works and if any further changes will be required.

v0.2.0b release

You should see a new attribute for each monitored category with _budgeted appended to it. Should be able to template it out as usual.

For example, If I am monitoring a category called water, you should see 2 attributes: {{ state_attr("sensor.ynab", "water_budgeted") - state_attr("sensor.ynab", "water") }}

wxt9861 avatar Mar 28 '23 20:03 wxt9861

Forgot to say here, but I am now using it in our family dashboard and it works like charm. Thank you for adding this <3

bitboxer avatar Apr 27 '23 12:04 bitboxer

Thanks for confirming. I will move it out of beta in the new few days.

wxt9861 avatar Apr 29 '23 02:04 wxt9861