animated-consumption-card
animated-consumption-card copied to clipboard
Add unit_of_measurement setting
Hello! Is it possible to add a setting for units of measure, for example in Russian - 'Вт' and 'кВт'?
Can you please add additional details of what you need.
Do you have a sensor in Home Assistant that has unit Вт
/кВт
:
sensor:
- platform: template
sensors:
total_power_consumption:
unit_of_measurement: Вт
....
Or the sensor in Home Assistant has unit_of_measurement kWh
/W
, but you want to this card to display text in russian language in this card?
If you want to change the text in the card I have one more question. Is is ok if there is no additional settings in the card, but the card just uses the language of Home Assistant interface.
Привет! Я на русском буду, так проще, знаю Вас по каналу в телеграмм. У меня весь интерфейс на русском. И датчик входной мощности в ваттах (Вт). Для Вашей карты пришлось сделать template sensor в kW. Оно конечно работает, но это лишний сенсор. Ну и картинка с kW тоже выделяется на фоне остального интерфейса:
Если бы в настройках карточки можно было настраивать единицу измерения - это бы решило проблему.
К языку интерфейса привязываться наверное неправильно. Не у всех пользователей в русском интерфейсе единицы измерения тоже русские.
Спасибо за пояснение. Все понятно. Я согласен что должна быть возможность работать с карточкой и без создания отдельного сенсора с нужными unit_of_measurement
.
Я доработаю эту карточку, чтобы вы смогли убрать дополнительный сенсор. (но ничего не могу сказать про сроки решения этой задачи)
Ок, спасибо!
Hi, I would second this change.
I do have a sensor that has an unit of measurement of something else, in this case Watt
instead of W
. I know I can use templates and exclude that sensor from the recorder, but preferably I do not want to add to the already rather huge list of entities that are available.
I could always see if the integration can fix this, as W
might be more future-proof.
What's your take on it?
@SerhatG I will definitely update this card and make it possible to work with any unit of measurement (I'm sorry but I can't say the exact date when it is ready) After that this card will work with your Watt
sensor.
@bessarabov I don't mind taking a crack at it and contribute.
What did you have in mind?
Simply adding Watt
to the list of units or assuming everything is W
and therefor kW
is the only special unit
. Something else?
[EDIT] I added a possible solution in PR #3 . Let me know if you want to take a different approach.