Closed YoMan12 closed 3 months ago
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
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.
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.
@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?
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).
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?
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).
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"
Nice that it is back now. And do you have any problem with this entity ?
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 ...:)
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.
What's the status of this issue? Maybe someone can create a PR with the new translations?
I will do that until end of the week i think
Closing this issue, let's keep the discussing in on the PR (#241).
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 :(