ahoernecke / ha_cellar_tracker

17 stars 17 forks source link

I get the year 1001 in the card Bottles by Vintage #20

Open rwez opened 1 year ago

rwez commented 1 year ago

In the card Bottles by Vintage I get the year 1001, presumably for the bottles which have no vintage, like some cava's or champagnes. see screenshot. Screenshot 2023-03-22 at 09 54 11

soggypete commented 1 year ago

This seems to be for wines that are NV wines

Edit: I read your post in more detail and saw that you've actually come to the same conclusion I have, sorry! I just saw this on my own HA this evening and came to the same conclusion. No idea how to get around this but would love to find a solution.

Edit 2: Solved it! Solution is to add something like the following to your lovelace code, depending on how your table/sensors are arranged:

- name: Vintage data: Vintage modify: >- if(parseFloat(x).toFixed(0) == 1001) {"N.V."} else{parseFloat(x).toFixed(0)}