2 things at play here. One, your Moto X would need an IR transmitter to send the commands. Two, your TV would need to support a BT or WiFi remote if your device does not have the IR transmitter, and any app you install would have to support the same.
My LG TV has an app that allows me to control the TV as long as the TV and the phone are on the same network. Since they're both on my home WiFi when I'm home, I could change inputs and control the smart functions from my phone, but that defeats the purpose of the Harmony One remote that I have.