Home Assistant Community

RF receiver with Wemos D1 Mini

#1

Hi All

I’m working on a smart garage opener based on GarHAge. It is GarHAge in fact but with tiny additions I wanted to have: a physical button to open/close garage doors and a RF receiver to be able to control the door with my RF remotes. So everything went fine until I bought a generic set of a RF Receiver with it’s own remote for testing purposes while I decide/wait for a receiver that will work for my environment.

Being a newbie in all of this I made some assumptions (pretty sure most of them are wrong lol) and treat the receiver like a push button and expect my Wemos to “percieve” it just like it would perceive any push button. I wired the whole thing and now I can see data wire voltage change on RF remote buttons press (it goes from 0v to up to 10v), but Wemos does nothing about it whatever I do. Wemos code for the push button and the RF Remote button press is exactly the same but push button works and RF remote doesn’t.

So I would be very grateful on any guidance from the community on this topic because I wasn’t able to find any information that would at least give me hints on where to look in the last few days.

My breadboard looks like this:

The pieces of code I added to GarHAge related to RF receiver are as follows:

pinMode(door1_rf_buttonPin, OUTPUT);

void loop() {
if (digitalRead(door1_buttonPin)==HIGH || (door1_rf_buttonPin)==HIGH) {
Serial.print(door1_alias);
Serial.println(" open button was pressed!");
toggleRelay(door1_openPin);
Serial.print(“Opening “);
Serial.print(door1_alias);
Serial.println(” by a command of a button!”);
}

Full modified GarHAge code

0 Likes

#2

Hi,

I’m not sure how it is home assistant related nevertheless here is some advices:
-please format your code properly it is not readable
-your code doesn’t include any RF libraries but you have in your setup a RF receiver (433 or 315mhz)
-I would not use this kind of receiver for a garage door opener due to the fact that they are easy to act. You can use 433/315mhz basic protocols for sensors/detection/weather/PIR but NOT for actioning a door of your home! A burglar can eaily copy the code of your remote when you open the door and reproduce it when you will not be there. The off the shelf remote systems use rolling codes to avoid that.

Once this warning has been said you should better try to open/close your garage door with the wifi communication using mqtt as your program seems to be made for. And in this case we can find a link (far) with home assistant…

0 Likes

#3

Hi, thanks for your reply.

I can’t agree more to your statement that an RF receiver like this one shouldn’t be used for the purposes of allowing access to someones home. That’s why it’s a test device until I’ll get what I want, as I mentioned in the original post. All I need it to do at this point is to make it send current to an assigned pin on Wemos, so that Wemos would know that it needs to open/close my relays which in turn will open/close the doors. Therefore, I don’t need any RF libraries because I don’t need to read and/or manipulate any of the data that the RF receiver is getting (unless I’m terribly wrong).

So the question I have and can’t find an answer for is: why Wemos does nothing when one of it’s pins becomes high from an RF receiver? But performs as expected from a push button in exactly the same environment and code. It feels like there is some fundamental difference in signals from a basic push button vs RF receiver but I can’t be sure.

I will also totally agree that it would be much better to make any of the input devices I will use to just publish messages to mqtt but it’s beyond my capabilities at this point in time I’m afraid. I would want to build something that’s functional (even if not perfect) in the first place and deal with security and beauty of the setup and/or code later. (I’ve updated the original message with a link to my code on GitHub btw.)

As to how relevant this question is to Home Assistant - all I can say is that I couldn’t find a better place to ask than in a Hardware forum which seems to be full of hardware related questions without a direct link to HA.

0 Likes

#4

Hello,

The fundamental difference is that the RF receiver produce a non continuous signal from an RF signal by demodulating it, you can find more info there:
https://www.maximintegrated.com/en/app-notes/index.mvp/id/4439
In other word the RF receiver will produce an alternate signal between low and high at a frequency depending on your receiver. In all the cases faster than a push button.

If we consider that you want to actionate your garage door by subscribing to a MQTT topic or by pushing a button you don’t need to reinvent the wheel (unless you want which I can understand), you can find several projects that do this out of the box, in particular:

  • ESPEasy
  • ESPurna
  • OpenMQTTGateway
0 Likes