On computer wake from sleep, SessionStateSensor remains Unknown
Opened this issue · 3 comments
I have two Windows 10 machines in my office. Both exhibit this behavior.
After choosing "Sleep" from the Windows start menu, upon waking back up via a Wake On Lan command (wake on magic packet via LAN) or keyboard, HASS W doesn't report a change from the SessionStateSensor
to Home Assistant.
Waking the machine puts me back into the lock screen, by the way, for security purposes.
The LastActivity
sensor works (is picking up when I move my mouse), but the SessionStateSensor
(InUse, Off, etc) is stuck on Unknown
.
If I unlock my screen, then lock my screen again, SessionStateSensor
goes to Locked
. But I don't want to have to do that after waking up and unlocking the first time .
Here's the timeline
- Launch HASS Workstation
Unknown
->InUse
- Click "Sleep" in Windows
InUse
->Locked
->Off
->Unknown
(happens over 1-2 minutes) - Wake computer by tapping the keyboard or using a wake_on_lan command
Unknown
(no transition) - Unlock and get back into Windows still
Unknown
(no transition, butLastActivity
is working) - Lock screen (Windows + L)
Unknown
->Locked
- Unlock screen (enter password)
Locked
->InUse
If it's stuck in Unknown
and I edit the SessionStateSensor
in the UI, (without actually changing anything) and click save, it bumps it to InUse
in Home Assistant.
I have the exact same issue, exactly as described.
Related to #168 too
FYI I am using this workaround.
- Create a HASS WS sensor for GPU or CPU temperature.
- Create a template binary_sensor in HA called "PC Power" and set it to this new HASS WS sensor:
value_template: "{{ is_number(states('sensor.bebop_gpu_temp')) }}"
- Profit. Apparently the GPU/CPU sensor always seems to work after sleep/wake, and is instantaneous. It's either a number, or it's
unknown
when the PC is off (not a number).