Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Original Budgeted Amount #13

Closed
dannyhanes opened this issue Aug 5, 2021 · 8 comments
Closed

Request: Original Budgeted Amount #13

dannyhanes opened this issue Aug 5, 2021 · 8 comments

Comments

@dannyhanes
Copy link

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.

@wxt9861
Copy link
Owner

wxt9861 commented Aug 25, 2021

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?

@dannyhanes
Copy link
Author

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.

@wxt9861
Copy link
Owner

wxt9861 commented Aug 26, 2021

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.

@jeffersantoss
Copy link

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

@bitboxer
Copy link

I would also love to see this implemented.

@wxt9861
Copy link
Owner

wxt9861 commented Mar 28, 2023

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") }}

@bitboxer
Copy link

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

@wxt9861
Copy link
Owner

wxt9861 commented Apr 29, 2023

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

@wxt9861 wxt9861 closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants