npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-alexa-smarthome

v2.1.4

Published

Homebridge plugin that can control smart home devices connected to Alexa.

Downloads

259

Readme

Homebridge Alexa Smart Home

This plugin enables smart home device integration between HomeKit and Alexa which allows HomeKit/Siri to control smart home devices that are connected via Amazon Alexa.

This plugin does not allow Alexa to control devices in HomeKit. For that, please see the Homebridge Alexa plugin.

Table of Contents

Compatibility

Compatibility is not guaranteed with HOOBS and I am unable to provide support for HOOBS users since I do not use HOOBS.

Node.js versions supported: 16.x, 18.x, 20.x

Currently supported devices

  • Lightbulbs
  • Switches
    • HomeKit switches do not support brightness so any switches you have that support brightness will appear in HomeKit as Lightbulbs.
  • Fans
  • Outlets + smart plugs
  • Thermostats
  • Locks
  • Air Quality Monitors
    • Only confirmed to work with Amazon Air Quality Monitor. Please report an issue if it doesn't work with your air quality monitor.
  • Echo smart speakers / Echo smart displays
    • Play + pause
    • Next track / previous track
    • Change volume
  • Device types not listed above that support on/off will be added as switches. For example:
    • Air fresheners
    • Vacuum cleaners
    • Game consoles
  • Request / vote on device types you would like to see supported.

Features

  • Devices already linked to your Alexa account can be integrated with HomeKit automatically.
  • Only Amazon credentials needed to configure this plugin rather than credentials for all your devices.
  • This plugin does not store your Amazon username or password. Instead, it uses session cookies that are valid for up to 14 days.

Air quality monitors

All of the following are supported depending on what your device measures:

  • Air quality score (Excellent / Fair / Poor)
  • Particulate matter density (PM2.5)
  • VOC Density
  • Carbon monoxide levels
  • Relative humidity percent
  • Temperature

When you first add an Air Quality Monitor to HomeKit, the above measurements may appear in the Default Room but can be assigned to any room you choose.

Echo devices

Echo devices appear in HomeKit as Televisions which enables media control via the Control Center remote controls.

Echo devices are added to HomeKit as external accessories that need to be added manually. Restart Homebridge and review the Homebridge logs for a message similar to: Please add [DEVICE NAME] manually in Home app. Setup Code: xxx-xx-xxx

To use the Control Center remote controls, follow these instructions to add the remote to your device's Control Center. Once the remote is open, you can change the device you are controlling using the arrow next to the device name at the top of the screen.

Remote control features - you must start the media on the Echo (music, audio book, etc) before you can control it. It may take up to a minute for the remote to start working once media is playing:

  • Play
  • Pause
  • Next (right arrow)
  • Previous (left arrow)
  • Volume control (hardware volume buttons, a.k.a. volume button on the side of your iPhone/iPad)

Siri is not supported out of the box but I may be able to support in the future.

AirPlay is unrelated to Homebridge/HomeKit and needs to be supported by the device (the Echo). If you wish to use AirPlay, the best option is to buy an AppleTV or Apple HomePod.

When you first add an Echo device with a temperature sensor to HomeKit, the temperature may appear in the Default Room but can be assigned to any room you choose.

Initial configuration

The first time this plugin starts, you will need to authenticate using your Amazon Alexa account. Please follow these steps in order - screenshots included.

  1. Verify that your plugin configuration is correct. Specifically, the proxy clientHost and port. The clientHost should be the same host you use to access homebridge. For example, if you access homebridge via the url http://my-homebridge-server.local:8581 then clientHost should be my-homebridge-server.local. The port should be a different value from homebridge (not 8581). Restart Homebridge if you made any changes to the settings.
    1. It is highly recommended to explicitly provide in the plugin settings the device names you wish to use with this plugin. The plugin performs much better this way.
    2. config screenshot
  2. Download the Alexa app onto a device of your choosing (smartphone, tablet, etc) and sign in using the Amazon account your devices are linked to. Confirm the amazonDomain plugin setting matches what you see in the Alexa app. Go to Settings -> About, scroll to the bottom, and look for Host Name. The Host Names you see should end with the amazonDomain you choose in the plugin settings, it will not match exactly.
  3. This plugin may not work and support or help troubleshooting will not be provided if you do not use multi-factor authentication / two-step verification or if you use SMS for the verification code. Again, SMS two step verification will not work. Please download an authenticator app such as AWS Virtual MFA, Google Authenticator, Microsoft Authenticator and follow the instructions to enable two step verification on Amazon's website.
  4. Check the homebridge logs for an error that you must manually open the url to authenticate.
    1. failed to initialize screenshot
  5. Visit the url in your browser to open a login screen. If you open the url from a mobile device the Alexa App is installed on, it may not work because Amazon might open the Alexa App. It is recommended to use a device, preferably a computer, the Alexa App is not installed on. When the page loads, it is a real login screen proxied so the plugin can capture the session cookie. The username/password are not stored by the plugin.
    1. login screenshot
  6. Enter your MFA code if you have MFA enabled on your Amazon Alexa account. Again, the plugin does not store this value.
    1. mfa screenshot
  7. If successful, you should see a message that the Amazon Alexa cookie was successfully retrieved. If you see a 404 page, return to step 3 and start over.
    1. login successful screenshot
  8. The homebridge logs will also show a message such as "Successfully authenticated Alexa account".
    1. authentication successful screenshot

Common issues

Support

Please visit the Canny feedback board first to see if your issue or request is currently being worked on. You can also suggest new features and vote on features requested by others.

If you run into issues or you need help please use the issues template. Fill all the relevant sections and submit your issue. It is important that you use the templates because I will automatically be assigned to your issue and I will receive an email. If you use the blank template without assigning me, I will most likely miss the Github notification.

Contributing

Please see CONTRIBUTING.md and PULL_REQUEST_TEMPLATE.md

Long-term support

Please consider supporting the development of this plugin by sponsoring me. Sponsorship will encourage me to continue improving this plugin, support more devices, adapt to changes in the Alexa API, and fuel my late-night coding sessions. :coffee:

Thanks

A huge thanks is due to Apollon77 for maintaining alexa-remote2, alexa-cookie2, and ioBroker.alexa2. This plugin is made possible due to those projects.

Disclaimer

  • I am not affiliated with Amazon nor any of the device brands and this plugin is a personal project that I maintain in my free time
  • Use this plugin entirely at your own risk
  • Please see license for more information