Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[irobot] Fix password discovery and command sending for Roomba I-Models. (using gson) #10860

Merged
merged 3 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions bundles/org.openhab.binding.irobot/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
# iRobot Binding

This binding provides integration of products by iRobot company (https://www.irobot.com/). It is currently developed to support Roomba 900
series robotic vacuum cleaner with built-in Wi-Fi module. The binding interfaces to the robot directly without any need for a dedicated MQTT server.
This binding provides integration of products by iRobot company (https://www.irobot.com/). It is currently developed
to support Roomba vacuum cleaner/mopping robots with built-in Wi-Fi module. The binding interfaces to the robot directly
without any need for a dedicated MQTT server.

## Supported Things

- iRobot Roomba robotic vacuum cleaner (https://www.irobot.com/roomba). The binding has been developed and tested with Roomba 930.
- iRobot Braava has also been reported to (partially) work. Automatic configuration and password retrieval does not work. Add the robot manually as Roomba and use external tools (like Dorita980) in order to retrieve the password.
- iRobot Roomba robotic vacuum cleaner (https://www.irobot.com/roomba).
- iRobot Braava has also been reported to (partially) work.
- In general, the channel list is far from complete. There is a lot to do now.

## Discovery

Roombas on the same network will be discovered automatically, however in order to connect to them a password is needed. The
password is a machine-generated string, which is unfortunately not exposed by the original iRobot smartphone application, but
it can be downloaded from the robot itself. If no password is configured, the Thing enters "CONFIGURATION PENDING" state.
password is a machine-generated string, which is unfortunately not exposed by the original iRobot smartphone application,
but it can be downloaded from the robot itself. If no password is configured, the Thing enters "CONFIGURATION PENDING" state.
Now you need to perform authorization by pressing and holding the HOME button on your robot until it plays series of tones
(approximately 2 seconds). The Wi-Fi indicator on the robot will flash for 30 seconds, the binding should automatically
receive the password and go ONLINE.

After you've done this procedure you can write the password somewhere in case if you need to reconfigure your binding. It's not
known, however, whether the password is eternal or can change during factory reset.
After you've done this procedure you can write the password somewhere in case if you need to reconfigure your binding. It's
not known, however, whether the password is eternal or can change during factory reset.

## Thing Configuration


| Parameter | Meaning |
|-----------|----------------------------------------|
| ipaddress | IP address (or hostname) of your robot |
| password | Password for the robot |
| Parameter | Type | Required | Default | Description |
| --------- | :-----: | :-------: | :------: | ----------------- |
| address | String | Yes | | Robot IP address |
| family | String | Yes | | Robot family |
| blid | String | No | | Robot ID |
| password | String | No | | Robot Password |

All parameters will be autodiscovered. If using textual configuration, then `address` and `family` shall be specified.
The table below provides valid values for `family`:

| Robot | Parameter |
| ---------------------- | ---------- |
| iRobot Braava M-Series | "Braava-M" |
| iRobot Roomba 9-Series | "Roomba-9" |
| iRobot Roomba I-Series | "Roomba-E" |
| iRobot Roomba E-Series | "Roomba-I" |
| iRobot Roomba S-Series | "Roomba-S" |

## Channels

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
*/
package org.openhab.binding.irobot.internal;

import javax.net.ssl.TrustManager;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.io.net.http.TrustAllTrustManager;
import org.openhab.core.thing.ThingTypeUID;

/**
Expand All @@ -21,6 +24,7 @@
*
* @author hkuhn42 - Initial contribution
* @author Pavel Fedin - rename and update
* @author Alexander Falkenstern - Add support for I7 series
*/
@NonNullByDefault
public class IRobotBindingConstants {
Expand All @@ -30,6 +34,38 @@ public class IRobotBindingConstants {
// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_ROOMBA = new ThingTypeUID(BINDING_ID, "roomba");

// Something goes wrong...
public static final String UNKNOWN = "UNKNOWN";

// Model definitions
public enum Models {
BRAAVA_M_SERIES("Braava-M"),
ROOMBA_9_SERIES("Roomba-9"),
ROOMBA_E_SERIES("Roomba-E"),
ROOMBA_I_SERIES("Roomba-I"),
ROOMBA_S_SERIES("Roomba-S");

private String model;

Models(final String model) {
this.model = model;
}

@Override
public String toString() {
return model;
}

public static Models fromString(final String name) {
for (final Models model : Models.values()) {
if (model.model.equalsIgnoreCase(name.trim())) {
return model;
}
}
throw new IllegalArgumentException("Can not find iRobot model " + name);
}
}

// List of all Channel ids
public static final String CHANNEL_COMMAND = "command";
public static final String CHANNEL_CYCLE = "cycle";
Expand Down Expand Up @@ -69,4 +105,12 @@ public class IRobotBindingConstants {
public static final String PASSES_AUTO = "auto";
public static final String PASSES_1 = "1";
public static final String PASSES_2 = "2";

// Connection and config constants
public static final int MQTT_PORT = 8883;
public static final int UDP_PORT = 5678;
public static final TrustManager[] TRUST_MANAGERS = { TrustAllTrustManager.getInstance() };

public static final String ROBOT_BLID = "blid";
public static final String ROBOT_PASSWORD = "password";
}

This file was deleted.

This file was deleted.

Loading