Control your Aldi EasyHome robot vacuum cleaner

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Post Reply
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Control your Aldi EasyHome robot vacuum cleaner

Post by LouiS22 »

Hi!

With the help of gizmocuz's and blitzkneisser's sketches I was able to integrate Aldi's robot vacuum cleaner (model number KSR RVC3000) into Domoticz. This particual model has IR receiver and a remote to control it.

The challenge was the following:

1. the IR protocol is not common one, so had to use RAW values.
2. to start with the remote, you have assign the CLEAN command twice.

The basics are written in these topics:

http://domoticz.com/forum/viewtopic.php?f=42&t=7648
http://domoticz.com/forum/viewtopic.php?f=42&t=10678

Gizmocuz had the brilliant idea to assign a hash to the raw values. In theory one can use this method to control almost everything.

Below the working sketch, there's a 3 sec delay between the two CLEAN commands.

Code: Select all

#include <MySensor.h>
#include <SPI.h>
#include <IRLib.h>
#include <avr/pgmspace.h>

int RECV_PIN = 8;

#define CHILD_1  3  // childId

IRsend irsend;
IRrecv irrecv(RECV_PIN);
IRdecode decoder;
IRdecodeHash Hash_Decoder;

//As some remotes could have different hashes for the same button (when they are not good received or other reasons)
//we only let the following hashes go through

#define MYCODES_NUM 6
#define MYCODES_LENGTH 24
const unsigned long myHashes[MYCODES_NUM] = {
  0x52A3E788,  // Be
 };

const unsigned int myCodes[MYCODES_NUM][MYCODES_LENGTH] PROGMEM ={
  4520,4332,592,484,592,1572,600,512,564,1568,596,520,556,1576,596,488,584,472,4508,4332,596,516,564,1600,568,484,592,1576,592,488,592,1568,596,476,596,480,4504,4328,596,484,596,1568,600,516,560,1568,604,480,596,1572,596,476,596,500,4484,4360,564,516,564,1572,596,476,600,1628,540,540,536,1576,588,480,600,464,4516,4328,596,484,596,1628,540,484,592,1572,596,484,596,1572,592,536,540};

int idx; // has index in table

//decode_results results;
MySensor gw;
MyMessage msgir(CHILD_1, V_IR_RECEIVE);

void setup()  
{  
  irrecv.enableIRIn(); // Start the ir receiver
  gw.begin(incomingMessage,AUTO,true);

  // Send the sketch version information to the gateway and Controller
  gw.sendSketchInfo("IR Transceiver", "1.1");

  // Register a sensors to gw. Use binary light for test purposes.
  gw.present(CHILD_1, S_IR);

  Serial.println("Ready to receive...");
}


void loop() 
{
  gw.process();
  if (irrecv.GetResults(&decoder)) {
    Hash_Decoder.copyBuf(&decoder);//copy the results to the hash decoder
    Hash_Decoder.decode();
    if (!FindHashInOurTable(Hash_Decoder.hash, &idx)) {
      Serial.print("Unknown IR hash received: ");
      Serial.println(Hash_Decoder.hash, HEX);
    }
    else
    {
      Serial.print("Known IR hash received: ");
      Serial.println(Hash_Decoder.hash, HEX);
      gw.send(msgir.set(Hash_Decoder.hash));
    }    
    delay(1000);
    irrecv.resume(); 
    }
}

bool FindHashInOurTable(const unsigned long hash, int * idx)
{
  for (int ii=0; ii<MYCODES_NUM; ii++)
  {
    if (myHashes[ii]==hash)
    {
      * idx = ii; // store index value
      return true;   
    }      
  }
  return false;
}

void incomingMessage(const MyMessage &message) {
  // We only expect one type of message from controller. But we better check anyway.
  if (message.type==V_IR_SEND) {
     unsigned long ir_code=(unsigned long)message.getLong();
     Serial.print("Gateway received code: ");
     Serial.println(ir_code, HEX);
     if (FindHashInOurTable(ir_code, &idx)) {
      unsigned int tempdata[24];
      Serial.print("Data to send(");
      Serial.print(idx, HEX);
      Serial.print("): {0x");
      for (int i=0;i<24;i++)
        {
          tempdata[i] = pgm_read_word_near(myCodes[idx] + i);
          Serial.print(tempdata[i], HEX);
          if (i < 23)
            Serial.print(",0x");
          else
            Serial.println("}");
        }
        for (int j=1;j<=4;j++) { //send it multiple times
          irsend.IRsendRaw::send((unsigned int *)tempdata, 24, 38);
          delay(15); //wait 15ms
        }
        delay(3000); //wait 3s
        for (int j=1;j<=4;j++) { //send it multiple times
          irsend.IRsendRaw::send((unsigned int *)tempdata, 24, 38);
          delay(15); //wait 15ms
        }
        
        irrecv.enableIRIn(); 
     }
  }
}
    

joostnl
Posts: 68
Joined: Wednesday 03 February 2016 19:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by joostnl »

Nice work! Can you give some information about the ir hardware your using? I wanna try this on my ilife v7 robot.
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by curious »

I am new to domoticz and investigating the possibilities.Doesn't the ir-sender have to pointed in the direction of ir receiver ??
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by LouiS22 »

joostnl wrote:Nice work! Can you give some information about the ir hardware your using? I wanna try this on my ilife v7 robot.
Hi I ordered the exact ones you find @ mysensors.org from aliexpress: http://www.aliexpress.com/item/2PCS-Dig ... a34cc14fe7
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by LouiS22 »

curious wrote:I am new to domoticz and investigating the possibilities.Doesn't the ir-sender have to pointed in the direction of ir receiver ??
Yes, that's right.
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by remb0 »

I want to build it also for my new vacuum cleaner (ilife a4)

are you going to add more controls like: back to base, max cleaning etc?
and are you going to migrate to mysensors 2.0 ?

first: I gonna order the components.
Kwintessens
Posts: 25
Joined: Monday 10 October 2016 13:37
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by Kwintessens »

joostnl wrote:Nice work! Can you give some information about the ir hardware your using? I wanna try this on my ilife v7 robot.
remb0 wrote:I want to build it also for my new vacuum cleaner (ilife a4)

are you going to add more controls like: back to base, max cleaning etc?
and are you going to migrate to mysensors 2.0 ?

first: I gonna order the components.

Any luck so far? I am orienting at the moment :mrgreen:.
Eurovik
Posts: 1
Joined: Monday 04 December 2017 9:11
Target OS: -
Domoticz version:
Contact:

Re: Control your Aldi EasyHome robot vacuum cleaner

Post by Eurovik »

Hello!

Nice work!
Unfortunately I do not have my remote control. Can you send the "HOME" and "VIRTUAL WALL" RAW codes?
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest