Tracking car energy use (as dollars)

171 views
Skip to first unread message

Ken Mankoff

unread,
Jan 24, 2024, 11:41:23 AM1/24/24
to Beancount
Hello,

I used to track car gas usage with beancount. I now have an electric car. It's plugged in at home, and is therefore part of my electric bill.

I know exactly how many kWh go into my car each month, and would like to get an estimate of what portion of my electric bill goes to the car. This doesn't have to be precise - 0.15 $ / kWh is close enough, and we don't have variable rate electricity (yet) where I live.

What's the best way to do this? Currently I have

2023-12-31 open Expenses:Car                 USD
2023-12-31 open Expenses:Car:Energy      KWH
2023-12-31 price KWH 0.15 USD

And then I post to an account with:

2024-01-02 * "City Electric Co" ""
    Expenses:Utilities:Electric               42.24 USD
    Liabilities:ChaseCC

2024-01-24 * "Car electricity usage"
    Expenses:Utilities:Electric
    Expenses:Car:Energy                               10 KWH {0.15 USD}

So at the end of the month my electric bill is reduced by  $1.50 which is placed into the Car:Energy expense account.

Does this seem reasonable? Is anyone else doing this? Using a different method?

Thanks,

   -k.

Chary Chary

unread,
Jan 24, 2024, 1:05:08 PM1/24/24
to Beancount
Looks good for me.

The only thing is that I do not think you need this  {0.15 USD} notation, as such notation is used for tracking things at cost and is needed for stock trading.
You could have used the @ 0.15 USD notation, but even this is redundant, as you already have a price entry

So, just like that

2024-01-24 * "Car electricity usage"
    Expenses:Utilities:Electric
    Expenses:Car:Energy                               10 KWH 




Ken Mankoff

unread,
Jan 27, 2024, 10:44:18 PM1/27/24
to Beancount
Thanks for the feedback. I got a warning somewhere - not sure if it was in beancount or maybe paisa, saying that expense accounts can never have withdrawals

I wonder if a better method might be to not add this entry


2024-01-24 * "Car electricity usage"
    Expenses:Utilities:Electric
    Expenses:Car:Energy                               10 KWH {0.15 USD}

And instead adjust the first entry from

2024-01-02 * "City Electric Co" ""
    Expenses:Utilities:Electric               42.24 USD
    Liabilities:ChaseCC

to

2024-01-02 * "City Electric Co" ""
    Liabilities:ChaseCC                     -42.24 USD
    Expense:Car:Energy                     10 KWH @ 0.15 USD
    Expenses:Utilities:Electric       
    # leave Utilities:Electric blank to auto-calculate that term from the other provided terms.

Then, no deduction occurs from an expense account.

Although, I assume deductions must be allowed, for example if you get a refund?

   -k.


Chary Chary

unread,
Jan 29, 2024, 10:18:51 AM1/29/24
to Beancount
Not sure I understand where you got a warning from, but this is how I would do it;

2023-01-01 open Expenses:Utilities:Electric
2023-01-01 open Liabilities:ChaseCC

2023-12-31 open Expenses:Car                 USD
2023-12-31 open Expenses:Car:Energy      KWH
2023-12-31 price KWH 0.15 USD

2024-01-02 * "City Electric Co" ""
    Expenses:Utilities:Electric               42.24 USD
    Liabilities:ChaseCC

2024-01-24 * "Car electricity usage"
    Expenses:Utilities:Electric
    Expenses:Car:Energy                               10 KWH


And then would query it:

select account, SUM(convert(position,'USD',date))

And the result

Reply all
Reply to author
Forward
0 new messages