Skip to content

Commit

Permalink
Updated readme, substituion name correction
Browse files Browse the repository at this point in the history
  • Loading branch information
mannkind committed May 18, 2020
1 parent af753cd commit 7a69589
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
# Unsupported

Due to a botched surgery, I no longer have a Roomba 650. Leaving it for for future DIYers.

# Roomba Component for ESPHome

A barebones wrapper to enable control of a Roomba via MQTT with ESPHome.
Tested with ESPHome 1.13.x, and a Roomba 650 w/a Wemos D1 Mini installed.
A barebones bit of glue between ESPHome and Mike McCauley's Roomba library that enables control of a Roomba 650 via MQTT.

Last tested with ESPHome 1.13.x and Mike McCauley's Roomba Library 1.3.

The inspiration is [John Boiles' esp-roomba-mqtt project](https://github.com/johnboiles/esp-roomba-mqtt), but I want all my IoT devices driven by ESPHome.

## Hardware

The inspiration for this project is https://github.com/johnboiles/esp-roomba-mqtt. You'll find a detailed wiring guide there. In fact, I originally started off using that project for my Roomba 650. However, as I migrated my custom components to ESPHome, I wanted my Roomba to be on the same platform as the other devices.
## Wiring Guide
John Boiles' wiring guide was the basis for my setup.

I should note that like others, I initially had trouble reading the sensor data from the Roomba. I posted the solution I found in https://github.com/johnboiles/esp-roomba-mqtt/issues/2#issuecomment-373956173
The main difference is that John Boiles' repo uses a voltage divider on the Roomba's TX pin, while I used a PNP transistor. I used a transistor because the voltage divider was not working for me, and I found a Roomba Create document with the following information:

> For what it's worth, my Wemos D1 Mini couldn't read the Roomba sensors either. I found this snippet in an iRobot Create 2 Doc
>
>> In some cases, the drive strength of a Roomba TX line is not enough to drive the RX line of another board (for example, in some revisions of Arduino). In this case, a simple PNP transistor (2N2907A, 2N3906, or 2N4403, among others) can be used to provide enough “drive” for the Arduino.
> In some cases, the drive strength of a Roomba TX line is not enough to drive the RX line of another board (for example, in some revisions of Arduino). In this case, a simple PNP transistor (2N2907A, 2N3906, or 2N4403, among others) can be used to provide enough “drive” for the Arduino.
>
> I used a 2N3906 and following the circuit as described in the PDF; I can now read sensor values from the Roomba!
> Source: [Roomba Create® 2 to 5V Logic](http://www.irobot.com/~/media/MainSite/PDFs/About/STEM/Create/Create_2_to_5V_Logic.pdf)
## Alternative Wiring Guide
One might find this [alternative wiring guide](https://i.stack.imgur.com/aaifY.jpg) easier to get started with. It has fewer parts required and uses a PNP transistor.

## Special Notes

* Many PNP Transistors will work; **pay attention** to the pinout of the specific transistor you choose to use.
* Many pins can be the BRC pin; update [roomba.yaml](example/roomba.yaml#L13) with the pin you choose.
The example matches John Boiles' chosen pin D5/GPIO14.

## Placement

The Wemos D1 mini is small enough to [fit into the compartment by one of the wheels](https://community-home-assistant-assets.s3.dualstack.us-west-2.amazonaws.com/optimized/2X/a/a258c7253f8bd3fe76ad9e7aa1202b60bd113d74_2_496x600.jpg).
_Source:_ [Add wifi to an older roomba](https://community.home-assistant.io/t/add-wifi-to-an-older-roomba/23282) community project thread on the Home Assistant forum.

The D1 mini is small enough to fit into the compartment by the wheel. The [example image of D1 mini inside Roomba compartment](https://community-home-assistant-assets.s3.dualstack.us-west-2.amazonaws.com/optimized/2X/a/a258c7253f8bd3fe76ad9e7aa1202b60bd113d74_2_496x600.jpg) image is not a photo of mine specifically, but it's useful to see where the components fit inside the Roomba. It was sourced from a [community project thread on the Home Assistant forums](https://community.home-assistant.io/t/add-wifi-to-an-older-roomba/23282).

## Software Setup/Use

Take a look at the example directory for a fully working example.

* <example/esphome.yaml> - Contains the bits needed for ESPHome.
* <example/homeassistant-vacuum.yaml> - Contains the bits needed to integrate as a "MQTT Vacuum" in Home Assistant
* <example/homeassistant-vacuum.yaml> - Contains the bits needed to integrate as a "MQTT Vacuum" in Home Assistant.
1 change: 1 addition & 0 deletions example/homeassistant-vacuum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- return_home
- battery
- clean_spot
# IMPORTANT NOTE: If you change the substitution name value in roomba.yml, the availability_topic/state_topic/command_topic need to change as well.
availability_topic: "roomba_001/status"
state_topic: "roomba_001/state"
command_topic: "roomba_001/command"
9 changes: 5 additions & 4 deletions example/roomba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ esphome:
- Roomba=https://github.com/Apocrathia/Roomba

substitutions:
name: "Roomba"
# state topic, command topic, BRC pin, polling interval
init: 'RoombaComponent::instance("roomba_001/state", "roomba_001/command", 4, 1000);'
# IMPORTANT NOTE: If you change the substitution name value, the state_topic/command_topic need to change as well.
name: "roomba_001"
# state topic, command topic, BRC pin, polling interval in milliseconds
init: 'RoombaComponent::instance("roomba_001/state", "roomba_001/command", D5, 1000);'

wifi:
ssid: !secret wifi_ssid
Expand Down Expand Up @@ -56,7 +57,7 @@ sensor:

binary_sensor:
- platform: status
name: "{name} Status"
name: "${name} Status"

- platform: custom
lambda: |-
Expand Down

0 comments on commit 7a69589

Please sign in to comment.