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

alternative currencies were previously supported... weren't they? #3

Open
pironic opened this issue Mar 22, 2021 · 9 comments · May be fixed by #24
Open

alternative currencies were previously supported... weren't they? #3

pironic opened this issue Mar 22, 2021 · 9 comments · May be fixed by #24
Labels
enhancement New feature or request

Comments

@pironic
Copy link

pironic commented Mar 22, 2021

I had the configuration working fine, upgraded to latest and now I can't view my sensors in CAD currency. This suggests to me that the only thing preventing alternative currencies is a check in the python of this plugin? Can you add support for additional currencies?
https://github.com/brianberg/ha-nicehash/blob/master/custom_components/nicehash/sensor.py#L124

Am I crazy to think it worked before? I checked the history on the code and didn't see any recent changes to it...

Version of the custom_component

72543f6

Configuration

nicehash:
  organization_id: !secret nicehash_id
  api_key: !secret nicehash_key
  api_secret: !secret nicehash_secret
  currency: CAD # (default = USD)
  balances: true # (default = false) - Enable balance sensors
  rigs: true # (default = false) - Enable rig sensors
  devices: false # (default = false) - Enable device sensors
  payouts: false # (default = false) - Enable payout sensors

Describe the bug

Should be able to support any currency that nicehash also supports.

Debug log


Logger: custom_components.nicehash.sensor
Source: custom_components/nicehash/sensor.py:151
Integration: NiceHash (documentation, issues)
First occurred: 10:48:29 (1 occurrences)
Last logged: 10:48:29

Invalid currency: must be EUR or USD

@brianberg
Copy link
Owner

brianberg commented Apr 1, 2021

Nicehash does not have a BTC-CAD exchange rate in the list of rates from the API route I am using. I don't know if it was there previously, but currently it is not.

Without a direct exchange rate, I'm not sure how best to convert BTC to CAD.

https://api2.nicehash.com/main/api/v2/exchangeRate/list

@pironic pironic closed this as completed Apr 1, 2021
@pironic
Copy link
Author

pironic commented Apr 1, 2021

Understood. Thanks anyway.

@pironic
Copy link
Author

pironic commented Apr 1, 2021

Hmm... They do have a usd to cad. Would it be possible as an extra step to do the conversion from BTC to usd to cad?

@pironic pironic reopened this Apr 1, 2021
@brianberg brianberg added the enhancement New feature or request label Apr 5, 2021
@brianberg brianberg reopened this Apr 5, 2021
@brianberg
Copy link
Owner

Converting BTC -> USD -> CAD would be possible and makes sense to me. I'd imagine there will be a trivial amount lost during the conversion but should be sufficient for now

@brianberg
Copy link
Owner

Does NiceHash display funds in CAD on the website?

@pironic
Copy link
Author

pironic commented Apr 5, 2021

Screenshot_20210405-144830
They have a setting in your account to select the currency displayed everywhere. Apps/web included.

@Bios-dude
Copy link

I also using IDR and it's supported by nicehash web/program, when i tried to use IDR i think it give me back BTC

@Vitani
Copy link

Vitani commented May 10, 2021

Nicehash also supports GBP, I'd love to be able to see that in the Home Assistant integration

@cathaloc cathaloc linked a pull request May 16, 2022 that will close this issue
@cathaloc
Copy link

Converting BTC -> USD -> CAD would be possible and makes sense to me. I'd imagine there will be a trivial amount lost during the conversion but should be sufficient for now

I submitted pull request #24 that does exactly this.

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

Successfully merging a pull request may close this issue.

5 participants