diff --git a/docs/use/ir.md b/docs/use/ir.md index 221797a..af7de00 100644 --- a/docs/use/ir.md +++ b/docs/use/ir.md @@ -110,7 +110,10 @@ by `# define JSON_MSG_BUFFER 1280` `# define mqtt_max_packet_size 1280` - ## Repeat the IR signal OpenMQTTGateway receive So as to repeat the IR signal received by the gateway once set the following parameter to true in [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L37) `#define repeatIRwMQTT true` + +## Raw IR signal forwarding +So as to repeat the raw IR signal received by the gateway, uncomment and set the following parameter to true in [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L39) +`#define RawDirectForward true` diff --git a/main/ZgatewayIR.ino b/main/ZgatewayIR.ino index 19d7231..036de6f 100644 --- a/main/ZgatewayIR.ino +++ b/main/ZgatewayIR.ino @@ -173,7 +173,7 @@ void IRtoMQTT() { storeValue(MQTTvalue); if (repeatIRwMQTT) { Log.trace(F("Pub. IR for rpt" CR)); - pubMQTT(subjectMQTTtoIR, MQTTvalue); + pubMQTT(subjectForwardMQTTtoIR, MQTTvalue); } } } diff --git a/main/config_IR.h b/main/config_IR.h index 47d519b..52bb79e 100644 --- a/main/config_IR.h +++ b/main/config_IR.h @@ -32,15 +32,16 @@ extern void MQTTtoIR(char* topicOri, char* datacallback); extern void MQTTtoIR(char* topicOri, JsonObject& RFdata); /*-------------------IR topics & parameters----------------------*/ //IR MQTT Subjects -#define subjectGTWIRtoMQTT "/IRtoMQTT" -#define subjectIRtoMQTT "/IRtoMQTT" -#define subjectMQTTtoIR "/commands/MQTTtoIR" +#define subjectGTWIRtoMQTT "/IRtoMQTT" +#define subjectIRtoMQTT "/IRtoMQTT" +#define subjectMQTTtoIR "/commands/MQTTtoIR" +#define subjectForwardMQTTtoIR "home/gateway2/commands/MQTTtoIR" // subject monitored to listen traffic processed by other gateways to store data and avoid ntuple #define subjectMultiGTWIR "+/+/IRtoMQTT" #define IRbitsKey "IRBITS_" // bits will be defined if a subject contains IRbitsKey followed by a value of 2 digits #define IRRptKey "RPT_" // repeats will be defined if a subject contains IRRptKey followed by a value of 1 digit -#define repeatIRwMQTT false // do we repeat a received signal by using mqtt +#define repeatIRwMQTT false // do we repeat a received signal by using mqtt, we send a command signal to subjectForwardMQTTtoIR #define repeatIRwNumber 0 // default repeat of the signal //#define RawDirectForward false // direct repeat of IR signal with raw data #define RawFrequency 38 // raw frequency sending