 uint32_t lastSendTime = 0;
 int8_t offset;  // The calculated period offset for this chip and library.
 
+#ifdef IR_RX
+String lastIrReceived = "None";
+uint32_t lastIrReceivedTime = 0;
+uint32_t irRecvCounter = 0;
+#endif  // IR_RX
+
 #if MQTT_ENABLE
 String lastMqttCmd = "None";
 uint32_t lastMqttCmdTime = 0;

    // If it isn't an AC code, add the bits.
    if (!hasACState(capture.decode_type))
      lastIrReceived += "," + String(capture.bits);
    mqtt_client.publish(MQTTrecv, lastIrReceived.c_str());
    irRecvCounter++;
    debug("Incoming IR message sent to MQTT: " + lastIrReceived);
  }

uint32_t lastDisconnectedTime = 0;
uint32_t mqttDisconnectCounter = 0;
bool wasConnected = true;

// MQTT client parameters
void callback(char* topic, byte* payload, unsigned int length);
