 	return temperature;
 }
 
+int lightGet() {
+	int light = analogRead(LIGHT_GPIO);
+	return light;
+}
+
+int noiseGet() {
+	int noise = analogRead(NOISE_GPIO);
+	return noise;
+}
+
 void loop() {
 	Thingplus.loop();
 	t.update();


	if (current > nextReportInterval) {
		Thingplus.gatewayStatusPublish(true, reportIntervalSec * 3);
		Thingplus.sensorStatusPublish(temperatureId, true, reportIntervalSec * 3);
		Thingplus.sensorStatusPublish(ledId, true, reportIntervalSec * 3);
		Thingplus.valuePublish(temperatureId, temperatureGet());
		nextReportInterval = current + reportIntervalSec;
	}
}

#include <Arduino.h>
#include <Ethernet.h> 

#include <SPI.h>
#include <Time.h>
#include <TimeLib.h>
#include <Timer.h>
#include <Thingplus.h>

/////////////////////////////////////////////////////////////////////////////
byte mac[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 			//FIXME MAC ADDRESS
const char *apikey = "";  																//FIXME APIKEY
const char *ledId = "led-000000000000-0";									//FIXME LED ID
const char *temperatureId = "temperature-000000000000-0";	//FIXME TEMPERATURE ID
const char *buzzerId = "buzzer-000000000000-0";						//FIXME BUZZER ID
const char *lightId = "light-000000000000-0";							//FIXME LIGHT ID
const char *noiseId = "noise-000000000000-0";							//FIXME NOISE ID
const char *buttonId = "onoff-000000000000-0";						//FIXME BUTTON ID
/////////////////////////////////////////////////////////////////////////////

Timer t;

int ledOffTimer = 0;
int ledBlinkTimer = 0;

int BUTTON_GPIO = 3;
int LED_GPIO = 8;
int TEMP_GPIO = A0;
int LIGHT_GPIO = A3;
int BUZZER_GPIO = 2;
int NOISE_GPIO = A2;
int reportIntervalSec = 60;

static EthernetClient ethernetClient;
