custom-components / sensor.avanza_stock

Custom component to get stock data from Avanza for Home Assistant
MIT License
46 stars 10 forks source link

Wrong direction of currency conversion #119

Closed PatMei closed 3 years ago

PatMei commented 3 years ago

Conversion of SEK to EUR (eur/sek=18988, invert conversion currency = true) is calculating in the wrong direction (deviding instead of multiplying). At the moment, Ethereum ist at about 2k Eur and Bitcoin 15k Eur. Screenshot_20210522-072759_Home Assistant Screenshot_20210522-072734_Home Assistant

claha commented 3 years ago

The id you are tracking is not the actual value of etereum/bitcoin but a certificate, i.e. it follows the changes of ethereum/bitcoin.

https://www.avanza.se/borshandlade-produkter/certifikat-torg/om-certifikatet.html/791709/ethereum-xbt

https://www.avanza.se/borshandlade-produkter/certifikat-torg/om-certifikatet.html/563966/bitcoin-xbt

The current value of theese certificates are 200 sek and 1500 sek which converts to about 20 eur and 150 eur like your picture shows.

I don't think avanza has any product that has the same value as 1 btc/eth. I would search the HA forums/reddit for bitcoin and you will probably find something.

PatMei commented 3 years ago

Thank you for your time!