See this blog post of a tutorial on how to build this yourself.
Actions are initiated through voice commands through Amazon Alexa Skill, which then gets relayed to the internet connected Raspberry Pi, which then sends the correct signal through the IR LED to the TV to turn it on, increase the volume, etc.
Basically, it makes your TV voice controlled through Alexa.
Initiate skill
"Alexa, ask the TV to update."
or
"Alexa, tell the TV to update."
Turn TV on/off
"Turn the TV on."
Change source (cable box, Xbox, HDMI2)
"Change the source to the cable box."
Increase/decrease volume
"Increase the volume by five."
Mute/unmute the TV
"Mute the TV."
- ssh into the Raspberry Pi via the following command
ssh [email protected]
tmux
thencd alexa-tv-remote
thenpython index.py
;CTRL+b then d
to exit tmux sessiontmux
thencd alexa-tv-remote
then./ngrok http 5000
(take this URL and add to Amazon Alexa Skill dashboard);CTRL+b then d
to exit tmux session- To shutdown the Raspberry Pi, if need be, run the following command
sudo shutdown -h now
Allows you to SSH into a Raspberry Pi, create terminal sessions, initiate processes, and exit without terminating them.
Create new session
tmux
Detach from session
CTRL+b then d
List sessions
tmux ls
Attach to specific session
tmux attach -t <SESSION_NUMBER>
Software library for using IR LEDs on Linux machines.
Run from command line.
sudo apt-get install lirc
Add to your /etc/modules file by entering the command below
sudo /etc/modules
and add these to that file:
lirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=22
Change your /etc/lirc/hardware.conf file by entering the command below
sudo nano /etc/lirc/hardware.conf
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput"
# Don't start lircmd even if there seems to be a good config file
# START_LIRCMD=false
# Don't start irexec, even if a good config file seems to exist.
# START_IREXEC=false
# Try to load appropriate kernel modules
LOAD_MODULES=true
# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"
# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""
Edit your /boot/config.txt by entering the command below
sudo nano /boot/config.txt
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22
Now restart lircd so it picks up these changes:
sudo /etc/init.d/lirc stop
sudo /etc/init.d/lirc start
# Stop library
sudo /etc/init.d/lirc stop
# Create new recording in config file ~/lircd.conf
irrecord -d /dev/lirc0 ~/lircd.conf
# Move the created config file to the folder where LIRC looks for the config files
sudo cp lgremote.conf /etc/lirc/lircd.conf
#
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
KEY_OK
KEY_EXIT
KEY_UP
KEY_DOWN
KEY_VOLUMEDOWN
KEY_VOLUMEUP
KEY_MENU
KEY_POWER
KEY_MUTE
Accepts POST request with two parameters:
action
(required): What you want remote to do.value
(required): Value for action. If no value, pass inNone
curl -X POST http://url.com/api --data "action=power&value=<on | off>"
curl -X POST http://url.com/api --data "action=source&value=<cable box | HDMI2 | Xbox>"
curl -X POST http://url.com/api --data "action=mute&value=None"
Note: to decrease, pass in negative number.
curl -X POST http://url.com/api --data "action=volume&value=< int >"