Latest (2019) iRobot Roomba integration methods

What is the latest method of integrating Roomba (I have an i7) with Smartthings? Right now I am just using IFTTT.com but am using 3 virtual switches to do so. I have a Virtual Switch called Robot that I used to Start Cleaning (ST is the Trigger and iR is the Action), a Virtual Switch called Robot Cleaning that turns on when a Cleaning Starts (iR is the Trigger and ST is the Action). I also have a uDTH (switch and motion) called Robot Stuck that turns on when the Roomba reports its stuck to IFTTT (iR is the Trigger and ST is the action).

I use Robot vSwitch to control Roomba via SmartThings. I use Robot Cleaning vSwitch to know if it started cleaning via another source (iRobot app, scheduled clean, or button press on Roomba). I use the Robot Stuck uDTH for an Alexa Routine to tell me that Roomba is stuck on my Echo devices. (Alexa Routines only seem to work with motion triggers).

This seems less than ideal or optimal. Anyone got a better way?

I saw that RooWiFi, Thinking Cleaner, dorita989, rest980, etc all seem to be dead.

Also something intersting. I wanted to use the Universal Device Type Handler (uDTH) for all 3 switches, but for some reason the uDTH was not reporting status updates to IFTTT.com. Had to switch 2 of them to Virtual Switch. The other has to be a uDTH because Alexa Routines only seem to work with Motion triggers.

As far as the echo, see the community FAQ:

FAQ: Can I trigger an Echo Action without Speaking to It?

If the UDTH is working for you, that’s great, but since I believe it is no longer being supported by the author, you might just want to be aware of the alternatives as well. :sunglasses:

IFTTT can turn on and off the uDTH, however when a uDTH is updated in SmartThings it does not update to IFTTT for some reason.

I this is how i get full integration for my I7’s in SmartThings:

1 Like

Just remembered I created a “lite” version of the uDTH that works with IFTTT and Alexa. There are some abilities that either IFTTT or Alexa will not allow to be added. I think the main one is locks. I removed those abilities and it works.

I was never able to get Roomba 980 Wifi Connectivity Reverse engineering working for me.

I was in a similar state of virtual switches and IFTT so I starting working on my own DH. I modified the simulated button DH, creating buttons for Start, Pause, Stop, Dock and a manual reset; leveraging webcore to send IFTT webhooks based on the respective button press. I also added a valuetile to report a quasi-status. Unfortunately, the status was based on intended action rather than actual activity.

So for help with the feedback, the irobot IFTT channel has 3 triggers: mission complete, robot started and robot stuck which can act upon a ST switch, lock, or alarm so I added those capabilities to get feedback.

Robot started = switch on = status of Running
Mission Complete = locked = status of Job Complete
Stuck (error) = strobe alarm = status of Error
but there is still no way to confirm receipt of paused, stopped, or docking commands/status within ST.

Downside is that you still need to use IFTT and webcore, no direct interaction. Upside is that I was able to downsize to only one virtual device and regardless of how you start Roomba (via ST, Google Home, or manually) the status will be updated in ST. (Sorry, don’t have Alexa, Google Assistant can talk directly to Roomba).

Just updated the feedback mechaisms so I want to fully test before I share code but screenshots below:

Screenshot_20190912-155716_SmartThings Screenshot_20190912-155828_SmartThings

Hi Jon,
Are you willing to share your code yet?

My apologizes for the delay. I tweaked the code a bit, UI is slightly different than above) but then iFTT started causing some headaches. It show receipt of the webhook trigger but the applets were significantly delayed, by hours at times. I eventually dumped it all and re-tried rest980. Good news is that it is working for local control only.

Regardless, the final version before I dumped iFTT is below, you’ll noticed that I bypassed webCore and and am using a http get command to send the webhook directly. Each user will have to create iFTT applets (webHooks–>iRobot) for start, stop, pause, and dock. Those webhooks and the user’s webhook key is entered into the DH settings.

Additionally, for the feedback mechanisms, three iRobot–>SmartThings applets will be needed. Turn on the device switch when iRobot starts, lock the device upon mission complete, and sound alarm (strobe) when error occurs. These feedback mechanisms should still occur even if iRobot is started by other means so you can check status in smartThings at any time.

It is time consuming to setup the iFTT portion but it was working before iFTT decided to be a pain. I even contacted help on both ends, iFTT and iRobot. They blamed each other…

Other notes: I added a motion secondary control to the multi-attribute tile. This is purely simulated and indicates active cleaning vs docked. Due to the nature of the “new” app, I chose motion and a vid of generic-sensor. You cannot control iRobot via the new app but you can see if motion is active aka cleaning.

/**

  • Copyright 2015 SmartThings
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/

preferences {
section(“WebHook Command Input”){
input “start_command”, “text”, title: “Start Command”, required: false
input “pause_command”, “text”, title: “Pause Command”, required: false
input “stop_command”, “text”, title: “Stop Command”, required: false
input “dock_command”, “text”, title: “Dock Command”, required: false
input “key”, “password”, title: “iFTT Maker Key”, required: true
}
}

metadata {
definition (name: “Roomba Control via iFTT”, namespace: “SmartThingsDHs”, author: “fieldsjm”, mnmn: “SmartThings”, vid: “generic-sensor”) {
capability “Actuator”
capability “Alarm”
capability “Button”
capability “Lock”
capability “Sensor”
capability “Switch”
capability “motionSensor”
capability “Health Check”

    command "push1"
    command "push2"
    command "push3"
    command "push4"
    command "push5"
}

simulator {
}

tiles (scale: 2){

/Status tile based on intended action/
multiAttributeTile(name:“status”, type: “generic”, width: 6, height: 4){
tileAttribute (“device.status”, key: “PRIMARY_CONTROL”) {
attributeState (“Ready”, label: “Ready”, icon:“st.samsung.da.RC_ic_rc”, backgroundColor:"#8CFC03")
attributeState (“Running”, label: “In-Process”, icon:“st.Health & Wellness.health7”, backgroundColor:"#078bf7")
attributeState (“Paused”, label: “Paused”, icon:“http://cdn.device-icons.smartthings.com/sonos/pause-icon@2x.png”, backgroundColor:"#FC030F")
attributeState (“Docking”, label: “Docking”, icon:“st.presence.house.unlocked”, backgroundColor:"#5F07F7")
attributeState (“Docked”, label: “Docked”, icon:“st.presence.house.secured”, backgroundColor:"#5F07F7")
attributeState (“Stopped”, label: “Stopped”, icon:“https://raw.githubusercontent.com/fieldsjm/Resources/master/stop.png”, backgroundColor:"#FC030F")
attributeState (“Ended”, label: “Complete”, icon:“st.samsung.da.RC_ic_rc”, backgroundColor:"#8CFC03")
attributeState (“Error”, label: “Error”, icon:“https://raw.githubusercontent.com/fieldsjm/Resources/master/warning.png”, backgroundColor:"#FC030F")
}
tileAttribute(“device.motion”, key: “SECONDARY_CONTROL”) {
attributeState (“active”, label: “Cleaning”)
attributeState (“inactive”, label: “Docked”)
}
}
/Start/
standardTile(“push1”, “device.button”, width: 3, height: 2, decoration: “flat”) {
state “default”, label: “Start”, icon:“st.samsung.da.RC_ic_rc”, backgroundColor: “#ffffff”, action: “push1”
}
/Pause/
standardTile(“push2”, “device.button”, width: 3, height: 2, decoration: “flat”) {
state “default”, label: “”, icon:“st.sonos.pause-btn”, backgroundColor: “#ffffff”, action: “push2”
}
/Dock/
standardTile(“push3”, “device.button”, width: 3, height: 2, decoration: “flat”) {
state “default”, label: “Dock”, icon:“st.nest.nest-home”, backgroundColor: “#ffffff”, action: “push3”
}
/Stop/
standardTile(“push4”, “device.button”, width: 3, height: 2, decoration: “flat”) {
state “default”, label: “”, icon:“st.sonos.stop-btn”, backgroundColor: “#ffffff”, action: “push4”
}
/Reset/
standardTile(“push5”, “device.button”, width: 6, height: 2, decoration: “flat”) {
state “default”, label: “Reset”, icon:“st.secondary.refresh-icon”, backgroundColor: “#ffffff”, action: “push5”
}
/Switch for IFTT feedback of Started - Hidden by default/
standardTile(“switch”, “device.switch”, inactiveLabel: false, width: 6, height: 2, decoration: “flat”){
state(“off”, label: “Ready”, action: “switch.on”, backgroundColor: “#ffffff”, nextState: “on”, defaultState: “true”)
state(“on”, label: “Cleaning”, action: “switch.off”, backgroundColor: “#00a0dc”, nextState: “off”)
}
/Alarm for IFTT feedback of Error - Hidden by default/
standardTile(“alarm”, “device.alarm”, inactiveLabel: false, width: 6, height: 2, decoration: “flat”) {
state(“off”, label:“Ready / Pending”, action:‘alarm.strobe’, icon:“st.alarm.alarm.alarm”, backgroundColor:"#ffffff", nextState: “strobe”, defaultState: “true”)
state(“strobe”, label:“Error”, action:‘alarm.off’, icon:“st.alarm.alarm.alarm”, backgroundColor:"#e86d13", nextState: “off”)
}
/Lock for IFTT feedback of mission complete - Hidden by default/
standardTile(“lock”, “device.lock”, inactiveLabel: false, width: 6, height: 2, decoration: “flat”){
state(“unlocked”, label: “Ready / Pending”, action: “lock.lock”, backgroundColor: “#ffffff”, nextState: “locked”, defaultState: “true”)
state(“locked”, label: “Mission Complete”, action: “lock.unlock”, backgroundColor: “#00a0dc”, nextState: “unlocked”)
}

    main "status"
    details(["status","push1","push2","push3","push4","push5", /*"switch","alarm","lock"*/])
}

}

def parse(String description) {

}

/Start - Sends iFTT Webhook - if Roomba starts successfully, iFTT will turn on switch/
def push1() {
push(1)

	def cmd = "https://maker.ifttt.com/trigger/${settings.start_command}/with/key/${settings.key}";

  log.debug "Sending request cmd[${cmd}]"

  	httpGet(cmd) {resp ->
  		if (resp.data) {
  			log.info "${resp.data}"
  		} 
  	}

sendHubCommand(result)
log.debug “Executing push1”
log.debug result
}

/Pause - Sends iFTT Webhook - no feedback available/
def push2() {
push(2)
sendEvent(name: “status”, value: “Paused”)
sendEvent(name: “motion”, value: “active”)

	def cmd = "https://maker.ifttt.com/trigger/${settings.pause_command}/with/key/${settings.key}";

  log.debug "Sending request cmd[${cmd}]"

  	httpGet(cmd) {resp ->
  		if (resp.data) {
  			log.info "${resp.data}"
  		} 
  	}

sendHubCommand(result)
log.debug “Executing push1”
log.debug result
}

/Dock - Sends iFTT Webhook - minimal feedback available, once docked iFTT will also send docking mission complete (fail safe of conversational delay to Docked then Ready Status)/
def push3() {
push(3)
sendEvent(name: “status”, value: “Docking”)
sendEvent(name: “motion”, value: “active”)
runIn(60, docked)

	def cmd = "https://maker.ifttt.com/trigger/${settings.dock_command}/with/key/${settings.key}";

  log.debug "Sending request cmd[${cmd}]"

  	httpGet(cmd) {resp ->
  		if (resp.data) {
  			log.info "${resp.data}"
  		} 
  	}

sendHubCommand(result)
log.debug “Executing push1”
log.debug result
}
def docked() {
sendEvent(name: “status”, value: “Docked”)
sendEvent(name: “motion”, value: “inactive”)
runIn(10, push5)
}

/Stop - Sends iFTT Webhook - no feedback available/
def push4() {
push(4)
sendEvent(name: “status”, value: “Stopped”)
sendEvent(name: “motion”, value: “active”)

	def cmd = "https://maker.ifttt.com/trigger/${settings.stop_command}/with/key/${settings.key}";

  log.debug "Sending request cmd[${cmd}]"

  	httpGet(cmd) {resp ->
  		if (resp.data) {
  			log.info "${resp.data}"
  		} 
  	}

sendHubCommand(result)
log.debug “Executing push1”
log.debug result
}

/Status Reset/
def push5() {
push(5)
unlock()
off()
sendEvent(name: “status”, value: “Ready”)
sendEvent(name: “motion”, value: “inactive”)
}

private push(button) {
log.debug “$device.displayName button $button was pushed”
sendEvent(name: “button”, value: “pushed”, data: [buttonNumber: button], descriptionText: “$device.displayName button $button was pushed”, isStateChange: true)
}

/Feedback Mechanisms/
/Started - iFTT turns on if Roomba starts successfully/
def on(){
sendEvent(name: “switch”, value: “on”)
sendEvent(name: “status”, value: “Running”)
sendEvent(name: “motion”, value: “active”)
log.debug “$device.displayName (iFTT) has reported starting”
}
def off(){
sendEvent(name: “switch”, value: “off”)
sendEvent(name: “alarm”, value: “off”)
sendEvent(name: “status”, value: “Ready”)
sendEvent(name: “motion”, value: “inactive”)
}
/Misson Complete - iFTT turns on if Roomba completes task/
def lock() {
sendEvent(name: “lock”, value: “locked”)
sendEvent(name: “status”, value: “Ended”)
sendEvent(name: “motion”, value: “inactive”)
log.debug “$device.displayName (iFTT) has reported misson complete”
}
def unlock() {
sendEvent(name: “lock”, value: “unlocked”)
sendEvent(name: “status”, value: “Ready”)
sendEvent(name: “motion”, value: “inactive”)
}
/Error - iFTT turns on if Roomba encounters an error (stuck, low battery, etc)/
def strobe() {
sendEvent(name: “alarm”, value: “strobe”)
sendEvent(name: “status”, value: “Error”)
sendEvent(name: “motion”, value: “active”)
log.debug “$device.displayName (iFTT) has reported an error”
}

def installed() {
initialize()
}

def updated() {
initialize()
}

def initialize() {
sendEvent(name: “numberOfButtons”, value: 5)
sendEvent(name: “status”, value: “Ready”)
sendEvent(name: “motion”, value: “inactive”)
sendEvent(name: “healthStatus”, value: “online”)
}

Thanks for posting Jon.
I intend on giving this a try, though I was expecting to be using Web Core. Hopefully I can still get the integration with IFTTT right.

My apologies if I wasn’t clear previously. The use of webCore was originally as a middle man…to pass along the webhook to iFTT (if button one is pushed send roomba start, etc). There is no direct link between webcore and iRobot. IFTT is the only interaction method i’ve discovered outside of using a personal node server.

With that being said, you can still integrate into webCore if you want to tie in other automations. For example, I have webcore pause romba when my doorbell rings.

Hi Jon.
I wasn’t able to get the DH posted above to work as it kept giving me errors, however I have successfully implemented your Roomba V2 DH and it’s working really well and without any delays.
I wasn’t sure how to setup the http get command to send the webhook directly so I stuck with WebCore.
Thanks for your work on this project.

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.