Today we received the iRobot’s Roomba vacuuming robot. This robot will help us to keep the dust level on the floor at an acceptable level.
Integrating this robot into my Domotica system is a good example of how easy it can be to integrate a new type of Device into a Domotica system that works and is built like i think it should 🙂
Do i want to use the iRobot remote control? No, of course not; those things can get lost and it doesn’t bring integration! I have an IRTrans for Infrared controlled devices. So the first thing to do was finding the right IR codes for the Roomba. That wasn’t too hard. I created a .rem file for the IRTrans server and saw I could give the Roomba the CLEAN command.
Actually, that was the hardest part. Next thing I did was add a button on the touchscreen in the livingroom to manually control the Roomba from there. Drag & drop a button, a combobox and write 1 line of VB code:
Touchscreen finished; next! My Domotica system. This one needed a restart cause i had to add a new Device Class:
unit Roomba563; interface uses IRControlledDevice; type TRoomba563 = class(TIRControlledDevice) constructor Create(const AAddress,AphDeviceID,ALocation,ADescription:String); override; end; implementation uses Windows, Utils, DeviceTypes; constructor TRoomba563.Create; begin inherited Create(AAddress, APHDeviceID, ALocation, ADescription); SubDelay:=100; //msec end; initialization OutputDebugString('Init Unit Roomba563'); gclDeviceClasses.Add(TRoomba563); end.
Copy, Paste, Replace All, Save, Compile, Done! Virtually no “real” additional code needed, no adjustments to existing code; it all works perfectly together. It’s just another type of device…
Now, this Roomba makes too much noise to have it driving around in the same room as where you are, so there are 2 options: let the Roomba do the cleaning at night or while everybody’s away.
So now I’ve got one thing left to do: create 2 new events so that a status change of the alarm system will trigger either a CLEAN or a DOCK command, so that the Roomba will start cleaning while we’re away but also obediently return to its base station when we get back home. That’s about 6 records (rows) that need to be added to the database.
Done! I love it when a plan comes together 🙂