Apple TV 4 wake and sleep

Im having trouble getting my apple TV’s to reliably switch on / off. ive almost managed to get them to wake up reliably by repeating menu press delay 200ms 6 times with a long menue press to take it back to the main menu, but i cant help that feel there must be a more elegant way of doing this.

Getting them to sleep has proved to be elusive! it accept a long home press to bring up the sleep option but i cant get the touch pad select thats needed to select the sleep option to work at all, ive tried putting delays in to no avail.

Im certain its that im doing something wrong but i cant see what, if anyone has had success with this could you let me have your setting please?