Hi, I’m a new user of OMG,
I am using Nodemcu ESP8266 and tried to use RF transmitter to control Etekcity outlets in HA but when I turn on the switch in HA there is no signal at all.
So I started to test the simple example (RCSwitch) and it works. I can see the signal of my receiver and transmitter in the serial monitor.
Here is the result in the serious monitor
{
N: Connected with saved credentials
N: WiFi ok with manual config credentials
N: RF_EMITTER_GPIO: 3
N: RF_RECEIVER_GPIO: 0
N: Setup OpenMQTTGateway end
W: MQTT connection…
N: Connected to broker
N: Subject: /SYStoMQTT
N: Received json : {“uptime”:8,“version”:“version_tag”,“freemem”:46104,“rssi”:-65,“SSID”:"",“ip”:"",“mac”:"",“wifiprt”:0,“modules”:“RF”}
N: Subject: /SYStoMQTT
N: Received json : {“uptime”:128,“version”:“version_tag”,“freemem”:46832,“rssi”:-51,“SSID”:"",“ip”:"",“mac”:"",“wifiprt”:0,“modules”:“RF”}
}
So I flashed the program again using Arduino IDE and looks like I successfully connect to the MQTT server. See the message below.
{
Message 28 received on homeassistant/sensor/8CAAB562F597gatewayRF/config at 5:10 PM:
{
“stat_t”: “home/OpenMQTTGateway_ESP8266_RF/433toMQTT”,
“name”: “gatewayRF”,
“uniq_id”: “8CAAB562F597gatewayRF”,
“val_tpl”: “{{ value_json.value | is_defined }}”,
“device”: {
“name”: “OpenMQTTGateway_ESP8266_RF”,
“manufacturer”: “OMG_community”,
“sw_version”: “v0.9.5”,
“identifiers”: [
“8CAAB562F597”
]
}
}
In my case, I uncommented the RF module.
/-------------DEFINE THE MODULES YOU WANT BELOW----------------/
//Addons and module management, uncomment the Z line corresponding to the module you want to use
#define ZgatewayRF “RF” //ESP8266, Arduino, ESP32
//#define ZgatewayIR “IR” //ESP8266, Arduino, Sonoff RF Bridge
I also changed the pulse length
{
if ((cmpToMainTopic(topicOri, subjectMQTTtoRF)) && (valuePRT == 0) && (valuePLSL == 0) && (valueBITS == 0)) {
Log.trace(F(“MQTTtoRF dflt” CR));
mySwitch.setProtocol(1, 188);
mySwitch.send(data, 24);
// Acknowledgement to the GTWRF topic
pub(subjectGTWRFtoMQTT, datacallback);
} else if ((valuePRT != 0) || (valuePLSL != 0) || (valueBITS != 0)) {
Log.trace(F(“MQTTtoRF usr par.” CR));
if (valuePRT == 0)
valuePRT = 1;
if (valuePLSL == 0)
valuePLSL = 188;
if (valueBITS == 0)
valueBITS = 24;
}
I checked the message received in the MQTT server, which shows my Nodemcu has been connected to the server.
Here is my yaml switch setting
switch:
- platform: mqtt
name: IR Power
state_topic: “home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433”
command_topic: “home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433”
payload_on: ‘{“value”: 349491}’
payload_off: ‘{“value”: 16625743}’
qos: “0”
I have struggled for 2 weeks and couldn’t find the reason and solution.
Please let me know what I’ve overlooked or done wrong.
Thank you.