Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ad41c1679d | ||
|
89f6f233a5 | ||
|
88f217e2b1 | ||
|
2fec762498 | ||
|
857af55e99 | ||
|
20e0a9b909 | ||
|
afdff765b0 | ||
|
dcef6653ff | ||
|
82bf19c548 | ||
|
1084bff0ee | ||
|
5aa66835dd | ||
|
08ef90f7b0 |
23
CHANGELOG.md
23
CHANGELOG.md
@@ -37,4 +37,25 @@
|
||||
* Added support for multiple robots
|
||||
* Added log output when user requests accessory identify
|
||||
* Changed plugin to platform instead of single accessory
|
||||
* Removed parameter name from config
|
||||
* Removed parameter name from config
|
||||
|
||||
## 0.4.1
|
||||
|
||||
* Added config parameter for extraCareNavigation
|
||||
|
||||
## 0.4.2
|
||||
|
||||
* Added config parameter to disable switches/sensors
|
||||
|
||||
## 0.4.4
|
||||
|
||||
* Fixed config parameter to disable switches/sensors not optional
|
||||
|
||||
## 0.4.5
|
||||
|
||||
* Fixed compatibility with homebridge 0.4.23 (occupancy sensor not working)
|
||||
|
||||
## 0.4.6
|
||||
|
||||
* Added error log while refreshing robot state
|
||||
* Fixed a rare bug where the robot stops after some seconds of cleaning
|
44
README.md
44
README.md
@@ -4,9 +4,9 @@ This is a plugin for [homebridge](https://github.com/nfarina/homebridge) to cont
|
||||
|
||||
Feel free to leave any feedback [here](https://github.com/naofireblade/homebridge-neato/issues).
|
||||
|
||||
If you update from a previous version you have to adapt your config.
|
||||
If you update from a previous version 0.3.x you have to adapt your config (plugin is now a platform).
|
||||
|
||||
# Features
|
||||
## Features
|
||||
|
||||
- Start and pause cleaning
|
||||
- Return to dock\*
|
||||
@@ -16,23 +16,42 @@ If you update from a previous version you have to adapt your config.
|
||||
- Get dock info
|
||||
- Periodic refresh of robot state
|
||||
- Support for multiple robots
|
||||
- Extra care navigation
|
||||
|
||||
\* Available after some seconds of cleaning.
|
||||
|
||||
**Hint:** To control the robot with your own commands just set up a scene with the name of your choice.
|
||||
|
||||
# Installation
|
||||
## Installation
|
||||
|
||||
1. Install homebridge using: `npm install -g homebridge`
|
||||
2. Install this plugin using: `npm install -g homebridge-neato`
|
||||
3. If you don't have a Neato account yet create one [here](https://www.neatorobotics.com/create-account/).
|
||||
4. Update your configuration file. See the sample below.
|
||||
|
||||
### Configuration
|
||||
## Configuration
|
||||
|
||||
Add the following information to your config file. Change the values for name, email and password.
|
||||
Add the following information to your config file. Change the values for email and password.
|
||||
|
||||
The parameter **refresh** is optional (default 0=off) and adjusts in what interval (seconds) changes of the robot state will be pushed to homekit. The minimum refresh time is 60 seconds. You need this only when you set up rules based on the robot state and start him outside of homekit (e.g. with the Neato app).
|
||||
### Simple
|
||||
|
||||
```json
|
||||
"platforms": [
|
||||
{
|
||||
"platform": "NeatoVacuumRobot",
|
||||
"email": "YourEmail",
|
||||
"password": "YourPassword"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Advanced
|
||||
|
||||
The following config contains advanced optional settings that are off when not specified.
|
||||
|
||||
The parameter **refresh** sets in what interval (seconds) changes of the robot state will be pushed to homekit. The minimum refresh time is 60 seconds. You need this only when you set up rules based on the robot state and start him outside of homekit (e.g. with the Neato app).
|
||||
|
||||
The parameter **extraCareNavigation** sets if supporting models (currently Neato D3 and D5) should take extra care of your furniture while cleaning.
|
||||
|
||||
The parameter **disabled** accepts a list of switches/sensors that can be disabled in the neato homekit plugin (e.g. dock, dockstate, eco, schedule).
|
||||
|
||||
```json
|
||||
"platforms": [
|
||||
@@ -40,14 +59,17 @@ The parameter **refresh** is optional (default 0=off) and adjusts in what interv
|
||||
"platform": "NeatoVacuumRobot",
|
||||
"email": "YourEmail",
|
||||
"password": "YourPassword",
|
||||
"refresh": "0"
|
||||
"refresh": "120",
|
||||
"extraCareNavigation": true,
|
||||
"disabled": ["dock", "dockstate", "eco"]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
# Tested robots
|
||||
## Tested robots
|
||||
|
||||
- BotVac Connected (Firmware 2.2.0)
|
||||
- BotVac D5 Connected
|
||||
- BotVac D3 Connected
|
||||
- BotVac D5 Connected (Firmware 3.2.0-305)
|
||||
|
||||
If you have another connected neato robot, please [tell me](https://github.com/naofireblade/homebridge-neato/issues) about your experience with this plugin.
|
36
index.js
36
index.js
@@ -17,6 +17,10 @@ function NeatoVacuumRobotPlatform(log, config) {
|
||||
this.serial = "1-3-3-7";
|
||||
this.email = config['email'];
|
||||
this.password = config['password'];
|
||||
this.hiddenServices = ('disabled' in config ? config['disabled'] : '');
|
||||
|
||||
this.careNavigation = ('extraCareNavigation' in config && config['extraCareNavigation'] ? 2 : 1);
|
||||
debug("Extra Care Navigation: " + this.careNavigation);
|
||||
|
||||
// default off
|
||||
this.refresh = ('refresh' in config ? parseInt(config['refresh']) : 0);
|
||||
@@ -78,6 +82,8 @@ function NeatoVacuumRobotAccessory(robot, platform) {
|
||||
this.platform = platform;
|
||||
this.log = platform.log;
|
||||
this.refresh = platform.refresh;
|
||||
this.careNavigation = platform.careNavigation;
|
||||
this.hiddenServices = platform.hiddenServices;
|
||||
this.robot = robot;
|
||||
this.name = robot.name;
|
||||
this.lastUpdate = null;
|
||||
@@ -135,8 +141,17 @@ NeatoVacuumRobotAccessory.prototype = {
|
||||
this.vacuumRobotBatteryService.getCharacteristic(Characteristic.BatteryLevel).on('get', this.getBatteryLevel.bind(this));
|
||||
this.vacuumRobotBatteryService.getCharacteristic(Characteristic.ChargingState).on('get', this.getBatteryChargingState.bind(this));
|
||||
|
||||
return [this.informationService, this.vacuumRobotCleanService, this.vacuumRobotGoToDockService, this.vacuumRobotDockStateService, this.vacuumRobotEcoService,
|
||||
this.vacuumRobotScheduleService, this.vacuumRobotBatteryService];
|
||||
this.services = [this.informationService, this.vacuumRobotCleanService, this.vacuumRobotBatteryService];
|
||||
if (this.hiddenServices.indexOf('dock') === -1)
|
||||
this.services.push(this.vacuumRobotGoToDockService);
|
||||
if (this.hiddenServices.indexOf('dockstate') === -1)
|
||||
this.services.push(this.vacuumRobotDockStateService);
|
||||
if (this.hiddenServices.indexOf('eco') === -1)
|
||||
this.services.push(this.vacuumRobotEcoService);
|
||||
if (this.hiddenServices.indexOf('schedule') === -1)
|
||||
this.services.push(this.vacuumRobotScheduleService);
|
||||
|
||||
return this.services;
|
||||
},
|
||||
|
||||
setClean: function (on, callback) {
|
||||
@@ -155,8 +170,8 @@ NeatoVacuumRobotAccessory.prototype = {
|
||||
that.robot.resumeCleaning(callback);
|
||||
}
|
||||
else {
|
||||
debug(that.name + ": Start cleaning");
|
||||
that.robot.startCleaning(that.robot.eco, 2, callback);
|
||||
debug(that.name + ": Start cleaning (" + that.careNavigation + ")");
|
||||
that.robot.startCleaning(that.robot.eco, that.careNavigation, callback);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -245,7 +260,7 @@ NeatoVacuumRobotAccessory.prototype = {
|
||||
let that = this;
|
||||
this.updateRobot(function (error, result) {
|
||||
debug(that.name + ": Is docked: " + that.robot.isDocked);
|
||||
callback(false, that.robot.isDocked);
|
||||
callback(false, that.robot.isDocked ? 1 : 0);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -288,6 +303,10 @@ NeatoVacuumRobotAccessory.prototype = {
|
||||
else {
|
||||
debug(this.name + ": Update (online)");
|
||||
this.robot.getState(function (error, result) {
|
||||
if (error) {
|
||||
that.log.error("Error while updating robot state.");
|
||||
that.log.error(error);
|
||||
}
|
||||
that.lastUpdate = new Date();
|
||||
callback();
|
||||
});
|
||||
@@ -304,8 +323,9 @@ NeatoVacuumRobotAccessory.prototype = {
|
||||
that.vacuumRobotCleanService.setCharacteristic(Characteristic.On, that.robot.canPause);
|
||||
}
|
||||
|
||||
if (that.vacuumRobotGoToDockService.getCharacteristic(Characteristic.On).value !== !that.robot.dockHasBeenSeen) {
|
||||
that.vacuumRobotGoToDockService.setCharacteristic(Characteristic.On, !that.robot.dockHasBeenSeen);
|
||||
// dock switch is on (dock not seen before) and dock has just been seen -> turn switch off
|
||||
if (that.vacuumRobotGoToDockService.getCharacteristic(Characteristic.On).value == true && that.robot.dockHasBeenSeen) {
|
||||
that.vacuumRobotGoToDockService.setCharacteristic(Characteristic.On, false);
|
||||
}
|
||||
|
||||
if (that.vacuumRobotScheduleService.getCharacteristic(Characteristic.On).value !== that.robot.isScheduleEnabled) {
|
||||
@@ -313,7 +333,7 @@ NeatoVacuumRobotAccessory.prototype = {
|
||||
}
|
||||
|
||||
// no commands here, values can be updated without problems
|
||||
that.vacuumRobotDockStateService.setCharacteristic(Characteristic.OccupancyDetected, that.robot.isDocked);
|
||||
that.vacuumRobotDockStateService.setCharacteristic(Characteristic.OccupancyDetected, that.robot.isDocked ? 1 : 0);
|
||||
that.vacuumRobotBatteryService.setCharacteristic(Characteristic.BatteryLevel, that.robot.charge);
|
||||
that.vacuumRobotBatteryService.setCharacteristic(Characteristic.ChargingState, that.robot.isCharging);
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homebridge-neato",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.6",
|
||||
"description": "A Neato vacuum robot plugin for homebridge.",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
Reference in New Issue
Block a user