Amazon Alexa

How to turn On/Off TV or Air Conditioner via Alexa

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.

Step 1

You must learn your remote's On and Off buttons. Here is the learning example code to do that.

Step 2

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.

Step 3

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

Step 4

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)

Complete Code

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