Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit_of_measurement setting #2

Open
stast1 opened this issue May 22, 2020 · 8 comments
Open

Add unit_of_measurement setting #2

stast1 opened this issue May 22, 2020 · 8 comments

Comments

@stast1
Copy link

stast1 commented May 22, 2020

Hello!
Is it possible to add a setting for units of measure, for example in Russian - 'Вт' and 'кВт'?

@bessarabov
Copy link
Owner

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?

Screenshot 2020-05-22 at 11 28 35

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.

@stast1
Copy link
Author

stast1 commented May 22, 2020

Привет!
Я на русском буду, так проще, знаю Вас по каналу в телеграмм.
У меня весь интерфейс на русском. И датчик входной мощности в ваттах (Вт).
Для Вашей карты пришлось сделать template sensor в kW. Оно конечно работает, но это лишний сенсор.
Ну и картинка с kW тоже выделяется на фоне остального интерфейса:

image

Если бы в настройках карточки можно было настраивать единицу измерения - это бы решило проблему.

@stast1
Copy link
Author

stast1 commented May 22, 2020

К языку интерфейса привязываться наверное неправильно. Не у всех пользователей в русском интерфейсе единицы измерения тоже русские.

@bessarabov
Copy link
Owner

Спасибо за пояснение. Все понятно. Я согласен что должна быть возможность работать с карточкой и без создания отдельного сенсора с нужными unit_of_measurement.

Я доработаю эту карточку, чтобы вы смогли убрать дополнительный сенсор. (но ничего не могу сказать про сроки решения этой задачи)

@stast1
Copy link
Author

stast1 commented May 22, 2020

Ок, спасибо!

@SerhatG
Copy link

SerhatG commented Jun 11, 2020

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?

@bessarabov
Copy link
Owner

@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.

@SerhatG
Copy link

SerhatG commented Jun 11, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants