manexim / home

Control your smart home gadgets - Designed for elementary OS
https://elementary.io/
GNU General Public License v3.0
8 stars 7 forks source link

Add support to iRobot #32

Closed aimproxy closed 3 years ago

aimproxy commented 5 years ago

Hi, there is an unofficial sdk to control iRobot Roomba such as (i7/i7+, 980, 960, 900, e5, 690, 675, etc), take a look here: https://github.com/koalazak/dorita980

meisenzahl commented 5 years ago

@aimproxy which functions would be interesting for you? I would only want to implement features that are available via the local network. I don't want to be dependent on a cloud in Home.

aimproxy commented 5 years ago

@meisenzahl Hi, dorita980 have different functionalities one using local networks and others using cloud. I use an Roomba e5, for me I just want basic functionalities like: start, stop the robot, see the capacity of the bin, schedule the robot, locate the robot, change his name and some stats like nº of cleaning jobs, total job time, and dirt events. This functionalities I think is available on local network! I doesn't test yet the sdk. The cloud functionalities is only when u are not at home and u take their app and turn on the robot, the sdk can do this too. I understand ur opinion. Anyway would be cool have this functionalities using the local network! Also, If you want I can do some stuff to translate the sdk to vala, in a different repo and then merge into Home project!

meisenzahl commented 5 years ago

@aimproxy sounds really good what you can already do over the local network!

The scope of the SDK really doesn't look that complex. If you want to translate the SDK to Vala, you can look at components from Home. The LIFX smart bulbs are also discovered via UDP packets on the network. I can help you with that. I just can't test hardware connections because I don't have a Roomba.

It would be great if we could add Roomba support to Home.

aimproxy commented 5 years ago

@meisenzahl Thx, I will start looking at the sdk and home, I want translate the sdk in a separate to not be a self dependency of the Home project, so create a new repo is for the best to this sdk, also this is a thing I want discuss with you, is the structure of the Home project, each sdk shouldn't be separate from Home project?, when I said each sdk I mean all the code allows control's and discover LIFX hardware be separated from GTK Window !!, But this is another discussion, is not for this issue... Going back to the Roomba SDK, I gonna look at the dorita980 code and start port to Vala, I also gonna look how did you do to discover devices on the Home project! Don't worry with testing the hardware connections I can test it, but only with my Roomba e5!

aimproxy commented 5 years ago

@meisenzahl After read the code of dorita980 I see the V2 cannot be translated to Vala because mqtt protocol is required, and this lib do not exist in Vala, so the simplest away is using http request with json data like the V1 does! Now I think about using libsoup or libcurl!?

meisenzahl commented 5 years ago

@aimproxy I would prefer libsoup as it is already a dependency of Home.

aimproxy commented 5 years ago

@meisenzahl Can you tell me where is the discovery function in Home project? Instead of walking around looking lost in ur code, kkk... :)

aimproxy commented 5 years ago

@meisenzahl Also u do not answer about separate sdk's already done in Home, with that I mean separate all the code allows control's and discover hardware in a different repo and then make sub-modules to Home projects! This away ill be better to develop this SDK individually! Don't u think? But that is on ur own, after all is ur project!

meisenzahl commented 5 years ago

@aimproxy Take a look at https://github.com/manexim/home/blob/develop/src/lifx/Service.vala

You first have to setup the socket. Then you can listen to incoming packets.

You can then send a packet to the broadcast address 255.255.255.0.

I also implemented a helper class to work with the binary data. It is based on the Buffer class from Node.js.

Let me know if I can help you.

meisenzahl commented 5 years ago

Sounds like a good idea to outsource the individual components as modules to individual repositories. I create a milestone for the next but one version of Home.

meisenzahl commented 5 years ago

@aimproxy I created manexim/libirobot. Should we implement support for iRobot there?

aimproxy commented 5 years ago

@meisenzahl Yeah sure, I just try to understand ur function when u listen from income packets, kkk