Configuration not getting validated
AndreiGr opened this issue · comments
Hi there,
I installed the component from HACS, restarted the HA and then added the config part.
Now, I am trying to check my config and restart, but it's just stuck at checking the configuration, any ideas why this could be?
My config snippet:
- platform: discord_game
token: <token>
members:
- 287694783730810880
Hi, do you have sensor:
there and token filled?
sensor:
- platform: discord_game
token: someSecretToken1234
members:
- 287694783730810880
Small update
I just put the component config back into the .yaml to take the screenshot above, and now the config got validated without any issues.
No clue why it didn't want to validate it last night.
And which version are you using? If you are on the pre-release version (any 5.x.x), then you might also need to add channels
.
sensor:
- platform: discord_game
token: someSecretToken1234
members:
- 287694783730810880
channels:
- someChannelUID
If you don't need channels feature, you can change your version to the release one, they are the same only pre-release has channels feature.
I'm using the stable version (4.2.6, I think).
I managed to add the config and no complaints from HA.
But, the bot is offline in my server, and the status of my user in HA is unknown. Any clue what I did wrong?
Try restarting HA (completely, not just reloading config). And if it is still offline, there might be some error in HA log.
I'm always fully restarting, never actually used the config reload, haha.
Indeed there is an error in the logs:
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/discord_game/sensor.py:60
Integration: discord_game (documentation)
First occurred: 12:12:05 PM (1 occurrences)
Last logged: 12:12:05 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/discord_game/sensor.py", line 60, in start_server
await bot.start(token)
File "/usr/local/lib/python3.11/site-packages/nextcord/client.py", line 673, in start
await self.connect(reconnect=reconnect)
File "/usr/local/lib/python3.11/site-packages/nextcord/client.py", line 614, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
nextcord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
I had only the first two checked, because in the guide there's no mention about the message content intent.
I updated the guide. There was a change in the NextCord library, which this integration uses, few months ago that made the last one also required.
There's no way to also get more details about the user, like if they're on mute/deafen, right?
It is and it is already implemented, look at entity attributes in HA. It only works if the user is currently in a voice channel on your server though.
voice_channel: 👫Private
voice_server_deafened: false
voice_server_muted: false
voice_self_deafened: true
voice_self_muted: true
voice_streaming: false
voice_broadcasting_video: false
voice_afk: false
Oh ok, didn't see the long list of entity attributes.
I was honestly hoping it would see my mute/deafen status when I'm in other servers as well, but it kind of makes sense it's not really possible, haha.