Open chairman2s opened 2 years ago
Have the same issue with the same stock in different accounts
Great solution, thanks. Same issue as above, as I am administrator for other users. Hope for a solution soon.
Hey, I only have a single account myself, so not something I plan to implement at this time - but would happily take contributions for it if someone else wants to take a stab at it :)
Same issue here, I have a pension account and a regular stock account with the same stocks in both, only one is shown.
A possible solution is to add the account number after the stock-name. I'm no developer but will have a look.
Got it to work!
I changed the code in sensor.py by adding the line:
account_number = holding['accno']
and modifying:
self._name = f"Stock price for {holding['instrument']['name']} ({holding['instrument']['symbol']})_{account_number}"
self._unique_id = f"nordnet_stock_{holding['instrument']['symbol'].replace(' ', '_').lower()}_{account_number}"
From sensor.py:
class NordnetStock(CoordinatorEntity, SensorEntity):
def __init__(self, holding, coordinator):
super().__init__(coordinator)
self._state = "unavailable"
self._attributes = self._remap(holding)
account_number = holding['accno']
self._name = f"Stock price for {holding['instrument']['name']} ({holding['instrument']['symbol']})_{account_number}"
self._unique_id = f"nordnet_stock_{holding['instrument']['symbol'].replace(' ', '_').lower()}_{account_number}"
self._symbol = holding['instrument']['symbol']
Sorry but I'm not so savvy to create a pull request etc., also this should be a setting I think, so it needs more code.
Good luck and thanks for a great Integration @jippi!
It worked great with my Norwegian Nordnet account. My question is that I have several accounts on nordnet so I added the integration two times. The most important problem is that I own stock of the same kind on both of the accounts. So they come on the same sensor. The problem is that I get only one number of stocks correctly.
The other smaller problem is that the integration appears with the username on the integration page. It should be changeable or use the account name.