---
title: "Comment by Andreas on \"Tracking expenses in Home Assistant\" | Hashnode"
description: "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 erro"
url: "https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8/comment/5fdfe22fb78ac62dff80e4ed"
---

[Discussion](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8)

Comment [Tracking expenses in Home Assistant](https://hashnode.com/posts/tracking-expenses-in-home-assistant/5fd8ef6cea368e206535d3f8)

[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
