433 MHz buttons

Yes, exactly that. The difficulty I’m facing is that I started the “framework” right as I started working with the ESP8266. It’s not a proper library yet, it’s a couple of CPP files that I add to every project that references them, and then a few function calls. The framework ties several dependency libraries together exactly the way I want to use them, so that I don’t have to duplicate so much code in each project.

But, since I did that, I have actually made a proper library for building Homie 3.0.1 devices. It’s got an example and everything.

There’s also a couple of other classes, like the button handler I made, designed for advanced functionality for 433 MHz remotes such as counting multiple presses for multiple functions. It actually works more reliably than The Button from fibaro. For example these ones:


Or the all-white version:
image

They’re under 3 bucks each (aliexpress of course) and work GREAT. After having spent $50 each on two “The Button”, one of which I had to ship to Poland for service, I’ve learned my lesson. The all-white version blends into a UPVC window frame unbelievably well. At these prices the applications are endless.

There’s also several nice wall-mounted ones:

So yeah, anyway. I suppose I should bite the bullet and do the code cleanup and reorganization as soon as possible so I can release it into the wild. :slight_smile:

2 Likes

How long do the batteries last on those wall switches or are they mains powered?

They are completely wireless. Some models use CR2032 3V coin cells, others use 27A 12V batteries.
I haven’t had them long enough to answer your question but I believe the circuit is such that the current draw is ZERO when you’re not pushing a button, so I would expect them to last for at least a couple of years. My estimate is not completely taken from thin air, I based it on my experience with keyfobs which use the exact same technology (433 MHz ASK).

The round single-buttons come with batteries preinstalled. I just opened one now and found that it contains a CR2016 3V coin cell lithium battery.

Also if you’re curious, the range depends greatly on the receiving antenna (i’ve found making my own dipole for the receiver works the best, while the buttons are exactly as they arrived from the factory). You can in some cases get away with having the receiver in an adjacent room to the transmitter, but in other cases you’ll need an MCU in every room. It depends on both the receiving antenna and what material your walls are built from, of course.

Great looking solution!
Would you mind sharing a tuto?

I’d love to share it, if I had one to share :). Let’s start with cleaning up and releasing the source code.

Actually though, a full tutorial may not be make sense for a project like this – if we start from a blank slate, what level of prior knowledge do we assume? I think the entire process is probably too complicated for a tutorial.

Even just one of the many different tasks I’ve had to do to pull this off, for example Clone the original remote control, has multiple parts:

  • Dissect a crappy LED strip light controller just to salvage the VS838 infrared receiver module from it (since I didn’t want to wait several days for delivery)
  • Try and fail using a free library, then paid for AnalysIR
  • Built an Arduino Uno board into its own enclosure as a dedicated IR capture box
  • Capture the output of the original remote control
  • Manually modify the captured data to fit the IR library I’m using (IRremoteESP8266)
    …and many, many more details. You get the idea.

Because there are so many different parts the solution, it makes more sense to break it up. Many things already exist as tutorials, and I’ve spent the last two months experimenting, learning how to put existing libraries together the way I need them, as well as writing some of my own from scratch. Being self-employed I’ve been able to do it, but at some point I’m gonna have to get back to my day job :).

Anyway if you have any more specific questions I can probably help point you in the right direction.

Funny the included ir dump code in the examples of the irremote8266 library actually worked like a charm for reading my original remotes codes in my case.

1 Like

Awesome.
I have been trying to build a IR and RF 433 in an arduino using openmqttgateway. But haven’t figured out how to wire everything up and keeping it compact AND not needing a breadbox. Would be happy to learn of anyother types of code , and enable integration with OH.

1 Like

The source code should definitely help then. :slight_smile:

Please note that I used an ESP8266 (also known as NodeMCU), not an Arduino.
The ESP8266, although a more difficult platform to work on, has WiFi built in natively.

I’m not sure what I did wrong. The time scale of the values seemed completely wrong. The codes took many times longer than normal to replay and were of course not understood. I tried manually modifying the scale and got nowhere. Finally threw $30 at the problem and that was enough to make it go away. If only all problems were that easy to solve. :slight_smile:

1 Like

Hi Leif would you mind sending the links to the buttons you are using? I am currently using dashbuttons but the delay on them is not ideal. These look like a good solution. Thanks

1 Like

Sure!

All the above ones have been excellent!

There’s only ONE model that I can NOT recommend, and it’s this one:

The microcontroller inside the last one repeats the command for almost a second after you let go. This may be fine for a normal on/off switch but it makes it impossible to do fancy things like counting button pushes. All others respond instantly to both pushing and releasing.

1 Like

Awesome! Can you advise how you integrated these into openhab?

1 Like

It looks like ordinary 433MHz devices. So all you need is a 433MHz gateway… I believe there is a binding for 433MHz gateways in the addons using this:

I havn´t tried myself, and maybe Leif is using something else.

1 Like

I do it with NodeMCU (ESP8266) microcontrollers programmed through the Arduino platform, and 433 MHz receiver modules. See my air conditioning controller above for an example. Besides the IR emitter it also includes the 433 MHz receiver so that I could add buttons like this to the bedroom and the adjacent bathroom.

Yes - soldering required, programming required, but we’re talking literally a few dollars per system, and the possibilities are ENDLESS. They’re also good skills to have, but it’s certainly not for everyone!

I’ve been a programmer for 20 years but my deep-dive into electronics only started a couple of months ago. The water is warm so far!

I’m releasing the libraries I’ve written so far, in this thread.

Depending on how much of a deep-dive you want to make, this may not be for you at all. If not, then certainly a ready-made gateway will be a better solution, and then what @Kim_Andersen recommended might be great! I have no experience with them.

1 Like

got to love this switches :slight_smile:

i ordered this one last night
8 switches
and it will detach from the wall
i will update how it goes :slight_smile:

2 Likes

now that is a real good Q, i have PIR/Door /Smoke/Leak/Switches
and i did not change any battery yet , its been about 6 months now
but i guess the PIR will die first … as its mostly used…
and switches to run forever(something like two years till the battery will decay)

i am planing to buy some kind of battery brand so maybe it will be even longer for a quality battery, and not the cheap ones it comes with

1 Like

How did I miss this one!! Thank you! :slight_smile:

1 Like

Have you considered openmqttgateway? Just use that as an ESP gateway from 433 to mqtt. Cheap and easy to set up, and you can extend your range by having multiple of these.

1 Like

NICE! That’s really useful. If I weren’t a programmer I’d be all over that.

It is! I use it as gateway for 433mhz buttons, and for bluetooth devices (Xiaomi temperature/humidity, Xiaomi MiFlora,…). Not only can you do 433/BT/IR/… -> MQTT but also MQTT -> 433, to transmit 433Mhz signals easily by just sending an mqtt message to a particular topic

1 Like