Find Roomba (Identify Function, supported in 3rd Party HomeKit apps)
The homebridge-roomba2 plugin polls Roomba for its status when requested by HomeKit, so when you first open
the Home app you may see an old status, or no status, until Roomba has had time to respond (which may take
a few seconds).
Installation
Automatic Installation
Install Homebridge: sudo npm i -g homebridge --unsafe-perm
Download this plugin: sudo npm i -g homebridge-roomba2
Enter Roomba's credentials in your config.json file.
Restart Homebridge
Setup
Find your Roomba's IP address (for help see the troubleshooting section); it will look like 192.168.X.XXX or 10.X.X.XXX, or similar.
Open a terminal on your Homebridge system, either using ssh or by using the Homebridge Terminal located in the ⋮ menu, top-right in the Homebridge UI.
Change into the directory where the plugin is installed: cd $(npm root -g)/homebridge-roomba2
Type sudo npm run getrobotpwd <IP ADDRESS> (replacing <IP ADDRESS> with the IP address you discovered above).
Follow the instructions on screen to obtain your Roomba's blid and password. NB: Read the instructions carefully and ensure that you're pressing and holding the correct button on your Roomba.
Proceed to Configuration.
Configuration
This plugin supports GUI-based configuration using Config-Ui-X. You can also
configure your accessory using JSON:
Add a contact sensor to HomeKit that's closed when Roomba is docked
true
runningContactSensor
Add a contact sensor to HomeKit that's open when Roomba is running
false
binContactSensor
Add a contact sensor to HomeKit that's open when Roomba's bin is full
false
dockingContactSensor
Add a contact sensor to HomeKit that's open when Roomba is docking
false
dockOnStop
Send home to dock when stopped
true
Deprecated configuration
The homebridge-roomba2 plugin used to support keep-alive and auto refresh modes for obtaining Roomba's status.
Both of these modes required more resources from Homebridge and Roomba than were necessary.
Now the plugin efficiently queries Roomba's status on demand so as not to slow down Homebridge and so
as to provide HomeKit with Roomba's status only when it requests it.
Troubleshooting
Click on any of the items below to expand the corresponding answer.
Finding my Roomba's IP address
You can find your Roomba's IP Address in the iRobot app. Open the app and choose your Robot. Scroll down to the bottom and find Robot Settings. Click Wi-Fi Settings and then Robot Wi-FI Details. You will find your IP address and various other network goodies here.
Alternatively you can open up your Router Admin Panel and look for a list of devices. Once you identify the Roomba, you should see an associated IP address, however, this process will be different for each type of router.
While identifying your Roomba's IP address, we strongly recommend assigning your Roomba a Static IP Address (See Roomba cannot be found after router restart OR Roomba's IP Address changed below).
Roomba cannot be found after router restart OR Roomba's IP Address changed
If you experience issues with connecting to your Roomba, you might want to assign a Static IP Address to your Roomba. In order to do this, you'll need to navigate to your Router's Admin Portal and modify the configuration; because this process is different for each type of router, you will need to research this process on your own.
NOTE: If you choose to set an IP address that is different than the IP address your Roomba was previously assigned, you'll need to restart your router before the Roomba will begin responding on the new IP address.
nvm is used to control the version of node used. You can skip the nvm step if you manage your own
node versions.
Use nvm to select the required node version:
nvm use
or, if you don't have the required node version installed:
nvm install
Install pnpm, if you haven't already:
npm -g install pnpm
Prepare the project:
pnpm install
Build the project:
pnpm build
or
pnpm watch
Testing
The fastest way to test changes is to copy the built product directly to your Homebridge, and then to restart Homebridge.
If your Homebridge is running on your local machine, you can build (as above) and then copy the config.schema.json file and dist
folder to the homebridge-roomba2 folder in your Homebridge's node_modules folder.
If your Homebridge is running on another machine, you can use a remote copy tool such as scp to copy the files:
Note: the destination path above is an example of what the path to node_modules on your Homebridge server might be.
If you see "Permission denied" errors from scp you will need to adjust the permissions on the files in that folder
on your Homebridge machine.
Contributing
The homebridge-roomba2 plugin uses Changesets to maintain the CHANGELOG.md and to bump the package's version number according to semer.
If you are preparing a PR, please consider using Changesets to include a summary of your change for the CHANGELOG.md, following the example of existing changelog entries (but feel free to provide more detail).
To create a new changeset:
pnpm changeset
That will prompt you to indicate whether your change is a patch (a bug fix) or a minor or major change. If you are adding a feature it is a minor change, not a patch.
Changesets will create a new file in the .changeset directory that you can commit as part of your PR.
Releasing
The maintainer will run these steps to update the plugin version and publish to npmjs.com:
pnpm changeset version
Review the additions to CHANGELOG.md and package.json, commit with the comment "vX.X", and then publish:
请发表评论