iRobot Roomba 980 integration
Posted: Sunday 25 December 2016 10:41
Hi,
I have an iRobot Roomba 980 robot vacuum cleaner, with wifi connection.
It is possible to control the robot via an app and I know how to control this robot via HTTP POST commands.
Can someone advise me how to accomplish this with Lua, or do I have to call Curl via the Lua script?
Also I want to query the status of the robot every 15 minutes, to check if the robot is back on it's base again.
If I use Curl to query the status, the command would look like (assume Roomba has IP 192.168.10.70);
curl -H "Content-Type: application/json" -H "Connection: close" -H "User-Agent: aspen%20production/2618 CFNetwork/758.3.15 Darwin/15.4.0" -H "Content-Encoding: identity" -H "Accept: */*" -H "Accept-Language: en-us" -H "Host: 192.168.10.70" -H "Authorization: Basic [base64-password]" -X POST -d '{"do":"get","args":["mssn"],"id":1}' -k https://192.168.10.70/umi
Then I get (for example) the following response;
{"ok":{"flags":0,"cycle":"none","phase":"charge","pos":{"theta":179,"point":{"x":221,"y":-12}},"batPct":97,"expireM":0,"rechrgM":0,"error":0,"notReady":0,"mssnM":0,"sqft":0},"id":1}
"cycle":"none" tells me the robot is not driving around.
"phase":"charge" tells me the robot is on it's base station, charging.
Also the "error" and "notReady" fields are possibly interesting to monitor.
I would like to query these fields with a Lua script and put them individually in Domoticz variables for further processing.
There is a lot more possible with HTTP POST commands, so if someone is able to write a plugin for full integration of the Roomba 980 in Domoticz that would be even better!
Start a cleaning-job:
POST https://192.168.10.70/umi
Content-Type: application/json
Connection: close
User-Agent: aspen%20production/2618 CFNetwork/758.3.15 Darwin/15.4.0
Content-Encoding: identity
Accept: */*
Accept-Language: en-us
Host: 192.168.10.70
Authorization: Basic [base64-password]
{"do":"set","args":["cmd" {"op":"start"}],"id":1}
Pause the cleaning-job (replace the commands above with):
{"do":"set","args":["cmd" {"op":"pause"}],"id":1}
Resume the cleaning-job (replace the commands above with):
{"do":"set","args":["cmd" {"op":"resume"}],"id":1}
Stop the cleaning-job (replace the commands above with):
{"do":"set","args":["cmd" {"op":"stop"}],"id":1}
Return to base (replace the commands above with):
{"do":"set","args":["cmd" {"op":"dock"}],"id":1}
You will need to get the uniq device password (replace field [base64-password] above, without brackets) and that can be a bit difficult.
Please check the article on the following page to accomplish that;
https://community.smartthings.com/t/roo ... g/44860/93
For more possible commands, please check the source code of the following project;
https://github.com/koalazak/dorita980/
Kind regards,
Rene.
I have an iRobot Roomba 980 robot vacuum cleaner, with wifi connection.
It is possible to control the robot via an app and I know how to control this robot via HTTP POST commands.
Can someone advise me how to accomplish this with Lua, or do I have to call Curl via the Lua script?
Also I want to query the status of the robot every 15 minutes, to check if the robot is back on it's base again.
If I use Curl to query the status, the command would look like (assume Roomba has IP 192.168.10.70);
curl -H "Content-Type: application/json" -H "Connection: close" -H "User-Agent: aspen%20production/2618 CFNetwork/758.3.15 Darwin/15.4.0" -H "Content-Encoding: identity" -H "Accept: */*" -H "Accept-Language: en-us" -H "Host: 192.168.10.70" -H "Authorization: Basic [base64-password]" -X POST -d '{"do":"get","args":["mssn"],"id":1}' -k https://192.168.10.70/umi
Then I get (for example) the following response;
{"ok":{"flags":0,"cycle":"none","phase":"charge","pos":{"theta":179,"point":{"x":221,"y":-12}},"batPct":97,"expireM":0,"rechrgM":0,"error":0,"notReady":0,"mssnM":0,"sqft":0},"id":1}
"cycle":"none" tells me the robot is not driving around.
"phase":"charge" tells me the robot is on it's base station, charging.
Also the "error" and "notReady" fields are possibly interesting to monitor.
I would like to query these fields with a Lua script and put them individually in Domoticz variables for further processing.
There is a lot more possible with HTTP POST commands, so if someone is able to write a plugin for full integration of the Roomba 980 in Domoticz that would be even better!
Start a cleaning-job:
POST https://192.168.10.70/umi
Content-Type: application/json
Connection: close
User-Agent: aspen%20production/2618 CFNetwork/758.3.15 Darwin/15.4.0
Content-Encoding: identity
Accept: */*
Accept-Language: en-us
Host: 192.168.10.70
Authorization: Basic [base64-password]
{"do":"set","args":["cmd" {"op":"start"}],"id":1}
Pause the cleaning-job (replace the commands above with):
{"do":"set","args":["cmd" {"op":"pause"}],"id":1}
Resume the cleaning-job (replace the commands above with):
{"do":"set","args":["cmd" {"op":"resume"}],"id":1}
Stop the cleaning-job (replace the commands above with):
{"do":"set","args":["cmd" {"op":"stop"}],"id":1}
Return to base (replace the commands above with):
{"do":"set","args":["cmd" {"op":"dock"}],"id":1}
You will need to get the uniq device password (replace field [base64-password] above, without brackets) and that can be a bit difficult.
Please check the article on the following page to accomplish that;
https://community.smartthings.com/t/roo ... g/44860/93
For more possible commands, please check the source code of the following project;
https://github.com/koalazak/dorita980/
Kind regards,
Rene.