[Under New Management] iRobot Scheduler

Understood. I think the development and contributions everyone is providing is excellent, including your work!

My use case is the following.

  • Zone Motion goes Inactive (This happens based of no motion in the house for an hour)
  • between certain times
  • If HSM is Disarmed
  • If a virtual switch is Off (This is used to determine if it ran already)

No schedule is needed. This runs every single day.

The app requires a schedule which technically would be fine, but I want the availability for it to turn on between those 12 hour ranges if it meets those conditions. It would need to use those conditions to trigger it instead of a schedule.

Perhaps you could include a condition if a virtual switch is ON or OFF then it can run. The options you have to postpone the schedule for a later time may work. Assuming you can allow it to be run within a 12 hour range. (I think the app does this)

Also, if we could have another condition to check if HSM is disarmed, so it doesn’t set off HSM when the roomba is running and a motion sensor picks it up.

I think my use case is better fit for a rule.

What model of iRobot do you have?

I will be working on the next version of iRobot scheduler. I have learned a lot over the past 3 months on how to optimize my code base. I also want to make the app easier to understand from a setup perspective so a code rewrite will probably happen over the next couple weeks.

I will look at removing the mandatory requirements for the schedule. Others just use presence and would like to not have a schedule. There may be options within the app you would like to use but will need to continue to use a Rule for your use case but can just turn on the device.switch accordingly.

Another thing you may want to noodle on is not disarming your HSM just for iRobot. Might want to do the following:

  • iRobot App has a schedule that runs daily based on your presence needs
  • Use a Rule to watch for iRobot device to turn on
  • If iRobot device is on change HSM from armed away to armed home
  • After iRobot is done cleaning (switch turns to off) change HSM back to armed away

This would work now with the app btw. :slight_smile:

980

That’s a good idea. How do you handle when the roomba virtual switch turns off? Doesn’t it just want to dock or stop?

That is if you turn off the switch. If the Roomba is docking the switch starts on until it docks.

I assume the switch auto switches off when it sees itself docked?

Correct. It also switches off if the Roomba gets stuck and stops for some reason.

Thanks for the quick reply!

This is what I get when I execute that command in the browser. Interesting that the Endpoint isn't found, and yet it's clearly getting a response from the pi. Any idea what's going wrong?

Error: Endpoint not found.
    at /home/pi/rest980/app.js:62:13
    at Layer.handle [as handle_request] (/home/pi/rest980/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/pi/rest980/node_modules/express/lib/router/index.js:317:13)
    at /home/pi/rest980/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/pi/rest980/node_modules/express/lib/router/index.js:335:12)
    at next (/home/pi/rest980/node_modules/express/lib/router/index.js:275:10)
    at /home/pi/rest980/node_modules/express/lib/router/index.js:635:15
    at next (/home/pi/rest980/node_modules/express/lib/router/index.js:260:14)
    at jsonParser (/home/pi/rest980/node_modules/body-parser/lib/types/json.js:110:7)
    at Layer.handle [as handle_request] (/home/pi/rest980/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/pi/rest980/node_modules/express/lib/router/index.js:317:13)
    at /home/pi/rest980/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/pi/rest980/node_modules/express/lib/router/index.js:335:12)
    at next (/home/pi/rest980/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/home/pi/rest980/node_modules/express/lib/router/index.js:174:3)
    at router (/home/pi/rest980/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/home/pi/rest980/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/pi/rest980/node_modules/express/lib/router/index.js:317:13)
    at /home/pi/rest980/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/pi/rest980/node_modules/express/lib/router/index.js:335:12)
    at next (/home/pi/rest980/node_modules/express/lib/router/index.js:275:10)
    at authHandler (/home/pi/rest980/app.js:23:48)

Disregard that prior post. It actually does work when I take out the double slash from the command. My bad. Here's the browser output to http://raspberrypi:3000/api/local/info/state:

{"netinfo":{"dhcp":true,"addr":3232235812,"mask":4294967040,"gw":3232235777,"dns1":3232235777,"dns2":0,"bssid":"74:83:c2:71:45:91","sec":4},"wifistat":{"wifi":1,"uap":false,"cloud":1},"wlcfg":{"sec":7,"ssid":"42696F6C6F6769615F322E3447687A"},"mac":"40:9f:38:b3:8d:91","country":"US","cloudEnv":"prod","svcEndpoints":{"svcDeplId":"v011"},"mapUploadAllowed":true,"localtimeoffset":-240,"utctime":1589835749,"pose":{"theta":-2,"point":{"x":0,"y":-1}},"batPct":100,"dock":{"known":true},"bin":{"present":true,"full":false},"audio":{"active":false},"cleanMissionStatus":{"cycle":"none","phase":"charge","expireM":0,"rechrgM":0,"error":0,"notReady":0,"mssnM":0,"sqft":419,"initiator":"localApp","nMssn":195},"language":0,"noAutoPasses":true,"noPP":false,"ecoCharge":false,"vacHigh":false,"binPause":true,"carpetBoost":true,"openOnly":false,"twoPass":true,"schedHold":false,"lastCommand":{"command":"dock","time":1589836938,"initiator":"localApp"},"langs":[{"en-US":0},{"fr-FR":1},{"es-ES":2},{"de-DE":3},{"it-IT":4}],"bbnav":{"aMtrack":71,"nGoodLmrks":7,"aGain":69,"aExpo":134},"bbpanic":{"panics":[8,8,6,8,8]},"bbpause":{"pauses":[17,5,5,4,4,4,13,6,5,6]},"bbmssn":{"nMssn":195,"nMssnOk":125,"nMssnC":50,"nMssnF":20,"aMssnM":54,"aCycleM":47},"bbrstinfo":{"nNavRst":47,"nMobRst":0,"causes":"0000"},"cap":{"pose":1,"ota":2,"multiPass":2,"carpetBoost":1,"pp":1,"binFullDetect":1,"langOta":1,"maps":1,"edge":1,"eco":1,"svcConf":1},"hardwareRev":3,"sku":"R980020","batteryType":"lith","soundVer":"31","uiSwVer":"4582","navSwVer":"01.12.01#1","wifiSwVer":"20992","mobilityVer":"5806","bootloaderVer":"4042","umiVer":"6","softwareVer":"v2.4.6-3","tz":{"events":[{"dt":1583082000,"off":-300},{"dt":1583650801,"off":-240},{"dt":1604210401,"off":-300}],"ver":8},"timezone":"America/New_York","name":"Roomba","cleanSchedule":{"cycle":["none","none","none","none","none","none","none"],"h":[10,9,9,9,9,9,10],"m":[0,0,0,0,0,0,0]},"bbchg3":{"avgMin":3628,"hOnDock":10920,"nAvail":299,"estCap":12311,"nLithChrg":146,"nNimhChrg":0,"nDocks":131},"bbchg":{"nChgOk":145,"nLithF":0,"aborts":[0,0,0]},"bbswitch":{"nBumper":42362,"nClean":179,"nSpot":15,"nDock":131,"nDrops":7704},"bbrun":{"hr":121,"min":18,"sqft":487,"nStuck":67,"nScrubs":608,"nPicks":1273,"nPanics":3325,"nCliffsF":4775,"nCliffsR":4072,"nMBStll":0,"nWStll":22,"nCBump":0},"bbsys":{"hr":17651,"min":38},"signal":{"rssi":-38,"snr":48}}

Commands work too via raspberrypi:3000/api/local/action/[command]

But I still get Rest980 Server cannot be reached - check IP Address in the HE iRobot Scheduler app.

I see the issue. You need to use an IP address and not mdns.

Getting the same issue with both. I mostly actually just use the ip address. I'm just typing raspberrypi here since it's getting me the same results and is more generalizable to others.

Didn't want to confuse people reading here later by typing 192.168.1.44:3000, etc.

go to this address
http://192.168.1.44:3000/map

click on buttons if it doesnt work
its problem with rest980 and you need to fix that.

also don't add :3000 in the IP address in the app.

Can you screenshot your app selections in the app itself?

Here's a screenshot. Buttons work and everything.

Here's a screenshot of top part of app selections:

Check if there is not empty space after 44 and 3000

2 Likes

Good catch! I have some error checking I need to add. :grin:

If the suggestion of a potential space is not there you can edit lines 100 and 101 and change the “required: true,” to “required: false,”

1 Like

Thanks for all the ideas everyone!

Somehow it's suddenly working now and I really don't know why. Here's what I did immediately before it started working:

  • Replaced the app code for older versions of the iRobot Scheduler. Tested, still did not work.
  • Replaced the app code back to current version. Replaced the driver code while I was at it for good measure (even though I never changed it). Tested, still did not work.
  • Created a virtual Roomba named 'Roomba,' for shits and giggles. Got a weird error that a device named Roomba was already created. (And I can assure you I have never created that virtual device). Checked and sure enough, now there was a device named 'Roomba.'
  • Deleted that device, suddenly the app let me connect to my Roomba.

Maybe I'm an idiot and somehow accidentally made a virtual Roomba previously and don't remember it now (but I really am quite certain I didn't), or maybe during one of the attempts to connect the app to my Roomba somehow a messed up Roomba device was created. Whatever happened, my Hubitat now has full control of my Roomba 980 via my Raspberry Pi Zero W (with the modifications to the instructions I've mentioned above since the Pi Zero W has an ARMv6 which is no longer supported by node.js).

I really appreciate all the brainpower everyone has put into helping me solve this. This really is a wonderful community. @aaron, if it would help, I don't mind writing up the step-by-step of setting up on the Raspberry Pi Zero W to add to your readme. Just let me know.

1 Like

Yes exactly.

@aaron's HE app appears to automatically creates the device, which explains why you had a Roomba device show up "mysteriously". When I ran the installed the HE app, even though it never finished running after I hit done (just kept getting the Hubitat spinning blue circle and got the same error--"Rest980 Server cannot be reached"), the Roomba device was still created. But the device doesn't appear to function.

Also I can't add the Roomba device to my dashboard. While the HE app did create a Roomba device, the only attribute the dashboard recognizes for the device is a switch. Weird.