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?
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
Can you give me an example what the regex should be with the brlow format?Bogdan Bujdea 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
Horia
missing tagline
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.