You could just set it to suspend after a period of time in settings>system>power saving> but if you wanted to program it from the remote you can certainly do that as well just like what was recently outlined in this thread.
The details for your use case would be tweaked a bit as your using a different remote with an activity based setup. Probably the easiest way to go for you would be to just install the keymap editor add-on and program a key your not going to use for anything else to edit>global>system>shutdown, back out of all the screens, then save the keymap. In Kodi’s power saving settings make sure you have the shutdown function set to “suspend”. You should now be able to press that button and it goes to sleep, and any other button wakes it back up. Once this is confirmed go back to the myharmony app and remove that button from your layout so it is not accidently pressed and then edit the activity to insert this key to be pressed as part of the shutdown activity commands. This should make sleep instant and automatic when you power off or change activities.