I recieve values, its just not alligning with the actual numbers from Avanza.
Se below the states from this sensor. Unless this is is some currency and not percent, but then it shouldnt be this much
Is there a way to set a specific date for the changepercent etc.
Instead of using the 1year, 3year etc marks i would like a set date which would allow me to track the stocks changes since that date.
The 1 year, 3 years etc. are given pÄ the avanza api. When you set a purchasePrice you should get the following attributes profitLoss (i.e. +/- SEK sinve purchase date), profitLossPercent and totalProfitLoss (which is profitLoss multiplied by number of shares). Hope this is what you are looking for
I see now that this is not at all documented in the README đ«Ł
Yeah that iÂŽve figured out
but, since im buying stocks montly the number of shares and purchase price changes all the time⊠Therefore a % from first purchase date would give me an estimate of how well a stock is performing.
IÂŽm aware this wount show me how much my investment has increased but it will still give me a good indication.
Ok, so what you actually would like is to be able to have changeSinceYYYY_MM_DD and changePercentSinceYYYY_MM_DD for one or more custom dates?
The current api endpoint that I am using doesnât provide any historical data (only the fixed ones 1 week, three months, etc.). But I guess it should be possible to get the data since they have graphs on the website.
exactly, however its not something that should be spent days solving.
I can live with the set dates.
The better, but probably a difficult solution, would be the posibility to automatically update the purchase price (and shares) on a monthly basis depending on how much you are investing. This would make the attributes in the integration usuable. But dont lose sleep over it
Hi, Could I get some assistance with setting this up please.
So far I have added sensors: !incude sensors.yaml to the configuration yaml and created a file called sesnors.yaml In the sensors.yaml file I have copied the example template and modified it with my share number. Where do I go from here. How do I see the data? The integration is not setup. When I try to add the integration it refers me back to the configuration.yaml
I am not familair with what I need to do with yaml code. I have migrated from Smartthings and learning HA. I mostly use the UI for automations etc.
First you need to learn how to install custom components (like this one). The simplest way is probably using https://hacs.xyz. I would also suggest to skip doing includes until you have something working in a single yaml file
Well done then! I havent got around to make it possible to use the gui, I kinda prefer yaml myselfâŠ
One error I can see directly is that you should remove âsensor:â from your sensor.yaml and the reindent so the â- platformâŠâ is furthest to the left.
Under Developer tools there is a Check configuration button that hopefully will give you some meaningful information if something is wrong with your yaml config
Thanks, removing the sensor: from the sensor.yaml code and re-indenting the text helped. I can now see the sensor value.
I was copying the code from the example code and also googling how to set up a custom sensor. The thing I have found with all HA integrations is that they presume that you know what you are doing when setting up the configuration.
The check configuration button wansnât helpful as the wrong code doesnât prevent HA from starting.
For info this is the code that worked in the sensor.yaml file
No since this is a yaml-only integration and reloading wouldnt really do anything since the update of each sensor is stateless. Since you didnt provide any errors logs it is impossible to tell if there was something wrong with the integration or something else.
Hi Claes, thank you for setting up and maintaining your integration! Itâs easy to use.
With stocks it works fine (price an currency). But for gold/silver/platinum I have a little issue: The price I get is in USD and correct. But HA indicates that the price is in SEK.
Did I do anything wrong? Can I change this or is this a bug from the bank?
It used to work with our currencies, I only have Swedish assets nowdays though. Could I have your config for the âstocksâ that does not work for you?
I have some vauge memory that home assistant recently did something about currencies so maybe they try to be smartâŠ