Custom component: Nintendo Switch Online

Hi. I made a new custom component that shows the state of users on Nintendo Switch Online.

The API only allows getting the state of your friends (not your own state… :confused: ), so if you need your own state, you need to create a new account and add it as a friend.

The component adds a binary sensor for each friend in the account and shows ON if the user is online, with the game in use displayed in the attributes.

You can find the component on my GitHub: GitHub - MiguelAngelLV/ha-nintendo-switch: Nintendo Switch Online custom component for Home Assistant

Thanks for this, just tried it and it is working great :slight_smile:

Is it Nintendo Switch Online that returns ‘—’ for Game when someone stops playing, or is it this integration?

It is the intragration.

hello,

i have some problems installing this.
i get this error

Schermafbeelding 2024-11-23 181509

and from the log files

Logger: aiohttp.server
Bron: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448
Eerst voorgekomen: 16:35:29 (6 gebeurtenissen)
Laatst gelogd: 18:14:00

Error handling request

File "/config/custom_components/nintendo_switch/config_flow.py", line 52, in async_step_user
    await self.async_set_unique_id(f"nintendo-online-{account['nsaId']}")
                                                      ~~~~~~~^^^^^^^^^

do you know how to solve this?

The same here, I was excited to use it.

I solved in the last version :slight_smile: