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

Feature Request: Translation of values #67

Open
kefdk opened this issue Jan 2, 2021 · 3 comments
Open

Feature Request: Translation of values #67

kefdk opened this issue Jan 2, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@kefdk
Copy link

kefdk commented Jan 2, 2021

Hi,

First of all, thank you for your great card. I have two Roombas, and we are using this card to handle them.

Previously I created my own local version of your card to handle attributes from a custom sensors instead of from the vacuum-entity, but since I don't want to make sure my custom-card based on your card is working after an update, I would like to use your standard custom-card instead.

I would really like that the card could handle translation of values, for example that "Charging" could be translated into (in this case Danish) "Oplader".

My solution on my own card was to have a template sensor with attributes, that I used instead of the attribute or state from the vacuum-entity.

It would give a huge amount of possibility to this card. For example the "Full Bin: Yes/No" could be changed to: "Beholder: Fuld" if you wanted that instead, or as I did; set the State-text to "Tøm beholder" / "Empty bin".

Using a template sensor for this would also give you the possibility of adding conditions to some of the states, for example "Charging" would not say "Charging" when battery is 100%, instead it would say "Ready", unless the bin is full, then it would say "Empty bin".

Giving the card these possibilities would make it extremely flexible towards usage. I don't have the "great idea" on how to solve it code-wise and still have the 100% respect of the main features of the current card. Thats why I didn't make a PR.

Have a great day!

Best regards,

Kristian

@benct
Copy link
Owner

benct commented Mar 12, 2021

Great suggestion, however I think this involves a lot of changes and special handling just to "translate" all the different values possible from the different vacuum integrations. I thought about adding the localisation handling from HA, but I don't think even that has the translation values for every vacuum integration (I might be wrong).

The labels (i.e. Full Bin) can be customised already with label: 'Beholder: '. See the examples.

Would gladly take a PR on this, but at the moment I don't think I have the time to put into solving this. I'll keep it open, maybe I (or someone) find the time to do it at some point.

@benct benct added the enhancement New feature or request label Mar 12, 2021
@LittleBigDev
Copy link

Hello,
For the vacuum state, with my Dreame D9 I had to go this way :

state:
  status:
    key: state

And it shows the raw value ("docked"), while in HA it shows "Sur la base" (french translation)
Is there a way to retrieve this value instead of the raw state ? Maybe some kind of template syntax like custom sensors in HA ?

@jaid33
Copy link

jaid33 commented Nov 24, 2022

I experienced the same issue. The native HA card shows translated state, so I guess the translation is somewhere available.
image

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

No branches or pull requests

4 participants