Every mid-month I receive a standard email with the energy tariffs for the following month.
How can I best pass those data to Home Assistant?
My first idea would be to use a script which processes emails (I use “imapfilter” already) and via a local URL updates input_number.next_tariff, together with an automation running the first of the month copying input_number.next_tariff to input_number.current_tariff, which would then be used as entity to track current prices for the energy dashboard.
Unfortunately, the tariffs are not available on the website unless login is performed and so on, so a web scraper is too complex for my skills.
Hey!
Your proposed approach sounds good to me. Parsing from the webpage would be nicer, agreed, but if that is not possible imho your mail parsing approach sounds quite okay.
Good luck!
You can pass any attributes as you see fit. You could also add useful self-defined attributes, .e.g. mail_datetime or valid_starting_datetime - in case there is further data in the email you deem useful or that could be helpful to debug an issue later on.