ynab
ynab copied to clipboard
Request: Original Budgeted Amount
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.
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?
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.
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.
I think that in this case, we should return the current (total) balance budgeted for the categories.
I would also love to see this implemented.
I made a change, lets see how well it works and if any further changes will be required.
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") }}
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
Thanks for confirming. I will move it out of beta in the new few days.