-
Notifications
You must be signed in to change notification settings - Fork 628
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
Sensors entity_id's are localised #1373
Comments
You need to change the language on the device before adding new sensors, this is as designed. If you reinstall you need to make sure to change the language to what you expected. Your best bet is to remove integration, clear data in the app, log back in, change language. The battery sensors are the only one that default to your system language and need to be changed manually. |
@dshokouhi Thanks for the quick response. FYI this also happens with other sensors, not only with the battery sensors. I've tested this with the next alarm. Thanks for letting me know that I can easily change the entity name. What confuses me is the unique id within the app, which I expect to be the same as the entity id in Home Assistant, prefixed with the device name. Perhaps this assumption is wrong, but imho can be a bit confusing. |
@dshokouhi I would get it if the Friendly name were localized but the entity is pretty annoying 😞 |
@dshokouhi I really want to press this issue again. Like @septillion-git said this behaviour seems pretty undesirable. All other Home Assistant integrations use English, non-localized entity id's. Also having to implement Lovelace dashboards and automations based on user preferences is just very counter intuitive. Furthermore setting the app to English will also generate localized id's, which would be a bug if I'm not mistaken. |
@alex3305 and @septillion-git I understand your guys frustration we had other language issues in the past. What I meant as "by design" is that this is how Android works. Any application when first launched defaults to the system language if the app provides translations or it falls back to English. This is just the way android works. We get requests often from users to add more and more languages for translations so its clear that users do indeed want to see the app as translated as possible. We had a few requests from users about how they were not happy with how they cannot change the app language. A contributer came by and added the language field that you see today in App Configuration. This was designed to help alleviate the situation. If you are unhappy with the sensor ID's Home Assistant offers the entity registry for this very purpose. To rename things as you see fit. |
@dshokouhi I do get a lot of users want to see the app in there own language. (Although, as a Dutch it's very common to use English.) To have the option to have the app translated is a good thing! But this does not apply to the entity id's. It's not in line with any other integration to have localized entity id's. So I guess what @alex3305 and I ask is not to have no translation, but to only translate the app and friendly names but please, leave the entity id's for the back-end just in English just like any other integration. |
@septillion-git actually a lot of integrations grab the device name from the product itself which can be localized or not, it depends on the integration. You just may not be using an integration that lets the user name things as they see fit. The mobile app integration does not separate the friendly name from entity ID either so that is not unique to this app. If you guys do not like the entity ID's supplied you can simply change them using the Entity Registry. It was created for this very purpose. |
@dshokouhi Device name, sure. But sensor suffix is very very very rare. Yeah, we can change it but I think this is undesirable behaviour altogether. You will now always end up with a annoying mix as sensor domains are never translated. |
@dshokouhi I believe we can fix this by adding code to apply locale to application class on starting as well as we do it for activities in baseActivity class. Unfortunately I don't have configured environment to check and fix it right now. |
I was still thinking about this especially and you're right about this. However in my experience these integrations also provides the user with entity or device naming capabilities. Which the mobile app integration does not. When I look at some my integrations I see the following:
Within the mobile app I cannot customize the entity names to be in English. Unlike deCONZ where I can do that. Based on the other integration I have, I think the mobile app should generate English entity id's. Perhaps with a localized friendly name like the one displayed within the app. Quick edit: Can this issue be re-opened? |
So we had a brief discussion about this between the other companion apps. For the companion apps we will be sending entity ID and friendly name in English only so that it will match our documentation and to follow suit with the iOS app. We will still show the translations in the app so the interface will remain translated, this is purely for the data we send back to HA. So we will not be using the language picker to determine the entity ID names in this instance, we will just force English as the sensor name being sent to HA. This is not coming from a core requirement and HA does not explicitly mention English has to be used as we have integrations that are region specific, this is just for the companion apps. Reopening while we get a PR ready. |
Home Assistant Android version: 2021.2.2-full
Android version: 10
Phone model: OnePlus 7 Pro
Home Assistant version: 2021.2.3
Last working Home Assistant release (if known): n/a
Description of problem:
The generated
entity_id
's for the sensors are suddenly localized. This happened to me when I re-installed the app today. Since the sensor information screen within the app contain theunique id
property, I think this is a bug. On another phone where I didn't reinstall, this behavior did not show itself. See below.Screenshot of problem:
Re-installed phone:
Old phone:
Additional information:
The text was updated successfully, but these errors were encountered: