hass-agent / HASS.Agent

Unofficial development project for the HASS.Agent platform.
https://hass-agent.io
MIT License
374 stars 9 forks source link

Bug: LastActive sensor sometimes doesn't report its value to HA #119

Closed ars4l4n closed 1 week ago

ars4l4n commented 3 months ago

Describe the bug HASS.Agent's LastActive sensor is set to report every 300s and it usually does that but I just noticed it skipped one of its timings and reported after 600s instead.

To Reproduce 1) Create a LastActive sensor that updates every 300s in HASS.Agent. 2) Create an automation based on said sensor and once it behaves weirdly, check HA's Logbook page for times when the state wasn't reported.

Expected behavior LastActive being reported every 300s.

Screenshots chrome_2024-07-12_17-10-41

Misc info (please complete the following information): image

Please check what's applicable (multiple answers possible):

Logs The HASS.Agents logs (non-extended) don't contain any entries for the time the issue occured.

amadeo-alex commented 3 months ago

HASS.Agent won't send the value to Home Assistant unless it changed from the one that was previously sent - is it possible that the computer didn't receive any input throughout those 600s?

ars4l4n commented 3 months ago

It probably didn't since I was watching a netflix show. I was assuming the sensor saw playing video or audio as using the PC as well. I suppose a more accurate name for the LastActive sensor would be LastInput. Is there a way to use video/audio to check for PC usage as well?

Edit: Apparently, you can use the peak volume sensor, that's created by clicking on Sensors>Add New>Audio, for that. I'd need a template for that though. No idea how to make it.

amadeo-alex commented 3 months ago

One option is the peak volume sensor but if the application/browser properly integrates with Windows you could use the media player status to check if something is playing.

amadeo-alex commented 1 week ago

Closing as currently there is nothing to fix..