How do I set up a variable with a custom unit of measurement?
I want to set up a variable with a unit of measurement, I don’t find in all the lists. Thus I set up a new variable using the variable+history UI with a random type.
Now I see the following configuration (variables+hostory → variable → configuration → change value and attributes):
No, you will break many things if you use a dynamic unit_of_measurement. If you truely want that, make a template sensor without device_class and it won’t break.
HA is not designed to have a dynamic unit of measurement. It’s designed for the UOM to be static and the user changes the dropdown in the frontend on the entity itself to change the values. Then ha automatically handles the calculation changes for you. I highly doubt it does that for monetary though because the value of each changes frequently unlike normal conversions.