homebridge-alexa Version 2 - Home Skill Based
Enable Amazon Alexa to control your homebridge smart home devices and accessories. Full support for all Amazon Alexa devices, including the echo 2nd Generation and software based solutions. Uses an Amazon smart home skill based approach for integration between HomeBridge and Amazon Alexa.
Country availability - The plugin is available in these countries, English (AU), German (DE), English (CA), English (US), French (FR), English (UK), Italian (IT), English (IN), Spanish (ES), Japanese (JP), Spanish(US), Portuguese (BR) and Spanish (MX).
Alexa device names are the same as the homebridge device names.
This only supports accessories connected via a homebridge plugin, any 'Homekit' accessories are not supported, and will never be supported.
Alexa, turn on device
Alexa, turn off device
Alexa, set device to 50
Alexa, dim device
Alexa, brighten device
warm, warm white
incandescent, soft white
white
daylight, daylight white
cool, cool white
See example for using a routine to fix the wording
Alexa, raise device ( Open's a garage door )
Alexa, open device ( Open's a garage door )
Alexa, lower device ( Close's a garage door )
Alexa, close device ( Close's a garage door )
Opening a garage door requires configuring a voice pin in the Alexa App.
Adamo Maisano provided a deeper comparison of Thermostat Voice Control here.
Alexa, turn on device
Alexa, turn off device
Alexa, raise the volume on device
Alexa, lower the volume on device
Alexa, volume up 20 on device
Alexa, set the volume of device to 50
These are the remote buttons
Alexa, pause device ( pause/play )
Alexa, resume device ( pause/play )
Alexa, play device ( select )
Alexa, stop device ( back )
Alexa, next on device ( right arrow )
Alexa, rewind on device ( left arrow )
Alexa, change input to input on the device
Panasonic TV: - [email protected]
Sony Bravia TV (Android TV) - [email protected]
Sky Q decoder - [email protected]
Samsung Tizen - homebridge-samsung-tizen
Yamaha AVR - homebridge-yamaha-zone-tv
LG WebOS TV - homebridge-lgwebos-tv
The setup of the plugin is very straight forward, and requires enabling insecure mode of each homebridge instance you want to control from Alexa.
homebridge -I
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-I
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
#DEBUG=
pm2 delete homebridge
pm2 cleardump
pm2 start homebridge -- -I
pm2 save
To review your settings, use command below to check if homebridge was sucessfully registered to pm2. After that, you can try to reboot your system and check whether you can control homebridge devices with Alexa app.
pm2 show homebridge
HOMEBRIDGE_OPTS=-I -U /var/homebridge
https://github.com/oznu/docker-homebridge/issues/79
Variable=HOMEBRIDGE_INSECURE
Value=1
Go to the Docker app
Stop the Homebridge container
Edit the container and go to the Environment tab
Add environment variable
Save and start container
sudo npm install -g homebridge-alexa
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "...."
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"pin": "031-45-155"
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"routines": true
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"blind": true
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"door": true
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"debug": true
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"refresh": 900
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"filter": "192.168.1.122:51826"
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"deviceListHandling": "deny", // or allow
"deviceList":
[
"LightBulb",
"GarageDoor",
"SecureDevice"
]
}
],
"platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"combine": [{
"into": "TV",
"from": ["KODI", "Power (TV)"]
}, {
"into": "Front",
"from": ["Yamaha"]
}, {
"into": "Rear",
"from": ["Yamaha"]
}],
}
],
Alexa, raise the volume on
."platforms": [
{
"platform": "Alexa",
"name": "Alexa",
"username": "....",
"password": "....",
"speakers": [{
"manufacturer": "...",
"name": "..."
}]
}
],
ie
{
"platform": "Alexa",
"username": "...",
"password": "...",
"name": "Alexa",
"speakers": [{
"manufacturer": "Yamaha",
"name": "Front"
},
{
"manufacturer": "Yamaha",
"name": "Rear"
},
{
"manufacturer": "HTTP-IRBlaster",
"name": "Panasonic"
}
]
}
Alexa, change to input to
. For the names of the inputs, Amazon provided a list ( see alexa name below ) that you can choose from. You can map multiple alexa names to the same button as well.Alexa, change input to Tuner on the TV
Alexa, change input to HDMI 1 on the TV
{
"platform": "Alexa",
"username": "...",
"password": "...",
"name": "Alexa",
"inputs": [{
"into": "TV",
"devices": [{
"manufacturer": "HTTP-IRBlaster",
"name": "Tuner",
"alexaName": "TUNER"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "Tuner",
"alexaName": "TV TUNER"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "Tuner",
"alexaName": "TV"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "HDMI1",
"alexaName": "HDMI 1"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "HDMI1",
"alexaName": "TV KODI"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "HDMI1",
"alexaName": "MEDIA PLAYER"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "HDMI2",
"alexaName": "HDMI 2"
}, {
"manufacturer": "HTTP-IRBlaster",
"name": "HDMI2",
"alexaName": "TV NETFLIX"
}]
}],
In my setup I use an OTA Antenna, hence the Tuner option and have a KODI box on HDMI 1, and a Apple TV we use for Netflix on HDMI 2. For the alexaName's "TV KODI", "TV TUNER", and "TV NETFLIX" these were not part of the Amazon documentation and may stop working at any time or may not work in your region.
into - Name of the existing accessory to add the input function to. In my setup this is my Apple TV accessory.
manufacturer - Is the manufacturer of the accessory as shown in the Home App
name - Is the name of the accessory as shown in the Home App
alexaName - This the input your are asking Alexa to change to.
AUX 1, AUX 2, AUX 3, AUX 4, AUX 5, AUX 6, AUX 7, BLURAY, CABLE, CD, COAX 1, COAX 2, COMPOSITE 1, DVD, GAME,
HD RADIO, HDMI 1, HDMI 2, HDMI 3, HDMI 4, HDMI 5, HDMI 6, HDMI 7, HDMI 8, HDMI 9, HDMI 10, HDMI ARC, INPUT 1,
INPUT 2, INPUT 3, INPUT 4, INPUT 5, INPUT 6, INPUT 7, INPUT 8, INPUT 9, INPUT 10, IPOD, LINE 1, LINE 2, LINE 3,
LINE 4, LINE 5, LINE 6, LINE 7, MEDIA PLAYER, OPTICAL 1, OPTICAL 2, PHONO, PLAYSTATION, PLAYSTATION 3,
PLAYSTATION 4, SATELLITE, SMARTCAST, TUNER, TV, USB DAC, VIDEO 1, VIDEO 2, VIDEO 3, XBOX
{
"platform":"AppleTV",
"name":"Apple TV",
"devices": [{
"id": "Cottage",
"name": "TV",
"credentials": "...." }
],
"showDefaultSwitches": true,
"defaultSwitchesIncludeATVName": true,
"showPairSwitches": false,
"hideWelcomeMessage": true
}
Please note that the name in brackets ie (TV) will be the Name alexa uses to control your AppleTV
{
"platform": "AppleTvPlatform",
"devices": [{
"name": "Family Room (TV)",
"credentials": "XXXXXXXXXXXX",
"isOnOffSwitchEnabled": true,
"onOffSwitchName": "Power (TV)",
"isPlayPauseSwitchEnabled": true,
"playPauseSwitchName": "Play (TV)",
"commandSwitches": [{
"name": "Right (TV)",
"commands": [{
"key": "right",
"longPress": false
}]
}, {
"name": "Left (TV)",
"commands": [{
"key": "left",
"longPress": false
}]
}]
}],
"isApiEnabled": false
}
Also to enable turning on and off your Apple TV, add this to your homebridge-alexa configuration.
"combine": [{
"into": "TV",
"from": ["Power (TV)"]
}]
This uses the plugin homebridge-yamaha-home and a Yamaha Receiver which includes Spotify and Spotify Playback Controls.
As of April 14, 2019 I changed the Homebridge device parser massively, to add support for Locks and Heater/Cooler devices. To go back to the old device parser, you can set an option oldParser to true. Default is to the new parser.
"oldParser": true
Support for the oldParser option was deprecated with version 0.5.0
ie
DEBUG=alexa* homebridge -I
alexaHAP Starting Homebridge instance discovery +0ms
alexaLocal Connecting to Homebridge Smart Home Skill +1ms
[2018-3-17 11:23:57] Homebridge is running on port 51826.
alexaHAP HAP Device discovered Porch Camera [ '192.168.1.226' ] +87ms
alexaHAP HAP instance address: Porch Camera -> howard.local -> 192.168.1.226 +1ms
alexaHAP HAP Device discovered Howard [ '192.168.1.226' ] +4ms
alexaHAP HAP instance address: Howard -> howard.local -> 192.168.1.226 +0ms
alexaHAP HAP Device discovered Howard-Hue [ '192.168.1.226' ] +0ms
alexaHAP HAP instance address: Howard-Hue -> howard.local -> 192.168.1.226 +0ms
alexaHAP HAP Device discovered Spare Camera [ '192.168.1.226' ] +1ms
alexaHAP HAP instance address: Spare Camera -> howard.local -> 192.168.1.226 +0ms
alexaLocal offline +5ms
alexaHAP HAP Device discovered Penny [ 'fe80::ba27:ebff:febf:bbaa', '192.168.1.4', '169.254.185.85' ] +42ms
alexaHAP HAP instance address: Penny -> penny.local -> 192.168.1.4 +0ms
alexaHAP Homebridge instance discovered Howard with 12 accessories +7ms
alexaHAP Homebridge instance discovered Porch Camera with 1 accessories +11ms
alexaHAP Homebridge instance discovered Howard-Hue with 5 accessories +1ms
alexaHAP Homebridge instance discovered Spare Camera with 1 accessories +10ms
alexaHAP Homebridge instance discovered Penny with 26 accessories +101ms
alexaHAP HAP Device discovered Bart-Dev [ 'fe80::1c05:2c:5ae4:abdc', '192.168.1.231' ] +662ms
alexaHAP HAP instance address: Bart-Dev -> Bart.local -> 192.168.1.231 +0ms
alexaHAP Homebridge instance discovered Bart-Dev with 1 accessories +7ms
alexaLocal reconnect +4s
alexaLocal connect command/northernMan/# +174ms
Please note, that if you have other HomeKit devices on your network, like Philip's hue hub's, they will generate a HAP Discover failed
message that can be ignored.
ie
.
.
.
alexaTranslator Alexa Controllable Penny 22 +1ms
alexaTranslator Alexa Controllable Bart-Dev 0 +0ms
[2018-3-17 11:01:03] [Alexa] alexaDiscovery - returned 36 devices
In the event you have errors, or no devices returned please review your config.
Please note, as part of the verbose output from discovery devices, all your devices with the Alexa voice commands for each accessory are output in CSV format. You could grab these, format them into something usable and share.
Contact Sensor Alexa monitors the connection to the cloud service. When the contact sensor is Closed, the connection has been successfully made to the cloud service, and when the contact sensor is Open the connection to the cloud service has not been made. To determine why the connection to the cloud service is not working, please check your homebridge log files. During normal operation the Contact Sensor should be Closed.
Real time monitoring of the homebridge.ca cloud service is provided by Uptime Robot.
Cloud service operational event reporting and alerting is sent to the #homebridge-alexa channel in the Homebridge Discord instance, and the uptime robot reports events there in real time.
To assist in troubleshooting setup issues with your account, the hombridge.ca website displays the status of your account.
From here you should be able to determine if your plugin is communicating with the service and if your Amazon Alexa account has enabled the Homebridge-Alexa skill.
I have created a Discord channel on the homebridge discord server to troubleshoot issues not on the troubleshooting page. If you reach out there, I'm usually available. The channel is called #homebridge-alexa
To collect a debug log, please start homebridge with this command line
DEBUG=* homebridge -I
Sometimes during troubleshooting I need a dump of your homebridge accessories. Please use this command to collect it. If needed you can change the ip address, port or pin to match your environment.
curl -X PUT http://127.0.0.1:51826/accessories --header "Content-Type:Application/json" --header "authorization: 031-45-154"
See Roadmap