I have a nuc NUC7i5BNH connected to an hdmi switch (a device that sends to the output the last input it has received). There's an issue with the nuc that I send it to sleep (windows 10pro) and about 30 seconds later it boots again.
I tried upgrading firmware and drivers, and also disabling from the bios some options (booting from thunderbolt / booting from CIR), but the behaviour continues.
I would like the nuc to be awaken only from keyboard
Are you connecting this switch to the HDMI connector or (via a dongle) to the USB-C connector? Unfortunately, if you connect via the USB-C connector and the monitor (or the switch acting as a load) can communicate via USB, then this could be a source for awakening the NUC. Though connecting/disconnecting a monitor is not a wake event, anything on the USB interface will be considered a wake event (there is no filtering of events via USB because it would require wake-up to determine which device is generating the event).
I detailed above the issue with wake via USB. You cannot choose to wake only via keyboard. Now, I am talking about BIOS-level wake. While in Sleep (as opposed to Hibernate) state, you can, within Windows, configure that only specific devices can cause a (Windows-level) wake event. In this case, Windows will partially wake, check the event and, if it is not from an enabled source, put itself back in the Sleep state.
Just a suggestion: Some people avoid situations like this by disabling USB Wake and waking their NUCs only using a (CIR-based) remote. Obviously, this might only make sense for a NUC used as the HTPC; one used as a desktop is typically not used this way.
Hope this helps,
I finally found the moment to test this, it seems that the weird behaviour that I was getting has been fixed by the current firmware release, because I can no longer reproduce it. I'll keep this post in my pocket to check again in case the issue reaperars.