It is very easy to control TVs, Air conditioners or any device that supports infrared communication using Amazon Alexa. In this tutorial we will learn how to control home applicances with On and Off requests using Amazon Alexa.
You must learn your remote's On and Off buttons. Here is the learning example code to do that.
Once you have learned On and Off button IR codes, you are ready to transmit it back. Here is the learning example code to do that.
Now you are ready to integrate with Alexa. You already know how to emit the On and Off buttons in previous steps. Now you need to integrate the Turn on and Turn Off Amazon Alexa voice commands. To do that you have to connect your board to Sinric
Signup for Sinric account. Install the Amazon Alexa Skill. Create a smart home device. Connect your ESP to Sinric platform. (Detail instructions are on Sinric home page)
You can find the complete Amazon Alexa integration here
When you ask Alexa to find connected devices, it will send a UPnP broadcast your WiFi network to detect any smart home devices connected. Will emulate a smart home device named "TV" and respond to On/Off requests from Amazon Alexa. (This might not work for all models)
Here's the full example