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.
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.
HAOS is based on Alpine Linux, which don’t have systemd folder and also no logind.conf file present (at least on my side, or is it an issue when using terminal from add-on?).
The alternative seems to be a thing called acpi, which is described here: Power management - Alpine Linux
I can confirm acpid is installed in HAOS, but I don’t have the files “acpi.conf” and “acpi.map” either. Sooo… I’m not sure what I should do now.
Never mind, I was stupid, and searched too long to realize, it doesn’t happen to me lol.
I tested on another linux raspberry pi device which reacts to power button on remote (and it shuts down), and I assumed it does the same thing on HAOS, turns out, it doesn’t.
Forgot to post my hardware:
Raspberry Pi 4
A random brand of air-mouse and keyboard with usb dongle, the dongle is recognized as HAOBO_Technology_USB_Composite_Device.
Did you ever have any luck with this? I’m in the same boat and cannot find a way to solve it. I can’t access logind to get it to ignore the power off key press from my USB remote. Pressing it shuts down home assistant instead of powering off my TV via the automation.