Revert "Publish advanced RF received data"

This reverts commit f14d4f3245.
This commit is contained in:
1technophile committed 2017-03-15 22:41:37 +01:00
1 parent f14d4f3245
commit 1658784612
2 files changed
+1 -11

No files matched your search

+1 -9
View File
@@ -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);
-2
View File
@@ -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