Hell Boreddead and thanks a lot for the great work here! Very useful. I got my roomba to be run from Alexa via smartthings for a while but now all of a sudden I get an error message from my virtual device, knowing that Iâve checked that ID and password are ok.
Iget this message : âsomething went wrong: groovyx.net.http.HttpResponseException: Request missing asset IDâ
Here is the code for my device handler:
metadata {
definition (name: "ROOMBA switch", namespace: "Elfege", author: "Elfege") {
capability "Switch"
capability "Refresh"
command "dock"
command "resume"
}
}
// simulator metadata
simulator {
}
// UI tile definitions
tiles {
standardTile("button", "device.switch", width: 1, height: 1, canChangeIcon: false) {
state "off", label: 'Clean', action: "switch.on", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#0088ff", nextState: "on"
state "on", label: 'Stop', action: "switch.off", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#F3F781", nextState: "off"
}
standardTile("button2", "device.switch", width: 1, height: 1, canChangeIcon: false) {
state "on", label: 'Pause', action: "switch.off", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#0088ff", nextState: "resume"
state "resume", label: 'Resume', action: "resume", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#F3F781", nextState: "resuming"
state "resuming", label: 'resuming', action: "", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#F3F781", nextState: "on"
}
standardTile("button3", "device.switch", width: 1, height: 1, canChangeIcon: false) {
state "on", label: 'Dock', action: "dock", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#0088ff", nextState: "docking"
state "docking", label: 'Docking', action: "", icon: "http://cdn.flaticon.com/png/256/56724.png", backgroundColor: "#0088ff", nextState: "on"
}
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
}
main "button"
details(["button","button2","button3", "refresh"])
}
def parse(String description) {
}
def dock() {
sendEvent(name: "switch", value: "on")
log.debug "Roomba Switch is --------------------------docking"
state.switch = "dock"
log.debug "Running Roomba"
def params = [
uri: "https://irobot.axeda.com/services/v1/rest/Scripto/execute/AspenApiRequest?blid=xxxxxxxxxxxxxxxxx&robotpwd=xxxxxxxxxxxxxxxxx&method=multipleFieldSet&value=%7B%0A%20%20%22remoteCommand%22%20:%20%22dock%22%0A%7D",
]
try {
httpGet(params) { resp ->
resp.headers.each {
log.debug "${it.name} : ${it.value}"
}
log.debug "response contentType: ${resp.contentType}"
log.debug "response data: ${resp.data}"
}
} catch (e) {
log.error "something went wrong: $e"
}
}
def on() {
sendEvent(name: "switch", value: "cleaning")
log.debug "Roomba Switch is --------------------------on"
state.switch = "on"
log.debug "Running Roomba"
def params = [
uri: "https://irobot.axeda.com/services/v1/rest/Scripto/execute/AspenApiRequest?blid=xxxxxxxxxxxxxxxxx&robotpwd=xxxxxxxxxxxxxxxxx&method=multipleFieldSet&value=%7B%0A%20%20%22remoteCommand%22%20:%20%22start%22%0A%7D",
]
try {
httpGet(params) { resp ->
resp.headers.each {
log.debug "${it.name} : ${it.value}"
}
log.debug "response contentType: ${resp.contentType}"
log.debug "response data: ${resp.data}"
}
} catch (e) {
log.error "something went wrong: $e"
}
}
def resume() {
sendEvent(name: "switch", value: "resume")
log.debug "Roomba Switch is --------------------------resume"
state.switch = "off"
log.debug "Running Roomba"
def params = [
uri: "https://irobot.axeda.com/services/v1/rest/Scripto/execute/AspenApiRequest?blid=xxxxxxxxxxxxxxxxx&robotpwd=xxxxxxxxxxxxxxxxx&method=multipleFieldSet&value=%7B%0A%20%20%22remoteCommand%22%20:%20%22resume%22%0A%7D",
]
try {
httpGet(params) { resp ->
resp.headers.each {
log.debug "${it.name} : ${it.value}"
}
log.debug "response contentType: ${resp.contentType}"
log.debug "response data: ${resp.data}"
}
} catch (e) {
log.error "something went wrong: $e"
}
}
def off() {
sendEvent(name: "switch", value: "off")
log.debug "Roomba Switch is --------------------------on"
state.switch = "on"
log.debug "Running Roomba"
def params = [
uri: "https://irobot.axeda.com/services/v1/rest/Scripto/execute/AspenApiRequest?blid=xxxxxxxxxxxxxxxxx&robotpwd=xxxxxxxxxxxxxxxxx&method=multipleFieldSet&value=%7B%0A%20%20%22remoteCommand%22%20:%20%22stop%22%0A%7D",
]
try {
httpGet(params) { resp ->
resp.headers.each {
log.debug "${it.name} : ${it.value}"
}
log.debug "response contentType: ${resp.contentType}"
log.debug "response data: ${resp.data}"
}
} catch (e) {
log.error "something went wrong: $e"
}
}
def pause() {
sendEvent(name: "switch", value: "off")
log.debug "Roomba Switch is --------------------------on"
state.switch = "on"
log.debug "Running Roomba"
def params = [
uri: "https://irobot.axeda.com/services/v1/rest/Scripto/execute/AspenApiRequest?blid=xxxxxxxxxxxxxxxxx&robotpwd=xxxxxxxxxxxxxx&method=multipleFieldSet&value=%7B%0A%20%20%22remoteCommand%22%20:%20%22pause%22%0A%7D",
]
try {
httpGet(params) { resp ->
resp.headers.each {
log.debug "${it.name} : ${it.value}"
}
log.debug "response contentType: ${resp.contentType}"
log.debug "response data: ${resp.data}"
}
} catch (e) {
log.error "something went wrong: $e"
}
}