 {
   pinMode(ledPin, OUTPUT);      
   pinMode(hallPin, INPUT);     
-  //Serial.begin(9600);
-  Serial2.begin(9600);
+  pinMode(irPin, INPUT);
+  Serial.begin(9600);
+  //Serial2.begin(9600);
   EepromUtil::eeprom_read_int(eepromAddressCounter, &hallStateCounter);
+  EepromUtil::eeprom_read_int(eepromAddressCounter2, &irStateCounter);
   EepromUtil::eeprom_read_string(eepromAddressLastAccess, lastAccess, MAX_LENGTH);
 }
 

#include <EEPROM.h>
#include "EepromUtil.h"

const int hallPin = A0;     
const int ledPin =  13;     

const long eepromAddressCounter = 0;
const long eepromAddressLastAccess = 0x0A;

#define MAX_LENGTH 18
char lastAccess[MAX_LENGTH] = {'\0'};
int hallStateCounter = 0;
int hallState = 0;
bool hallStateChanged = false;

    }
    else
    {
      String s = Serial.readString();
      String lastAccessCmd = getValue(s, ':', 0);
      String lastAccessValue = getValue(s, ':', 1);

