You have to set keys which switch to the desired HDMI input. 2 differnet keys in your case ... one for the Fire TV und one for the Xfinity. Then you have to use 2 other keys to switch the desired device on. Now you can combine them in a macro. Thats the general was but ... The only problem is that bluetooth commands are not allowed in a macro. The Fire TV uses bluetooth :-( ... i do not know th Xfinity device. So its probably not possible to do it because you have to mix infrared and bluetooth commands or never turn off the Fire TV (and the Xfinity which i do not know). Use the X1 instead the U1