diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index 4bb7c2a..2ed3ad8 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -198,24 +198,16 @@ unsigned long MQTTvalue = 0; if (mySwitch.available()||irrecv.decode(&results)){ trc(F("Signal detected")); String subject; - String subjectAdvanced; - String valueAdvanced; if (mySwitch.available()){ MQTTvalue = mySwitch.getReceivedValue(); mySwitch.resetAvailable(); subject = subject433toMQTT; - subjectAdvanced = subject433toMQTTAdvanced; - valueAdvanced = "Value " + String(MQTTvalue)+" Bit " + String(mySwitch.getReceivedBitlength()) + " Delay " + String(mySwitch.getReceivedDelay()) + " Protocol " + String(mySwitch.getReceivedProtocol()); }else if (irrecv.decode(&results)){ MQTTvalue=results.value; irrecv.resume(); // Receive the next value subject = subjectIRtoMQTT; - subjectAdvanced = subjectIRtoMQTTAdvanced; - valueAdvanced = "Not available"; } - if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF or IR -->MQTT - trc(F("Sending advanced signal to MQTT")); - client.publish((char *)subjectAdvanced.c_str(),(char *)valueAdvanced.c_str()); + if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT trc(F("Sending signal to MQTT")); String value = String(MQTTvalue); trc(value); diff --git a/User_config.h b/User_config.h index 77c020a..d860d34 100644 --- a/User_config.h +++ b/User_config.h @@ -65,12 +65,10 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT //433Mhz MQTT Subjects and keys #define subjectMQTTto433 "home/commands/MQTTto433" #define subject433toMQTT "home/433toMQTT" -#define subject433toMQTTAdvanced "home/433toMQTTAdvanced" #define RFprotocolKey "433_" // protocol will be defined if a subject contains RFprotocolKey followed by a value of 1 digit #define RFpulselengthKey "PLSL_" // pulselength will be defined if a subject contains RFprotocolKey followed by a value of 3 digits //IR MQTT Subjects #define subjectIRtoMQTT "home/sensors/ir" -#define subjectIRtoMQTTAdvanced "home/sensors/irAdvanced" #define subjectMQTTtoIR "home/commands/MQTTtoIR" /* RF supported protocols