   String sl(lux, 3);
   String slmin(lmin, 3);
   String slmax(lmax, 3);
-  // generate the payload for dweet.io
-  unsigned long now = Time.now();
-  String payload = "lux=" + sl +
+  // generate the payload
+  String payload = "{lux: " + sl +
       // also publish daily max and min values when button pressed
-      (button ? "&lmin=" + slmin + "&lmax=" + slmax : "") +
-      "&timestamp=" + now + "&time=" + Time.format(now, "%Y-%m-%dT%H:%M:%S");
-  if(!Particle.publish("Lux", payload, PRIVATE, WITH_ACK)) {
+      (button ? ", lmin: " + slmin + ", lmax: " + slmax : "") +
+      "}";
+  // publish data
+  if(!Particle.publish("luxdata", payload, PRIVATE, WITH_ACK)) {
     return -1;
   }
   return 0;



void loop() {
  doReadout(true);
  delay(2000);
}


int photoPin = A5;           // photoresistor pin
int powerPin = A0;
int readoutTimeIntervalMins = 1;   // perform a readout every given minutes

long lastReadoutTime = 0;    // timestamp of the last readout
float lux, lmin, lmax;
int day = 0;
bool connecting = false;


void setup() {
  pinMode(photoPin, INPUT);     // prepare the photoresistor
  pinMode(powerPin, OUTPUT);
  digitalWrite(powerPin, HIGH);
