---
title: "Discussion on \"Tracking expenses in Home Assistant\" | Hashnode"
description: "Discussion on \"Tracking expenses in Home Assistant\". A few weeks ago, I decided to track my credit card expenses in Home Assistant, and also notify me or my wife if any one of us made a payment from the shared bank account. The goal was to track our expenses without having to manually add them in an ap..."
url: "https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Tracking expenses in Home Assistant](https://bogdanbujdea.dev/tracking-expenses-in-home-assistant?utm_source=hashnode&utm_medium=feed)

A few weeks ago, I decided to track my credit card expenses in Home Assistant, and also notify me or my wife if any one of us made a payment from the shared bank account. The goal was to track our expenses without having to manually add them in an ap...

Dec 15, 2020 · 5 min read · bogdanbujdea.dev  
Read the article

-   [#smart-home](https://hashnode.com/tag/smart-home)

## Written by

[Bogdan Bujdea](https://hashnode.com/@bogdan)

@bogdan · Iasi, Romania

  
[View profile](https://hashnode.com/@bogdan)

.NET Developer

Expert generalist • Independent Contractor • Microsoft MVP • Home Assistant enthusiast Hi there! I'm Bogdan Bujdea, a software developer from Romania. I'm currently a .NET independent contractor, and in my free time I get involved in the local .NET community or I'm co-organizing the @dotnetdays conference. I consider myself an expert generalist, mostly because I enjoy trying out new stuff whenever I get the chance and I get bored pretty easily, so on this blog you'll see me posting content from programming tutorials to playing with my smart gadgets.

## Responses 3

Markdown supported · ⌘↵ to post

[Horia](https://hashnode.com/@om1d3)

[Dec 12, 2025](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/693bfc1c675aa6305180608e)

first of all, great idea! thank you!

after trying to follow your guide, I have ended up rebuilding most of the components from scratch due to either Home Assistant deprecating things, or my lack of knowledge/understanding. In order to avoid this type on stressful for anyone else, I have published an up to date guide on my GitHub page: om1d3/ha-purchase-tracker

I am happy if it end up helping anyone.

keep up the good work and thank you again for this great idea.

Horia.

[Andreas](https://hashnode.com/@myrulezzz)

[Dec 27, 2020](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/5fe87f25999b3f21e3158857)

Hi. This worked for me: last\_expense: friendly\_name: Last expense unit\_of\_measurement: € value\_template: > {{ state\_attr('sensor.curve\_email','subject') | regex\_findall\_index("€\\d+.?\\d+") | replace(" €","") | round(2) }} attribute\_templates: seller: >  
{{ state\_attr('sensor.curve\_email','subject')\[27:1000\] | regex\_findall\_index(".\* on") | replace(" on","")}}

Can you explai how you created your expenses card?

[Andreas](https://hashnode.com/@myrulezzz)

[Dec 20, 2020](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/5fdfe22fb78ac62dff80e4ed)

Hi tried to follow your guide to do something similar but i am stack at the sensor part. Adding your sensor code without modifying anything i get the below error: TemplateError('IndexError: list index out of range') while processing template 'Template("{{ state\_attr('sensor.curve\_email','subject') | regex\_findall\_index("\\d+.?\\d+? RON") | replace(" RON","") | round(2) }}")' for attribute '\_state' in entity 'sensor.last\_expense' TemplateError('TypeError: 'NoneType' object is not subscriptable') while processing template 'Template("{{ state\_attr('sensor.curve\_email','subject')\[27:1000\] | regex\_findall\_index(".\* on") | replace(" on","")}}")' for attribute 'seller' in entity 'sensor.last\_expense'

Any idea why do i get this error? Thanks

[Bogdan Bujdea](https://hashnode.com/@bogdan)

[Dec 26, 2020](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/5fdfe22fb78ac62dff80e4ed#reply-5fe683076a146422083ccc17)

Hey Andreas! I think the problem is with the regex expression. Are you using Curve as well? Or how does the information from an email look like?

[Andreas](https://hashnode.com/@myrulezzz)

[Dec 26, 2020](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/5fdfe22fb78ac62dff80e4ed#reply-5fe6c42f999b3f21e31571e2)

Hi, I am ysing curve but the email is in euro.Basically instead of 10 RON the amount for me is €10 [Bogdan Bujdea](https://hashnode.com/@bogdan)

[Andreas](https://hashnode.com/@myrulezzz)

[Dec 26, 2020](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/5fdfe22fb78ac62dff80e4ed#reply-5fe6c5806a146422083ccdf6)

Can you give me an example what the regex should be with the brlow format?[Bogdan Bujdea](https://hashnode.com/@bogdan) Pandora Bakeries €3.90 25 December 2020 20:07:52  
On this card:

Andreas Stylianou Mastercard Debit XXXX-8344 Receipt for the purchase (add it using the Curve App):

This Transaction will appear on your bank statement as: PANDORA BAKERIES NICOSIA CYP
