I think you could change that, with the # it will receive all the data coming from the gateway, you could put for example home/sensors/ir
to restrict to IR data coming
There is no filtering following the type of protocol received, the state will update if the IR receiver see the value 3772793023.
This value is published by the gateway to the topic home/sensors/ir
This feedback coming from the gateway is used most of the time with RF remote control, by this way when pressing a button on the remote the switch in HA is updated. I donāt know if it is usefull for IR. In all the case it is better to donāt put home/commands/# as this is a general topic that can receive a lot of information
Iāve remove the state_topic: āhome/commands/#ā to limit the streaming and used āhome/commands/IR_SAMSUNGā instead.
Iām using MQTTfx to monitor the MQTT traffic, and when I subscribe to āhome/sensors/irā i dont get any messages?
I checked through the OpenMQTTGateway code and i couldnt find anything that publishes MQTT on that particular channel (āhome/sensors/irā), so Im curious how information gets posted on this channel?
Iāve been reviewing my Serial Monitor in the Arduino IDE, specifically with trace messages around the section of code that does sendValuebyMQTT() on lines 197-201 (Iāve slightly modified your initial code but line numbers should be close).
Iām only using the IR components but the irrecv.decode(&results)) in my situation is always returning 0 (false) so the code never drops into this if statement to publish the boolean result to the āhome/sensons/irā MQTT feed? Not sure why my irrecv message is always returning false? My HA build successfully turns on and off the tv now which is great so I know the build is successful.
if (mySwitch.available() || irrecv.decode(&results)) {
trc("Sending MQTT message back out with decoded result");
boolean result = sendValuebyMQTT();
if(result)
trc(F("value successfully sent by MQTT"));
Below is my Arduino IDE serial monitor output:
Hey I got a callback
Receiving data by MQTT
home/commands/IR_SAMSUNG
Acknowedgement of reception published
Callback value
3772793023
Converted value to unsigned long
3772793023
Hey I got a callback
Not processing this callback contains $subjectAck
It should go into this code when you send ir signal with your remote control in the direction of the IR receiver connected to pin D4 of your nodemcu. If it is not the case myabe itās a problem with the wiring of the IR receiver.
So there is not meant to be a MQTT message sent to āhome/sensons/irā when an IR signal is passed from the IR diode to turn on a device (e.g. Samsung TV)?
it depends where your ir receiver is placed but I agree it is more difficult to implement an updated switch with IR signals than RF signals due to the directional characteristic of IR
@1technophile I assume i setup the mqtt433 bridge correctly ā¦As I receive codes from my 433 hand senderās ā¦ unfortunately the bridge doesnāt recognise all buttons. I guess this is very hardware depended? I found one type of hand sender recognising all least button a and b ā¦Is there a hand sender working 100% with your bridge or can i do something to make other hand senderās 100% working ?
If I understand well on one RF remote control you have button reconized by the gateway and other not?
or depending on the remote control all the button are not recognised or all are recognised?
If itās a cheap remote from aliexpress (like that: http://s.aliexpress.com/UVfIrqAB ), when I received mine, one button emitted RF code, the other button still needed to be programmed (they can learn RF code).
Iāve used the RF bridged to program RF code in the remote.