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:
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.
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.
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.
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.
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.
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.
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.
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
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