forked from davidecavestro/ESPHomeRoombaComponent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,8 @@ | ||
# Roomba Component for ESPHomeLib | ||
# Roomba Component for ESPHome | ||
|
||
A barebones wrapper to enable control of a Roomba via ESPHomeLib. | ||
Tested with ESPHomeLib 1.9.1, and a Roomba 650 w/a Wemos D1 Mini installed. | ||
A barebones wrapper to enable control of a Roomba via ESPHome. | ||
Tested with ESPHome 1.10.0, and a Roomba 650 w/a Wemos D1 Mini installed. | ||
|
||
## Setup/Use | ||
|
||
Take a look at the example directory for a fully working example (very close to my setup). | ||
|
||
In short: | ||
|
||
* Add `#include "ESPHomeLibRoombaComponent.h"` under the esphomelib include. | ||
|
||
* Add the following before `App.setup()` | ||
|
||
```c++ | ||
auto *custom_roomba = new RoombaComponent( | ||
"Distance", | ||
"Voltage", | ||
"Current", | ||
"Charge", | ||
"Capacity", | ||
"Charging", | ||
"Docked", | ||
"Cleaning", | ||
"On", | ||
"Off", | ||
"Dock", | ||
"Locate", | ||
"Spot Clean", | ||
"Roomba/command", /* command_topic */ | ||
4, /* BRC Pin */ | ||
5000 /* Update Interval */ | ||
); | ||
|
||
App.register_component(custom_roomba); | ||
App.register_sensor(custom_roomba->distance_sensor); | ||
App.register_sensor(custom_roomba->voltage_sensor); | ||
App.register_sensor(custom_roomba->current_sensor); | ||
App.register_sensor(custom_roomba->charge_sensor); | ||
App.register_sensor(custom_roomba->capacity_sensor); | ||
App.register_binary_sensor(custom_roomba->chargingState_sensor); | ||
App.register_binary_sensor(custom_roomba->dockedState_sensor); | ||
App.register_binary_sensor(custom_roomba->cleaningState_sensor); | ||
App.register_switch(custom_roomba->on_switch); | ||
App.register_switch(custom_roomba->off_switch); | ||
App.register_switch(custom_roomba->dock_switch); | ||
App.register_switch(custom_roomba->locate_switch); | ||
App.register_switch(custom_roomba->spot_switch); | ||
``` | ||
Take a look at the example directory for a fully working example (very close to my setup). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Gitignore settings for esphomeyaml | ||
# This is an example and may include too much for your use-case. | ||
# You can modify this file to suit your needs. | ||
/.esphomeyaml/ | ||
**/.pioenvs/ | ||
**/.piolibdeps/ | ||
**/lib/ | ||
**/src/ | ||
**/platformio.ini | ||
/secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,61 @@ | ||
esphomeyaml: | ||
use_custom_code: True | ||
name: roomba | ||
platform: ESP8266 | ||
board: esp01_1m | ||
includes: | ||
- ../ESPHomeRoombaComponent.h | ||
libraries: | ||
- Roomba=http://www.airspayce.com/mikem/arduino/Roomba/Roomba-1.4.zip | ||
|
||
wifi: | ||
ssid: "My Wifi SSID" | ||
password: "My Wifi Password" | ||
|
||
mqtt: | ||
broker: "mosquitto.org" | ||
broker: "test.mosquitto.org" | ||
discovery: true | ||
|
||
logger: | ||
level: info | ||
|
||
ota: | ||
ota: | ||
|
||
custom_component: | ||
- lambda: |- | ||
auto custom_roomba = new RoombaComponent( | ||
"Roomba Distance", | ||
"Roomba Voltage", | ||
"Roomba Current", | ||
"Roomba Charge", | ||
"Roomba Capacity", | ||
"Roomba Charging", | ||
"Roomba Docked", | ||
"Roomba Cleaning", | ||
"Roomba On", | ||
"Roomba Off", | ||
"Roomba Dock", | ||
"Roomba Locate", | ||
"Roomba Spot Clean", | ||
"roomba/command", /* command_topic */ | ||
4, /* BRC Pin */ | ||
5000 /* Update Interval */ | ||
); | ||
App.register_component(custom_roomba); | ||
App.register_sensor(custom_roomba->distance_sensor); | ||
App.register_sensor(custom_roomba->voltage_sensor); | ||
App.register_sensor(custom_roomba->current_sensor); | ||
App.register_sensor(custom_roomba->charge_sensor); | ||
App.register_sensor(custom_roomba->capacity_sensor); | ||
App.register_binary_sensor(custom_roomba->chargingState_sensor); | ||
App.register_binary_sensor(custom_roomba->dockedState_sensor); | ||
App.register_binary_sensor(custom_roomba->cleaningState_sensor); | ||
App.register_switch(custom_roomba->on_switch); | ||
App.register_switch(custom_roomba->off_switch); | ||
App.register_switch(custom_roomba->dock_switch); | ||
App.register_switch(custom_roomba->locate_switch); | ||
App.register_switch(custom_roomba->spot_switch); | ||
return {custom_roomba}; | ||
switch: |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.