Pretty much what the title says. I have a few entities in which I track the price of things that fluctuate (ex. Electricity Price in Texas which can change quickly). In this case the value is a spot price not a totalization of some cost (like the total of my electric bill)
I couldn’t find a discussion anywhere on why Monetary isn’t allowed as a measurement but I’m very curious
Not sure if too late, but I stumbled across something when I was trying to solve for the same issue as you. I created a template sensor through the UI and set its Unit of Measurement to “USD”, and boom! That did the trick.
2024-02-24 01:33:47.601 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.ing_deutschland_direkt_depot_XXXXXXXX_total_total_equity_value (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; expected None or one of 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
I’m confused by that message as well.
I don’t see another device_class that represent a “price” (I’m monitoring fuel price, here).
EDIT: To be clear, the point of having a state_class in the first place is to be able to generate long-term statistics. The device_class is just a nice-to-have