Closed oli737 closed 11 months ago
Could you please provide an example configuration where you get this problem? A quick fix is to just install the previous version for now.
Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:593 Integration: Sensor (documentation, issues) First occurred: 00:32:48 (4 occurrences) Last logged: 00:32:48
Platform avanza_stock does not generate unique IDs. ID 365295_stock already exists - ignoring sensor........
- id: 365295
name: depot1_avanza_stock FTSE All-World DIS
shares: 10
purchase_price: 100.19
- id: 365295
name: depot2_avanza_stock FTSE All-World DIS
shares: 10
purchase_price: 99.93
I am observing the same issue... Got multiple stocks bought multiple times at different prices. Used to work fine, but doesn't anymore. Thx!
I did a small change to the unique id, but the result was then that I've got duplicates of each sensor and would have to manually remove the old ones (since the unique id changed). This is not something I would want to force upon every user of the component, so I will need to see if there is some way to migrate the old unique id. If you are comfortable you can always change this function yourself for now to generate a better id and remove your duplicates. https://github.com/custom-components/sensor.avanza_stock/blob/ff6053ccb91c65bf9a5ba2b843e7057c456470b8/custom_components/avanza_stock/sensor.py#L201
The double sensor I have too without updating to this last version. No idea why is this. I found no way to remove duplicate sensors even when removed from config (and rebooted) and removed the integration too. They still can't be removed.
Very strange, when you click on the entity it should be a button to remove it somewhere. Migration (of unique id) only seems to be possible if using config flow, I may have to dig into that... or just do the update to unique id, maybe most people haven't updated to version 1.0.12 yet
After 2 more reboots i could delete the restored enitiys. All have now the name and "_2".
That is what i've got as well, so to get back the original ids I gues one would have to delete/rename all of the _2
Downgrading to 1.0.11 restored the original behavior. I will keep an eye on this thread before I further update this component!
Had to revert to 1.0.11 as this is also broken for me. I'd say it should be reverted as there is even an example in the readme for using the same id again so there is for sure the intention of having multiple instances of a specific stock.
True, I have an example of that. I will try to get at it ASAP.
P.S. Pull requests are welcome :)
Same problem as before.
id: 365295 name: depot1_avanza_stock FTSE All-World DIS shares: 10 purchase_price: 100.19
id: 365295 name: depot2_avanza_stock FTSE All-World DIS shares: 10 purchase_price: 99.93
Only one sensor show up. I need to separte those two even if its the same stock. Downgarde does not help anymore. Can you please help?
Downgrading to before unique_id was introduced should help, otherwise you could alter the code yourself to make it even more unique by considering purchase_price etc. I don't want to push such a change since it will give new ids for all sensor and you will be left with a lot of unused ones and probably loose your history
Already lost all the history with the 0.11 change that completely broke everything. One entry per stock is not usable at all, most people do not buy stock once.
True but your bank/broker probably calculates your average purchase price for you
True but your bank/broker probably calculates your average purchase price for you
What is I have multiple broker or owners I track?
You can now use the same id in multiple instances
Oh cool thanks.
Unique id is ignoring the same stock I have in different depots of differen prices. I need track them individual which is not working anymore because it is ignoring the other ID now. Please fix that problem.