Hass Agent is picking up incorrect values for the webcam and microphone
Hey there, over the past few days I've noticed Hass Agent is saying my Microphone and Webcam are being used by OBS64 even when OBS wasn't open so I uninstalled both OBS and Streamlabs to test, it's been 3 days since I uninstalled them and its still saying they're being used by OBS64. It's not stuck either, the value does change when I turn off the PC but if I don't have the service installed and It's not running in task manager, I don't know what to make of this.
I use my Desktop Microphone sensor as part of a do not disturb mode too so I need to get this sorted.
Windows Version 22h2 Build 19045.3324 Hassagent version 2022.14.0 UI Langage English Installed via installer
Is it possible that the data is comming from retained MQTT messages? Does the sensor update with other programs? (For example does it show OBS+Discord when you launch it and join any channel) You say that the value changes when you turn off pc - changes to what?
Is it possible that the data is comming from retained MQTT messages? Does the sensor update with other programs? (For example does it show OBS+Discord
I'm unsure what's causing it to be honest. The status does change if I open another application. I tried it with Voice AI this morning and It switched processes and if I turn that application off it switches back to formerly OBS now it's saying discord for everything. It's basically refusing to fall into an off state at any time even if I completely close and uninstall the applications.
On my laptop however It's not behaving like this, the microphone status is only turning on when I enter a call on discord for example which leads me to think the issue is to do with the Hass installation on my desktop rather than MQTT on home assistant.
I've just tried a clean slate in the application, that hasn't worked either
Could you please try to clean the MQTT topic of the sensor? You can do it with MQTT Explorer for example.
It should look something like this:
homeassistant/sensor/AMADEO-PC/microphoneprocess
(there may be differences as I'm running branch with some code changes)
I have a suspicion that this is not HASS.Agent issue per se but maybe some retained message issue.
Installed MQTTexplorer and cleared both microphone active and microphone process. They both fell to an unknown state, I then noticed when i jumped into a discord call, they weren't changing from unknown so I restarted Hass Agent. They're now stuck in an on state and discord again despite me jumping back out of said call
I'll need to think about this... Is the faulty state consistent across the landscape? I mean, if it gets stuck at "discord" for example, is this also visible in the:
- HA
- HASS.Agent sensor config page
- MQTT topics ?
I'll need to think about this... Is the faulty state consistent across the landscape? I mean, if it gets stuck at "discord" for example, is this also visible in the:
- HA
- HASS.Agent sensor config page
- MQTT topics ?
Yes it is. Checking Home Assistant and Hass agents last known value, they're both listed as "on" and "discord" despite me not being in a call right now.
Since it's only happening on my desktop with Hass I'm thinking about doing a full system reset on the Desktop. A bit of an extreme measure with a few days to get everything installed again probably but to rule out the PC being the problem.
I don't understand what the issue was still but a complete factory reset of my PC appears to have it working again.
I am also experiencing this issue. My MicrophoneActive and MicrophoneProcess remain stuck in an old state. Resetting my PC is not an option for me.
For example, I was on a WebEx call, but have since closed the application. The MicrophoneActive shows On and the MicrophoneProcess shows CiscoCollabHost (which is WebEx) even though the application was closed and the microphone is no longer being used. If I clear the MQTT messages, the sensors change to Unknown. When I call PublishAllSensors, the microphone state return to On and CiscoCollabHost.
I tried shutting down Hass.Agent and clearing MQTT, which sets the sensor states to Unknown. However, if I call PublishAllSensores, they return to On and CiscoCollabHost again.
I even tried rebooting and clearing MQTT, but the sensors still show the incorrect state.
I decided to go through the code and found the microphone sensor in the Hass.Agent.Shared project. It's basically looking at the registry to determine the status of the microphone. I was able to find an old registry entry that looks like it was never cleared (it was even named XXXX_old!). After deleting that entry, the microphone started reporting the proper state.
The 2 registry locations it looks are are HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone. Look for all the keys under those for a LastUsedTimeStop with a value of 0. Deleting that value should solve the issue without resetting your PC.