-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Screen Lock sensor not working #381
Comments
Hey @azsaurr that's odd! Both KDE and Arch shouldn't be issues for the screen lock sensor. Can you run a few commands in a terminal to help debug this? Firstly, can you get the session path with: dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.ListSessions It should output something like: method return time=1736558140.433922 sender=:1.11 -> destination=:1.832 serial=2709 reply_serial=2
array [
struct {
string "3"
uint32 1000
string "joshua"
string "seat0"
object path "/org/freedesktop/login1/session/_33"
}
... Taking the value of the "object path", can you then run: dbus-monitor --system "path='/org/freedesktop/login1/session/_33'" Then lock and unlock your screen? Hopefully, you'll see some output like: signal time=1736558228.555507 sender=:1.11 -> destination=(null destination) serial=2730 path=/org/freedesktop/login1/session/_33; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.login1.Session"
array [
dict entry(
string "LockedHint"
variant boolean true
)
]
array [
]
signal time=1736558235.927527 sender=:1.11 -> destination=(null destination) serial=2736 path=/org/freedesktop/login1/session/_33; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.login1.Session"
array [
dict entry(
string "LockedHint"
variant boolean false
)
]
array [
] Can you copy and paste the output in this issue? If you aren't seeing any output, it's likely that we can't monitor the screen lock state on your system. Is your system configured with systemd and in particular, |
Can confirm I am able to see the output:
However,
yields 2 results:
and
Maybe the I'm not sure why the first session is there though, and I can't seem to terminate it either:
|
After dozens of reboots, I find that the
I did some reading and apparently the |
Hey nice D-Bus spelunking @azsaurr! I think checking whether the session is a "seat" or not is the right thing to do as you've suggested. Let me wrangle some code to do that. I'll make sure that this change will end up in the next release. Stay tuned and thanks for the debugging help! |
Thanks, I'd do it myself but I wasn't sure if that was the right way to go about it, and I'm not familiar at all with Go syntax. |
@metalmatze are you able to see the |
Go Hass Agent Version
v11.1.0
Describe the bug
Screen Lock sensor is not detecting when screen is being locked.
To Reproduce
Steps to reproduce the behaviour:
screen_lock
sensor in Home Assistant still shows state asUnlocked
.Expected behaviour
screen_lock
sensor in Home Assistant should update toLocked
.Logs
I've removed lines I thought might not be relevant.
Desktop (please complete the following information):
Additional context
I'm aware of the discussion in a previous issue #52 and can confirm that the
dbus-monitor
commands detect the locking/unlocking signals.I believe the
power_profile
error in the logs is due to it running on a desktop and has nothing to do with screen locking, but I might be wrong.Might be related: the session lock controls made available through MQTT on Home Assistant do not work either, but I'm able to lock and unlock through custom MQTT commands by executing
loginctl lock-session
andloginctl unlock-session
.The text was updated successfully, but these errors were encountered: