OpenMqttGateway

Hello.
I have a nodeMcu v3 esp8266. I can receive the code below, but i don’t know why i can’t send back and make my cover open, close.

{
    "value": 628740,
    "protocol": 26,
    "length": 19,
    "delay": 738
},
{
    "stat_t": "home/OpenMQTTGateway_ESP8266_RF/433toMQTT",
    "name": "628740",
    "uniq_id": "8CAAB50DE87C628740",
    "pl_on": "628740",
    "cmd_t": "home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433",
    "device": {
        "name": "OpenMQTTGateway_ESP8266_RF",
        "manufacturer": "OMG_community",
        "sw_version": "0.9.2",
        "identifiers": [
            "8CAAB50DE87C"
        ]
    }
}

I tried like:
mosquitto_pub -t “home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433” -m ‘{“value”: 628740,“protocol”: 26,“length”: 19,“delay”: 738}’
mosquitto_pub -t “OMG/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433” -m ‘{“value”: 628740,“protocol”: 26,“length”: 19,“delay”: 738}’.
I use the same pins and configuration as in the documentation.

Thank you!

I suspect something like this :

  action:
  - data:
      payload: '628740'
      topic: home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433
    service: mqtt.publish

But that is based on my Sonoff RFBridges (flashed with OMG)

I have in my configuration.yaml this code:

cover:
   - platform: mqtt
     name: cristi_covers
     state_topic: home/OpenMQTTGateway_ESP8266_RF/433toMQTT
     command_topic: home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433
     value_template: '{{ value_json.value}}'
     payload_open: '{"value": 628736,"protocol": 26,"length": 19,"delay": 735}'
     payload_close: '{"value": 628740,"protocol": 26,"length": 19,"delay": 735}'
     payload_stop: '{"value": 628736,"protocol": 26,"length": 19,"delay": 735}'
     state_open: 628736
     state_closed: 628740
     optimistic: false

In groups.yaml:

garage_doors:
      name: Garage Doors
      icon: mdi:garage
      entities:
        - cover.cristi_covers

And my UI looks like:
Screen Shot 2020-11-27 at 9.07.37 AM

When i press the bttn i receive in my gateway right code, but nothing happens:
Screen Shot 2020-11-27 at 9.07.58 AM

And in listening:

Message 97 received on home/OpenMQTTGateway_ESP8266_RF/433toMQTT at 9:10 AM:
{
    "value": 628740,
    "protocol": 26,
    "length": 19,
    "delay": 735
}
QoS: 0 - Retain: false
Message 96 received on home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433 at 9:10 AM:
{
    "value": 628740,
    "protocol": 26,
    "length": 19,
    "delay": 735
}

Something is wrong and it doesn’t work…Little help?
Thank you!

Hello @francisp and thank you for your answer. I tried like this:

switch:
  - platform: template
    switches:
      garage:
        friendly_name: cristi_switch_cover
        value_template: "{{ is_state('sensor.gatewayrf', '628736') }}"
        turn_on:
          service: mqtt.publish
          data:
            payload: '{"value": 628736,"protocol": 26,"length": 19,"delay": 735}'
            topic: home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433
        turn_off:
          service: mqtt.publish
          data:
            payload: '{"value": 628740,"protocol": 26,"length": 19,"delay": 735}'
            topic: home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433
        icon_template: >-
          {% if is_state('sensor.gatewayrf', '628736') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}

But i have the same issue like earlier. Switch send the message, gateway receives the message, the template it’s working, but the cover do not respond.

Hi,

I would try to see first if there is an hardware issue, sime troubleshooting priposal are below :
https://docs.openmqttgateway.com/upload/troubleshoot.html#not-able-to-send-or-receive-rf-or-ir

The best way is to setup a temporary receiver with the example in the link. Put it close to your device and see if it receives something.

I would try also with different command types (without specifying the protocol or the length)

Hi,

@1technophile I changed the hardware, I tried with a D1 mini 8266, I changed the pins and everything I could, RX, TX, but with the same result. I receive the same answer I try to send and it does not activate the shutters.
I don’t know how to try again.

Thank you for help.

Hi,

Did you try this:

This would enable you to know if your setup emits correctly the codes.

Hi,

@1technophile i tried like this:

  1. I pressed the remote control button and I received this code (close value):
    {
    “value”: 628741,
    “protocol”: 26,
    “length”: 19,
    “delay”: 734
    }
  2. After which I published this code (open value):
    {
    “value”: 628736,
    “protocol”: 26,
    “length”: 19,
    “delay”: 734
    }
    And it also changed in the receiver. From here I understand that the code was sent correctly.
    I will attach the pictures in the same order as the steps above.
    But the cover it’s not working…

Hi,

So your emitter setup is working !
I would check the following things :

  • is your test receiver located near to your roller shutter, to verify that your emitter has enough range
  • try to remove from your payload the length, and the delay.

Hi,
@1technophile i managed to set the second rf, but when I give the command in home / OpenMQTTGateway / commands / MQTTto433 it is not set in the second one.
I tried both ways and neither received the signal.
There seems to be a problem here. And there’s something else. The moment I set other pins, I get a different answer every time I press the same button.
I have another topic here and it’s some photo with my remote.

Thank you for your help.

Hi,

On your setup I don’t see any ground wire connected to the ESP. The ESP, the emitter and the receiver should all have their grounds(-) connected together.

Hi,
@1technophile i will attach some pictures:


Is something wrong?

yes GND of your microcontroller should be connected to the GNDs of the emitter and receiver.

@1technophile
Now I don’t receive any signal.


I managed to get an answer because I also put vin and gnd from the microcontroller, but every time I press a button, I receive a different code. I don’t get it every time I press. I don’t know what to do.

I suggest that before trying to control your shutter or see what you are receiving with the button, you finish the test setup. Once done you will be able to see if your devices are compatible.

Note that the 2 gateways must have a different MQTT gateway name.
With the 2 ESP, you could try to send a message from one, see if the other one receive it (either by the serial monitor or an MQTT broker client). And the other way around.
If both setup are working properly (you receive what you send in both directions), you can see now if your device is compatible.

I would try also to change the emitter pin to 4 (D2), in the code and in the setup

@1technophile
Now i use esp32, but every time when i press on remote button, I receive a new code. Maybe my remote is not compatible…
Thank you for all your help.


Yes this is possible.

But as I said, before checking the remote and to “certify” your setup, you should send from one ESP to another an RF signal by pushing an MQTT command. If this works constantly you can say that this is your remote. If not this is your setup.

@1technophile
Something strange is happening. When I send the signal from one setup, the other receiver receives something else: for example I send:
{
“value”: 628736,
“protocol”: 26,
“length”: 19,
“delay”: 737
}
And the other one receives:
{“Value” 52224, “protocol” 5 “length” 18, “delay”: 897}

If I send high values such as: 258507434, the receiver receives something else, but if I send lower values such as 66867, the receiver receives correctly.

my current configuration is 2x Esp32: