       client.publish(rfid_topic, pyStr.c_str());
 
       char msg[256];
+#ifndef LOCALMQTT
       snprintf(msg, sizeof(msg), "[%s] Tag <%s> (len=%d) swiped", pname, uidStr.c_str(), uid.size);
+#else
+      snprintf(msg, sizeof(msg), "[%s] Tag swiped", pname);
+#endif
       client.publish(log_topic, msg);
       Serial.println(msg);
 

#define SOLENOID_GPIO     (4)
#define SOLENOID_OFF      (LOW)
#define SOLENOID_ENGAGED  (HIGH)
#define AARTLED_GPIO     (16)

#define DOOR_OPEN_DELAY         (10*1000)   //  10 seconds -- how long to hold the relay engaged; in milli seconds.
#define CACHE_FALLBACK_TIMEOUT  (500)       // 0.5 second  -- how long to wait for a reply before checking the cache.

// Report regulary - but swithc to a higher frequency if we are in test mode. Also prefix our MQTT topic with 'test'
// to avoid confusing production.

  }

  static doorstate_t lastdoorstate = CLOSED;
  if (lastdoorstate != doorstate) {
    char msg[255];
    snprintf(msg, sizeof(msg), "[%s] Change from state %s(%d) to %s(%d)",
             pname,
             doorstates_names[lastdoorstate], lastdoorstate, doorstates_names[doorstate], doorstate);
    Serial.println(msg);
#ifndef LOCALMQTT
    client.publish(log_topic, msg);
#endif
    lastdoorstate = doorstate;
    last_doorstatechange = millis();
  }

  switch (doorstate) {
    case CHECKINGCARD:
      if (millis() - last_doorstatechange > CACHE_FALLBACK_TIMEOUT && caching && checkCache(uid)) {
