Get discord mute status

Hi, does someone know of a way to get the current mute status of discord. I'd like to colour a light based on mute status but it seems quite hard to get info out of discord locally. Thanks!
Solution:
For anyone finding this thread: Discord does not work nicely with windows mic status. There is at the moment no easy way of getting the mic status unless you use something through discord's own API. As this is nothing to do with Hass.Agent its not possible at the moment....
Jump to solution
13 Replies
DrR0x
DrR0x5mo ago
Yeah that was the original plan for the microphone sensor Annoyingly discord is a PITA and this doesn't work Supposedly discord has chosen not to make the info accessible for privacy reasons Sounds like a CBA to me
barrelltitor
barrelltitor5mo ago
https://discordpy.readthedocs.io/en/latest/api.html?highlight=voice_state found this this is python though, but i assume they just call discord's rest api also found this which has a selfMute so it must be coming from somewhere https://discord.js.org/docs/packages/discord.js/main/VoiceState:Class
DrR0x
DrR0x5mo ago
You could definitely use a nextcord python app to get the status, but that is a lot extra work
Lukas Vance
Lukas Vance5mo ago
Wrong thread
Solution
DrR0x
DrR0x5mo ago
For anyone finding this thread: Discord does not work nicely with windows mic status. There is at the moment no easy way of getting the mic status unless you use something through discord's own API. As this is nothing to do with Hass.Agent its not possible at the moment.
Syntox
Syntox5mo ago
Sorry, I somehow didn't got pinged and forgot about it. The only local way I found is using the RPC API of the discord client which uses a websocket connection accessible through the loopback interface for example. But I agree that this isn't in the scope HASS.Agent. However, would it be possible for HASS.Agent to provide some sort of local API so custom scripts can be easily hooked up? I am not familiar, if or how this could be done in windows / C# but this is one way I could imagine it: 1. Create custom sensor in UI (maybe with configurable default value) 2. Call endpoint (.dll or something else idk) from custom script and pass sensor name and sensor value to it This would provide a generalised and easy way to integrate custom sensors that don't fit into the concept of HASS.Agent while still providing support for them.
DrR0x
DrR0x5mo ago
This is possible however Ur aim is still perfectly achievable through the current PowerShell sensor. You just setup the PowerShell script to connect to RPC and check mute. If that is difficult you could choose to have a rpc server script rename a file in a directory when mute is changed and then a PowerShell script through hass.agent that checks the name I agree it could be slightly cleaner by doing a .DLL or something as you suggested but I'm hesitant due to the extra work, not necessarily of implementation but of keeping it working with such a wide range of testing that needs to be done
Syntox
Syntox5mo ago
I'm aware of the Powershell sensor but I would like to have near instant updates. Authorising to discord or writing to a file every second doesn't seem viable to me. Guess I'll add the sensor via mqtt directly. Thanks for your time anyways
DrR0x
DrR0x5mo ago
Ah okay, that's fair. @Amadeo thoughts? My guess is this could be implemented but would be lower on the priority list
Amadeo
Amadeo5mo ago
Hm, please verify if my understanding is correct: instead of HASS.Agent invoking something the idea would be to allow other processes to inform HASS.Agent about state of X that would be instantly updated?
Syntox
Syntox5mo ago
Exactly!
Amadeo
Amadeo5mo ago
Can't promise it l being in v2 but for v3 for sure On a quick thought I imagine a loopback port that accepts a json with sensors name, value & attributes
Syntox
Syntox5mo ago
Sounds great! Thanks
Want results from more Discord servers?
Add your server