dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
590 stars 110 forks source link

Translations not working #71

Closed ahmadtawakol closed 2 years ago

ahmadtawakol commented 2 years ago

For the Frost Risk, Thermal Perception and Simmer Zone sensors, their states are not being pulled from the translation files. Instead it just shows the string for the translation keys. I haven't seen anyone report this issue and I believe the translations were only added recently, so is this happening for me only or is it the same for everyone?

Screen Shot 2022-01-12 at 12 06 42 PM Screen Shot 2022-01-12 at 12 04 59 PM

rautesamtr commented 2 years ago

Hi states aren't translated. You should have your translation in the dashboard. It's also the same for home assistant, e.g. state of the heater. I think one of the main reasons is that you can have language indepedent automatisation. image image

ahmadtawakol commented 2 years ago

Hmm, interesting. This is the first time I come across this. I'm using the state of the sensor in a template, so it shows as no_risk instead of No risk.

Looks like there isn't a way around this either. I'll close this since this isn't a problem with this component.

rautesamtr commented 2 years ago

Could you post your template so i could give it a look to make sure it isn't a bug?

ahmadtawakol commented 2 years ago

${states['sensor.bedroom_simmerzone'].state}

rautesamtr commented 2 years ago

Looks like there's no easy solution for now other then to do custom value conversion. The problem is we use a custom device_class for the translation and template entity only accepts one of the official ones.

ahmadtawakol commented 2 years ago

I did find this: https://community.home-assistant.io/t/how-to-send-translation-arguments-to-the-translation-custom-integration/143965/3

I'm just not sure how to implement it.

rautesamtr commented 2 years ago

Thats basically what we are doing. What you are looking for is this issue: https://community.home-assistant.io/t/get-translated-entity-state-in-component-template/112721