HASS.Agent
HASS.Agent copied to clipboard
Bug: "Key" commands end up with key being "held down"
Describe the bug I'm using the button entity created by a "key" command in HASS Agent on a Home Assistant dashboard. When I press said button it sends they key command correctly however it then appears to be continually sending it, almost like holding the key down on a real keyboard. Not 100% sure if this is a Home Assistant issue or not but I don't have issues with non HASS Agent Home Assistant buttons triggering more than once so I think it's something here.
To Reproduce Steps to reproduce the behavior:
- Add a "key" command with the "button" entity type
- Add the button in Home Assistant to a dashboard
- Press the button on the dashboard
Expected behavior A single key press to happen per press of the button on the dashboard.
Screenshots If applicable, add screenshots to help explain your problem.
Misc info (please complete the following information):
-
Windows build (ideally screenshot/info of
winver.exe
output): -
Windows' UI language: English UK
-
HASS.Agent version: 2022.14.0
Please check what's applicable (multiple answers possible):
- [x] Installed via installer
- [ ] Installed manually
- [x] Problem occurs in HASS.Agent
- [ ] Problem occurs in Satellite Service
Additional context Add any other context about the problem here.
Logs
If possible, please provide the logs of HASS.Agent and - if applicable - the Satellite Service. You can find HASS.Agent's logs by going to the main window, then Configuration
-> Logging
-> open logs folder
. The Satellite Service's logs are in the same window, but the Satellite Service
tab -> open service logs folder
. If you want, you can mail them to [email protected]
This is weirdly working in a notepad window but whenever I have steam big picture open and try to use it in a game it gets stuck 🤔
I've been able to reproduce this on staging-main branch. Executing the command on notepad++ works as expected but doing the same with Steam BigPicture results in behaviour described by you. I wouldn't go (yet) so far as to say it's HASS.Agent's fault as it's using Windows API for key emulation but that's an improper behaviour nevertheless - I'll look into it.
Yeah, looks like we're not doing it properly - missing "KEYEVENTF_KEYUP". Now that I think about it...I had some strange behaviour when trying to wake PC with windows key, thinking about it I should have connected the dots that this was the issue...
Same problem here with media keys.
I've an automation running what sends a media player command when the mic is open for a webcall and always my 'Alt" key is stuck after the agent sends the command! Its very annoying!
service: media_player.media_stop data: {} target: entity_id: media_player.hassagent
Actually whatever media player command hass agent executes, alt key is always stuck and i need to press the alt 2-3 times to recover my keyboard.
When can we expect this in a new version?
+1
Silly q, but wahts the easiest way for me to run the beta https://github.com/hass-agent/HASS.Agent/pull/1 since it says it fixes this problem?
Silly q, but wahts the easiest way for me to run the beta https://github.com/hass-agent/HASS.Agent/pull/1 since it says it fixes this problem?
The issue you've linked is a different repo. If you to that repo and find the releases section you can grab the installer. I think there's some migration instructions in the readme to follow first though.