Mario77, no not only a backlight. I want to turn off the power supply of the pi. If I turn kodi off the tv will automatic power down. But some times I forget turn off the pi supply.
I use also a relais (gpio) which turns the loudspeaker/amplifier delayed on (startup.sh) and off (shutdown.sh) to avoid the switch-on pulse. Now I want a same method to switch the power of the pi supply of after the partitions would be clean. (Otherwise I need a hardware cuircuit for delaying like a car interior light or a toilet fan.)