 #include <TimeAlarms.h>
 
 // Variables used to store received data
-char *topicID; // MQTT topicID
 char *temp; // Received temperature data will be stored to this variable
 char *hum; // Received humidity data will be stored to this variable
-char *dtype; // Received dtype (device type) will be stored to this variable
-int deviceType = 0; // deviceType is a int value converted from *type pointer variable
+int receivedIDX = 0; // Received IDX number will be stored to this variable
+int dtype = 0; // Received dtype will be stored to this variable
 
 // HW settings
 const int RxLed = 13; // RxLed will be lit when RX433N received valid data

	uint8_t buf[VW_MAX_MESSAGE_LEN];
	uint8_t buflen = VW_MAX_MESSAGE_LEN;

    // If there are incoming bytes available from the server, read them and print them out.
	// This is for debugging purposes only. Not needed with current sketch.
	/*
    while(ethernetClient.available())

int mqttConnectionFails = 0; // If MQTT connection is disconnected for some reason, this variable is increment by 1

//MQTT configuration
#define DEVICE_ID  "Uno"
#define MQTT_SERVER "192.168.1.93" // IP address of MQTT server. CHANGE THIS TO CORRECT ONE
char topic[] = "domoticz/in"; // Default incoming topic in Domoticz is domoticz/in
int temperatureSensordtype = 80; // dtype (device type for temperature sensor) is used to help creating MQTT payload

//MQTT initialisation
PubSubClient mqttClient(MQTT_SERVER, 1883, sensorCallback, ethernetClient);
char clientID[50];
char msg[80];

//Temperature measurement configuration
const unsigned int tempMeasInterval = 1800; // Set temperature measurement interval in seconds. Default value 1800s (30min)
float temperature = 0; // Measured temperature value is stored to this variable
const int tempSensorIDX = 530; // IDX number of temperature sensor connected to this device

// OneWire and Dallas temperature sensors library are initialised
#define ONE_WIRE_BUS 7 // OneWire data wire is plugged into pin 7 on the Arduino. Parasite powering scheme is used.
