iRoomba iRobot Plugin

Posted on
Wed Sep 29, 2021 11:44 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

iRoomba iRobot Plugin

Mark wrote:


Couple questions:

What is the difference between ErrorText, NotReadyText and errornotReady_Statement?

More importantly (for my interface needs): are any or all of those three reflected in the currentState_Statement when they are not "", "None" or "Ready"?

I can see the lists of self.errorStrings and self.notReadyStrings in your Python, but there seems to be a lot of overlap.



ErrorText and NotReadyText - are the shortened text version of the error or Notready code reported by iroomba. There is some overlap - but these are still reported differently by the iroomba itself. The plugin just reports what the iroomba is reporting and converts the code into the English shortened statement.

The currentState_statement: Should report
“Error: Left wheel stuck” type error. Using the shortened version
Or “Not Ready: Battery Low”
Or the undocumented state (hopefully less of these now have whole iroomba database)

The errornotReady_Statement:
Reports the iroomba instruction, sentence depending on the not-ready or error state. Same as reported by app.


Eg. ErrorCode -3 for example
ErrorText “Right Wheel Off Floor”
ErrorCode - 3
currentState_Statement: “ Error: Right Wheel Off Floor”
Errrornotready_statement:
{NameiRoomba} is stuck. Move your robot to a flat surface then press Resume or CLEAN on the robot to continue

My usage is the currentState_statement on a CP highlighting the current status.
Below that I have an empty line which is the errornotReady_statement - which is blank if no error, otherwise reports the helpful iroomba sentence, with the status above in error state showing the shortened form

Eg:


Image

Image

Image

Image

Posted on
Thu Sep 30, 2021 8:18 pm
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

Ah, thank you for the explanations. Very helpful. I see that I need to find a spot for the errornotReady_Statement, that info will be good to see at a glance without having to launch the iRobot app.

Posted on
Sat Oct 02, 2021 4:47 am
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

'nother question...

Is BinFull reporting the bin on the Roomba, or the bin (bag) on the charging base? Or both?

My Roomba's base empties the Roomba's bin, so technically the Roomba's bin would never get full. Or, I suppose if it did mid-mission, the Roomba would return to base for an emptying, then return to the mission.

Just curious to know: when the bag on my base gets full if that's going to be reported by your plug-in...

Posted on
Sat Oct 02, 2021 5:19 am
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: iRoomba iRobot Plugin

Both it would seem.

My s9+ reports Bin full when main bin full and/or it can’t empty probably. Had a bin full recently when had sucked up some big piece of plastic that was stopping proper transfer into bin (although wasn’t a ‘ clog’ - think this is separate error and should be reported as such- also more of a pain to fix)

Have uploaded a newer version which finalises the iroomba error messages (shortening file considerably). Additionally this version also parses every message received in real-time, rather than waiting for 60 seconds. Should be able to see real-time changes within Control pages, of error messages, not ready etc. (Did have some data confusion issues which believe have overcome.)



Glenn


Sent from my iPad using Tapatalk

Posted on
Sat Oct 02, 2021 11:44 am
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

OK, I'll give the latest a go and report back.

Yesterday I was studying a file named "strings.xml." Is that the XML file you referred to earlier, with all the error codes/statements?!

Yikes, there are a lot of strings. Can you imagine the programming that goes into a Roomba, to detect and manage all those conditions!?!? Frankly, that makes what I paid for mine a little more palatable. The hardware is one thing, but the R&D, and continued maintenance of the software, must really be costly...

Posted on
Sat Oct 02, 2021 12:46 pm
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

Installed 0.9.4. Cleaned one small room. No issues. So far, so good.

With all this great work you've been doing, surely you're getting close to calling it "1.0", no?

OK, that's enough Roomba-geeking for me for one day. As per my usual home automation efforts, I could have vacuumed my home several times over getting Indigo and Roomba to work together "just so!" Whaddayagonnado? :D

That said... while poking around in the plug-in, I thought I noticed some previous efforts regarding mapping. Any chance that was the previous plug-in's attempt to draw a map and plot the Roomba's location on the map in real time? That might exceed even my geekiness sensibilities!! :lol:

Have a great weekend!

Posted on
Sat Oct 02, 2021 4:30 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: iRoomba iRobot Plugin

Hi

You should notice the speed of notifications - literally pick up iroomba and Control page updates, put down etc. Basically now real-time. May still need to fine tune.

The mapping is left over from the original iroomba library. Problem is needs a whole pile of additional python libraries installed (never a good idea as difficult for some to do), and the maps produced aren’t the greatest in my mind. There has been some x/y reporting change to the non-S models that means they don’t update location now anyway.

Was hoping to be able to optionally pull maps from iroomba cloud - the ones they use, but that hasn’t been possible.

Glenn


Sent from my iPad using Tapatalk

Posted on
Sat Oct 02, 2021 6:46 pm
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

I meant to add this earlier: I definitely noticed things updating more quickly. Very nice. There is a brief message after "Saving map..." about "Editing map..." or something like that. That rarely registered before, now it pops right up. So good work on that.

I have an external Python script polling a non-Insteon device which then reports any significant data changes to Indigo (it's my internal/external temperature-sensing system). I was cautious about the frequency of the polling, and the reporting, and to what extent it retrieves and sets variables. I was concerned about Indigo's performance. I off-loaded the polling to an external script so it could run in its own thread, and "bother" Indigo as little as possible. At least that's what I understand about external Python scripts. It'd be great to have my temperature readings update in near-real-time, but I didn't want my script interacting with Indigo every second or two. Instead it updates readings only every five minutes, and only then if the temperature actually changes significantly. That's more than enough for temperature readings. Point being:

When you increased (somehow) the responsiveness of the Roomba plug-in updates to seconds, does that impact Indigo's responsiveness to its other tasks in any noticeable way? Or do plug-ins run in their own threads?

Regarding the mapping... it's not something I'd be particularly interested in. I think it's one of those things that would be very cool to see work, and then it'd get promptly forgotten. In my use case, I have an extensive video security system. If I want to know what my Roomba is doing, I can watch it on video, from anywhere in the world, in real time...

Posted on
Mon Oct 04, 2021 12:54 am
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: iRoomba iRobot Plugin

Hi

Plugins all run on separate threads - otherwise wouldn't be able to interact the the Indigo UI (user-interface) whilst things are happening. Indeed often the plugins also need various threads for various activities. iRoomba plugin mainly one thread currently, although debating as to separate thread per iroomba - but doesn't seem needed as yet.

So no impact on Indigo or the Mac - indigo utilites plugin can keep an eye on CPU usage of various plugins to double check.

Glenn

Posted on
Mon Oct 04, 2021 2:41 am
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

Good to know... Thx.

Posted on
Tue Oct 05, 2021 11:05 am
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

After using it a while, I am more fully appreciating how fast the plug-in is now updating states. Way better! Which is how I caught a possible glitch:

When deviceStatus (and NotReadyText) report "Saving Clean Map", errornotReady_Statement reports "Saving Clean Map. Cleaning available shortly." All good.

But when deviceStatus (and NotReadyText) report "Saving smart map edits", errornotReady_Statement reports "" (nothing).

If you're attempting to mimic what the app is reporting, I remember it did report "Saving smart map edits" at one point in the process.

I am making great use of the errornotReady_Statement, as well as the currentState_Statement. Excellent additions to the plug-in. This is the only inconsistency I've spotted so far...

Posted on
Tue Oct 05, 2021 11:06 am
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

After using it a while, I am more fully appreciating how fast the plug-in is now updating states. Way better! Which is how I caught a possible glitch:

When deviceStatus (and NotReadyText) report "Saving Clean Map", errornotReady_Statement reports "Saving Clean Map. Cleaning available shortly." All good.

But when deviceStatus (and NotReadyText) report "Saving smart map edits", errornotReady_Statement reports "" (nothing).

If you're attempting to mimic what the app is reporting, I remember it did report "Saving smart map edits" at one point in the process.

I am making great use of the errornotReady_Statement, as well as the currentState_Statement. Excellent additions to the plug-in. This is the only inconsistency I've spotted so far...

Edit: Right in between "Saving Clean Map" and "Saving smart map edits" the Roomba plays a "happy" tone. Is that signaling it's ready for a new mission? And why there is no text in errornotReady_Statement? But NotReady must have a non-zero value in it, because my "not ready" graphic is lit up (zero and it's off, anything else and it's on). There seems to be a conflict between NotReady and errornotReady_Statement when it comes to "Saving smart map edits."
Last edited by Mark on Wed Oct 06, 2021 12:37 am, edited 2 times in total.

Posted on
Tue Oct 05, 2021 1:05 pm
Mark offline
User avatar
Posts: 262
Joined: Apr 21, 2005
Location: California

Re: iRoomba iRobot Plugin

OK, so this is what I've been up to (still a work in progress)...

My Roomba interface is spread across three control pages:

1.
I have some Roomba preferences on my Settings page:

settings-1.jpg
settings-1.jpg (5.9 KiB) Viewed 6381 times

These settings control if lights will come on automatically in the area my Roomba is cleaning (I regularly clean a few areas at night). Lights will come on at mission start, either only when it's dark, or all the time (like on a gloomy day). Or not at all if no preferences are checked. The lights are all controlled by an external python script, which remembers which lights should come on for a given area. It also tracks which lights were already on, before mission start. And then the same script turns off the lights at mission end in the area just cleaned. Any lights that were on before the Roomba started will remain on after the mission is done. Otherwise I might get left sitting in the dark!!

The area's lights will go off during a recharge (so they don't stay on for the hour or two the Roomba is charging mid-mission). And then they'll go back on when the mission resumes.

2.
I have the main Roomba control and state elements in an area on my System page:

system-1.jpg
system-1.jpg (28.05 KiB) Viewed 6381 times

Mostly self-explanatory (at least to me!! :lol: ). The light grey numbers indicate approximate runtime for each area. Those were originally just labels, then I converted them to variables, because I was going to use them to determine how long an area's lights should stay on. But now the lights stay on until the Roomba is done vacuuming (but no longer), because runtime can vary by a lot, depending on too many factors. So the grey numbers are now just for my own reference (approximately how long a mission should take).

If the preferences and conditions dictate, an area's lights come on when I first click an area button. Those buttons then initiate the Roomba cleaning cycle for that area. This "one-click" setup is so much more convenient than messing with the iRobot app, which has too many features requiring too many touches to get the vac going. Not to mention my app regularly loses contact with my Roomba, requiring an app restart. Seems to be a known issue. The plug-in has yet to lose track of my Roomba. Hey, if you're going to pay to make vacuuming automatic, might as well make it as convenient as possible!

The last line is where I track the last area that was cleaned, how long it took, and when it occurred.

Here's a shot of the same elements when a mission first starts.

system-2.jpg
system-2.jpg (28.79 KiB) Viewed 6381 times

Green light indicates the Roomba is cleaning. Yellow light indicates some lights were turned on for this mission.

Towards mission end:

system-3.jpg
system-3.jpg (29.43 KiB) Viewed 6381 times

Green indicator went off when the Roomba finished vacuuming.
The yellow Lights indicator (and the area's lights) went off when the Roomba docked.
NotReady text shows up as orange.
ErrorText shows up as bright red.

3.
In an area on my primary "home" page, I have a simpler, smaller version. It houses a few control buttons, the lights indicator, battery life, and some custom statements and messages derived from various Roomba states. It lights up green, orange or red to indicate cleaning, not ready or errors. The yellow area light indicator is also a button. I can turn lights on or off manually for the area currently being cleaned. The errornotReady_Statement appears in orange, lower on my home page where there is room for longer sentences.

The middle line of text is derived from the currentState_Statement. I modified a handful of the statements to my liking, the rest pass through as is.

The bottom line of text expounds on the currentState_Statement, mostly tracking the current area or last area being cleaned, how long it took, and when the mission occurred (because my brain can't remember what I did 5 minutes ago :oops: ).

Here's a series of screenshots of my Roomba in action:

house-1.jpg
house-1.jpg (6.12 KiB) Viewed 6381 times


house-2.jpg
house-2.jpg (6.45 KiB) Viewed 6381 times


house-3.jpg
house-3.jpg (6.45 KiB) Viewed 6381 times


house-4.jpg
house-4.jpg (6.32 KiB) Viewed 6381 times


house-5.jpg
house-5.jpg (5.75 KiB) Viewed 6381 times


house-6.jpg
house-6.jpg (6.1 KiB) Viewed 6381 times


Anywho... some examples of the things you can do with this fantastic plug-in and a little imagineering. Thanks again, Glenn, for making all this possible, and easy(ish)!

Posted on
Sat Dec 11, 2021 1:55 am
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: iRoomba iRobot Plugin

New Pre-Release 0.9.9

Add ability to download from iRobot Cloud mapping info & Data and also use this connection to retrieve all password info for iRoomba devices.

This now also - Enables room/Room area cleaning based on this downloaded map data

Enables the addition for a new ActionGroup - clean specific rooms:

Here:

Image

Change some logging, config screens to better show info

NB: the iRobot Cloud connection:
Is only used for Password once/when selected and then is locally saved as before.
& it is used for downloading mapping data when button pressed once.
No ongoing Cloud connection needed. No other connection made.
So can download maps/info and then disable iCloud, delete info if prefer - should all still work; including room selection etc..

If maps are updated, new regions etc added - likely will need to redownload map data via the lower button.

Image


Earlier: 0.9.5
Add ability to retrieve individual iroomba Password from IRoomba Cloud API
Needed for J7+ it would seem, and simplifies other's as well.
New Get Password info within with Device Tab

Here:
https://github.com/Ghawken/Indigo-iRobotRoomba


Let me know how you go!



Glenn


Sent from my iPad using Tapatalk

Posted on
Mon Jan 31, 2022 9:22 pm
t-star offline
Posts: 115
Joined: Oct 26, 2007

Re: iRoomba iRobot Plugin

Does the new version capture the same text as the app where it states what room it is vacuuming?

Who is online

Users browsing this forum: No registered users and 1 guest