I have started using a USB remote / keyboard for various automations. It’s working well, but the power button on the remote will shut down the entire system, which is not desired behaviour.
I am running HAOS on a rPi 4B. I have traced this behaviour to systemd-logind
, and I can see the configuration for this in /etc/systemd/logind.conf
on the host OS, which I access via SSH port 22222. This file, however, is read-only.
Is there a way for me to edit this file, or some other way for me to stop the power button on my little remote from shutting down the entire system? I’d actually like to bind that button to turn the TV on and off.
You’ll need to provide more info, to include the remote brand and the integration that connects the device.
It’s a fairly no-name remote, and it’s integrated using the builtin keyboard_remote
integration (Keyboard Remote - Home Assistant). The remote is a XING_WEI_2.4G_USB
device.
However, what I’m looking for is a way to disable the host system’s behaviour of responding to the power key with a shutdown. This is happening in systemd’s logind service, and the keyboard event doesn’t even reach homeassistant, as everything starts to immediately shut down when the button is pressed.
I can see how to disable this behaviour, it is configured in /etc/systemd/logind.conf
- I just can’t find a way to edit this file.