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

Translation for mower states #228

Closed
YoMan12 opened this issue Jun 13, 2024 · 14 comments
Closed

Translation for mower states #228

YoMan12 opened this issue Jun 13, 2024 · 14 comments
Labels
enhancement New feature or request

Comments

@YoMan12
Copy link

YoMan12 commented Jun 13, 2024

I'm sorry for stupid question but I can't find ...

How to add translation to the states/states details? I have a json file in custom_components/indego/translations/ but nothing changes, everthing is in EN.
Probably it is very simple but I do not know how :(

@kimzeuner
Copy link
Contributor

You have to add CONF_TRANSLATION_KEY to the entity definition in the init.py (like it is done for the alert entity in the actual version 5.7.0). After that you can define your translations in the translation file

@YoMan12
Copy link
Author

YoMan12 commented Jun 18, 2024

Hmmm.... would You like to explain something more? Paste a link to manual?

I can see in init.py in lines 96-103:

ENTITY_ALERT: {
        CONF_TYPE: BINARY_SENSOR_TYPE,
        CONF_NAME: "alert",
        CONF_ICON: FUNC_ICON_MOWER_ALERT,
        CONF_DEVICE_CLASS: BinarySensorDeviceClass.PROBLEM,
        CONF_ATTR: ["alerts_count"],
        CONF_TRANSLATION_KEY: "indego_alert",
},

I presume I should add something like that in that place but I'm not so good at it.

@kimzeuner
Copy link
Contributor

You are already on the right way.
Did i understand you right that you want to translate the mower state and mower state detail ?! Then you have to add
CONF_TRANSLATION_KEY: "mower_state"
and
CONF_TRANSLATION_KEY: "mower_state_detail"
to ENTITY_MOWER_STATE and ENTITY_MOWER_STATE_DETAIL in lines 104 and 112 (similar as you have seen it in the ENTITY_ALERT).
After that you need to specify the text that you want to translate in your translation file.
In line 40 of eg the german translation file you find

"entity": {
  "binary_sensor": { 

and so on
as the state entities are sensors you have to add something like this between entity and binary sensor (here is my code that i use for my german translations).

        "sensor": {
            "mower_state": {
                "state": {
                    "Mowing": "Mähen",
                    "Docked": "Angedockt",
                    "Sleeping": "Schläft",
                    "Paused": "Pausiert"
                }
            },
            "mower_state_detail": {
                "state": {
                    "Reading status": "Status abrufen",
                    "Charging": "Laden",
                    "Docked": "Angedockt",
                    "Docked - Software update": "Angedockt - Software Update",
                    "Docked - Loading map": "Angedockt - Karte laden",
                    "Docked - Saving map": "Angedockt - Karte speichern",
                    "Docked - Leaving Dock": "Angedockt - Verlässt Ladestation",
                    "Mowing": "Mähen",
                    "Mowing - Relocalising": "Mähen - Position bestimmen",
                    "Mowing - Learning Lawn": "Mähen - Karte lernen",
                    "Mowing - Learning Lawn paused": "Mähen - Karte lernen pausiert",
                    "SpotMow": "SpotMow",
                    "Mowing randomly": "Zufälliges Mähen",
                    "Diagnostic mode": "Diagnose Modus",
                    "End of life": "Lebensende",
                    "Software update": "Software Update",
                    "Energy save mode": "Energiesparmodus",
                    "Relocalising": "Position bestimmen",
                    "Loading map": "Karte laden",
                    "Learning lawn": "Karte lernen",
                    "Paused": "Pausiert",
                    "Border cut": "Kantenmähen",
                    "Idle in lawn": "Leerlauf",
                    "Stuck on lawn, help needed": "Festgefahren, Hilfe nötig",
                    "Returning to Dock": "Zurück zur Ladestation",
                    "Returning to Dock - Battery low": "Zurück zur Ladestation - Batteriestand niedrig ",
                    "Returning to dock - Calendar timeslot ended": "Zurück zur Ladestation - Kalender Zeitfenser zu Ende",
                    "Returning to dock - Battery temp range": "Zurück zur Ladestation - Batterie Temperaturfenster",
                    "Returning to dock - Lawn complete": "Zurück zur Ladestation - Rasen vollständig gemäht",
                    "Returning to dock - Relocalising": "Zurück zur Ladestation - Position bestimmen",
                    "Returning to dock - requested by user/app": "Zurück zur Ladestation - Angefordert vom Benutzer"
                }
            },

I hope that helps you, unfortunately i can not show it better at the moment because im on vacation and only have access to my HA and github via smartphone.

@sander1988 sander1988 changed the title Translation Translation for mower states Jun 18, 2024
@YoMan12
Copy link
Author

YoMan12 commented Jun 19, 2024

@kimzeuner thank You for "wasting" Your good time then. Have a nice vacation :)

According to the main question - I have a translation file, it has been already made by @zmechu (PL) [thanks] so I added only the two mentioned lines in entity definitions. I will check it in the evening because the mower has stuck again and the integration is not working.

EDIT: OK. It is working:) but .... I ve got entity that allowed to command the mower, the icon was changing to green during mowing. Now it disappeaered. What could I messed?

@kimzeuner
Copy link
Contributor

No idea why, will have a look if it is the same in my setup when i am back home but i dont think that this is because of your changes as the color should be state based and i think that still the original english state is used for this (standard for lawn mower entities on HA side and not defined in the integration).

@sander1988 sander1988 added the enhancement New feature or request label Jun 22, 2024
@YoMan12
Copy link
Author

YoMan12 commented Jun 28, 2024

Hmmm... I cannot get back to that but ... there was an entity that has an mower icon that became green during mowing, when I clicked on it I could start mowin or get back to the station. I haven't made any extra automations or scripts, it was just after installing integration. Now I'm trying to have it back and I don't know what am I doing wrong or in other way than earlier :( It was usefull option. Maybe it was in previous version and now disappeared?

@kimzeuner
Copy link
Contributor

You can check the following:
Go to your indego integration. On the right side next to your mower there is a button "configure". Click on it an check if you have selected "expose mower as lawn_mower entity..". If not, select it and check if the entity is back (i think a ha restart is needed after selecting it).

@YoMan12
Copy link
Author

YoMan12 commented Jun 28, 2024

I was making it without effect.
Now after couple deinstall and reinstall, downgrading versions & upgrading again it came back.
I was meaning about that "entity"
Zrzut ekranu 2024-06-28 234647

@kimzeuner
Copy link
Contributor

Nice that it is back now. And do you have any problem with this entity ?

@YoMan12
Copy link
Author

YoMan12 commented Jul 2, 2024

Nope .... rather not. It is working as I expect.
BTW I've got a lot of troubles with the mower actually and even Bosch service GB and DE are not able to solve but the HA integration is working OK so far. I will not upgrade till it works ...:)

@YoMan12
Copy link
Author

YoMan12 commented Jul 8, 2024

I think I found the issue .... by first instaling the integration I'm choosing "... as lawn_mower entity" and than there's no entity for remote. Than I need to configure again and ... the option ".... as the lawn_mower" is not choosen. Than I need to check it again and the entity appears. Maybe it is only problem of my HA instance.

@sander1988
Copy link
Owner

sander1988 commented Jul 10, 2024

What's the status of this issue? Maybe someone can create a PR with the new translations?

@kimzeuner
Copy link
Contributor

I will do that until end of the week i think

@sander1988
Copy link
Owner

Closing this issue, let's keep the discussing in on the PR (#241).

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

3 participants