   buttonpayload += vdd;
   buttonpayload += "}";
 
-  digitalWrite(greenLED, HIGH);
+  digitalWrite(greenLED, LOW);
 
   if (sendmqttMsg(buttontopic, buttonpayload)) {
+    digitalWrite(greenLED, HIGH);
     if (sendmqttMsg(topic, lightpayload)) {
       topicMsgSent = HIGH;
       digitalWrite(greenLED, LOW);
     }
   }
-  digitalWrite(greenLED, LOW);
+  digitalWrite(greenLED, HIGH);
 }
 
 boolean sendmqttMsg(char* topictosend, String payload)


void callback(char* intopic, byte* inpayload, unsigned int length)
{
  String receivedtopic = intopic;
  String receivedpayload ;


  }

  subMsgReceived = HIGH;
  digitalWrite(greenLED, LOW);


}

