Tnx! Unfortunately the script didn't get called. I think maybe it has something to do with how system.d works now in libreelec 8. I don't understand it very well.
However I found something that works:
Code
cd .config/system.d
cp /usr/lib/systemd/system/kodi-lirc-suspend.service kodi-profile-logoff.service
Then simply change kodi-profile-logoff.service to something like this:
Code
[Unit]
Description=Profile logoff sleep hook
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/bin/kodi-send --action=System.LogOff
[Install]
WantedBy=sleep.target
Display More
Next, register the service