custom-components / sensor.avanza_stock

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

Showing 0€ #146

Closed sunkan85 closed 1 year ago

sunkan85 commented 1 year ago

Stock: 155722 Oil index have shows 0. Been doing it for 3 days now but the other stocks are working.

oli737 commented 1 year ago

Same issue with all of my watched stocks. All show 0

UsSschi commented 1 year ago

Same issue like oli737, all of my stock sensors no longer receive informations.

Anrolosia commented 1 year ago

I have the same issue. If you look in your logs, you should see something like [pyavanza] Response Error 404: Not Found IMO, this is due to the python library used by the module, and the fact Avanza probably changed their API. Check the issue opened on the github for the library: https://github.com/claha/pyavanza/issues/52

Truepix commented 1 year ago

Same here... just waiting for the code update!!! thanks in advance!

ghyde commented 1 year ago

It looks like there's a fix waiting to be merged. https://github.com/claha/pyavanza/pull/53

ghyde commented 1 year ago

Upgrading to v1.0.13 resolved this issue.

jghaanstra commented 1 year ago

Although I get some readings again the monitored conditions arent working anymore for me. Below an example of my code and the data in HA.

- platform: avanza_stock
  stock:
    - id: 732295
      name: stock_1
      shares: 230
      purchase_price: 8.62
    - id: 732279
      name: stock_2
      shares: 11
      purchase_price: 152.50
  monitored_conditions:
    - changePercent
    - lastPrice
    - lastPriceUpdated
state_class: measurement
changePercent: null
changePercentOneWeek: unknown
changePercentOneMonth: unknown
changePercentThreeMonths: unknown
changePercentSixMonths: unknown
changePercentOneYear: unknown
changePercentThreeYears: unknown
changePercentFiveYears: unknown
changePercentCurrentYear: unknown
lastPrice: null
lastPriceUpdated: null
shares: 230
totalValue: 2639.48
totalChange: 34.96
purchasePrice: 8.62
profitLoss: 2.86
profitLossPercentage: 33.13
totalProfitLoss: 656.88
unit_of_measurement: EUR
device_class: monetary
icon: mdi:cash
friendly_name: stock_1

Are you seeying the same @ghyde ?

ghyde commented 1 year ago

@jghaanstra Yes, I am. The sensors' state is returning the current price, but change, changePercent, lastPrice, and lastPriceUpdated are all null. So, my automations using those attributes are not working.

claha commented 1 year ago

It is expected to not work since what the new api returns is completely different, see https://github.com/custom-components/sensor.avanza_stock/issues/145#issuecomment-1345297918

jghaanstra commented 1 year ago

It is expected to not work since what the new api returns is completely different, see #145 (comment)

Roger that, thanx for the update.

claha commented 1 year ago

Just released v1.1.0 that uses the new api. State and the change/changePercent attributes should at least work now :slight_smile:

Please let me know if you find issues!

jghaanstra commented 1 year ago

Great job, thanks. No issues so far.