1 parent
1658784612
commit
ee3a76d348
2 files changed
+7
No files matched your search
@@ -198,8 +198,10 @@ unsigned long MQTTvalue = 0;
|
||||
if (mySwitch.available()||irrecv.decode(&results)){
|
||||
trc(F("Signal detected"));
|
||||
String subject;
|
||||
String valueAdvanced ="";
|
||||
if (mySwitch.available()){
|
||||
MQTTvalue = mySwitch.getReceivedValue();
|
||||
valueAdvanced = "Value " + String(MQTTvalue)+" Bit " + String(mySwitch.getReceivedBitlength()) + " Delay " + String(mySwitch.getReceivedDelay()) + " Protocol " + String(mySwitch.getReceivedProtocol());
|
||||
mySwitch.resetAvailable();
|
||||
subject = subject433toMQTT;
|
||||
}else if (irrecv.decode(&results)){
|
||||
@@ -208,6 +210,10 @@ unsigned long MQTTvalue = 0;
|
||||
subject = subjectIRtoMQTT;
|
||||
}
|
||||
if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT
|
||||
if (valueAdvanced != ""){
|
||||
trc(F("Sending advanced signal to MQTT"));
|
||||
client.publish(subject433toMQTTAdvanced,(char *)valueAdvanced.c_str());
|
||||
}
|
||||
trc(F("Sending signal to MQTT"));
|
||||
String value = String(MQTTvalue);
|
||||
trc(value);
|
||||
|
||||
Reference in new issue
Block a user