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
Open Exchange Rate Integration has a 4 decimal limit, which prevents use of various metals/currencies #103945
Comments
Hey there @MartinHjelmare, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) openexchangerates documentation |
I suggest we simply remove the rounding. |
If that works, great. I didnt know if there was reason for rounding to begin with (i.e. limit string length). Thanks so much for having a look at it. |
Best I can tell, the problem persists. Im seeing in the log a value for gold as the entry: returns the equivalent of 0.0005 also (1/.0005), or 2000. I restarted the integration, and then restarted Home Assistant- in the hope this was an initial update parse thing (lag), but seems a new read was logged, and yet the raw sensor and the template seem to be unaffected. |
The change will be released in the December release as it's technically a breaking change. |
Sorry- my mistake. I saw reference to open exchange rate in the release notes on today's update and assumed this was the change. I hope you are well- enjoy the week/end- |
The problem
In the Open Exchange Rate integration, the API returns textual values for currencies and metals. The Integration converts those to entities. Problem is, it is clipping the returned data to 4 decimal places. For certain entities, this is a problem. Example, Gold (XAU) is returned as Ounces/USD, so the value will be something like 0.0005143. 1/x gets you the dollar cost of an ounce of gold, but the integration only returns 0.0005. Same problem for various currencies. The Vietnamese currency currently trades at 0.000041/USD for example.
It would be better if the integration had a config option that permitted selection of decimal points, but it would be fine to return 8 points, where I dont believe there is need for precision beyond that for any supported currencies or metals.
What version of Home Assistant Core has the issue?
2023.11.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Open Exchange Rate
Link to integration documentation on our website
https://www.home-assistant.io/integrations/openexchangerates/
Diagnostics information
Code is operating as designed- problem is simply the truncation at 4 decimals where more resolution is required for some currencies and metals.
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: