NodeMCU based MQTT multi-sensor with OLED display

I also think that ESPHome is the most advanced solution so far.

That’s why I’m thinking that the MQTT HomeAssistant Discovery part is so important.

What we do lack is a UI solution that is accessible from the dashboard to program an ESP with ESPHome, like they support it for HA.

1 Like

I have used the ESPHome library as well. Its certainly easy to setup. I have had issues with it not being able to do proper DNS name resolution for my MQTT server (it works with other ESP libraries so its not a local network issue). Additionally, ESPHome seems to not work well with DHT22 sensors. I cannot get it to work reliably when other libraries do.

Lastly, the developer of ESPHome has created a protocol to allow direct communication to HA from ESP devices, bypassing MQTT all together. Worries me that MQTT will not be maintained long term.

1 Like

@Udee - I’m sticking with openHAB (as a big proponent of “don’t fix what ain’t broken”) :wink:


Filled to the brim, going to find a smaller PIR sensor so I can fit in a lux sensor later on. Working on a esp8266 expansion board with a IRM-03-5 on the backside of it specifically for this wallplate project. Should have some PCB samples shortly.


Nice job! I love that you fit this into the Decora form factor :slight_smile: I see you’re using my base board, does that fit in the back of the wall plate as well?

As for the IRM-03-5, I’m developing a board with it as well, for the Kube v2 project. It’ll stack between the base board and the OLED/AmbiMate board, to allow external power. I’m not sure the entire stack would fit well into the wall (I’m developing this as a standalone sensor enclosure), which is why I’m wondering how the baseboard alone fits in. An idea I plan to “steal” from aderusha is his support for multiple (AC & DC) power supplies on the same PCB ( - doing that would allow you to use POE, if you have it run into a low voltage wall plate.

One additional comment - the HC-SR501 is a fine PIR sensor, but I hope you have better luck than I did with false positives. I even wired it directly for 3.3v use (bypassing the 5V vreg), and while that helped (likely because the VIN line on the NodeMCU doesn’t provide a steady 5V), the PIR is still very sensitive to RF/EMI, and the Wifi signal from the NodeMCU sometimes triggers it falsely. This is why I’ve switched to the TE AmbiMate MS4 (pictured in my previous post above) - a much more professional sensor, with filtering built into the MCU on the board, and additional sensors as an all-in-one (temp/humidity/motion/audio level/light level/CO2/VOCs). If you got rid of the DHT22 and shifted your OLED up, you might even be able to fit it in within the space below the OLED.

1 Like

The Ambimate is $$$.

True - $32 for the fully populated version, but you get 8 sensors on one board, fully integrated and filtered.

Or, you can get the Temp/Humidity/Motion/Light sensor for $15 shipped OVERNIGHT from Arrow :slight_smile: (that’s if you’re in the US, of course). That’s not that much pricier than the HC-SR501, DHT22 and a lux sensor in separate packages…

That’s a better price than Amazon at $99 - so not that bad! Have you done an enclosure for this?

Yes, I’ve started an enclosure, but am not happy enough with it to share yet (it doesn’t help that I’m rebuilding my 3d printer which hinders testing the different design iterations). Here’s a preview (attempting to create a modular design, with different sub modules that stack/snap together):

1 Like

PIRs are useless with ESPs as best I can tell. I’ve tried a dozen different methods with no success. I’ve moved all my PIRs to Mysensors and couldn’t be happier. 0 ( ZEEE RO) false positives

looking awesome!

Have you considered using a RCWL-0516 sensor instead of a PIR.
Pretty good comparison video as well.

I haven’t tried but you should get away with this sitting within your enclosure without the need for an obtrusive window.

in my testing they’re far, far, far too sensitive to anything moving within 20 feet of it. through floors, walls, whatever. they’d be better used as whole house presence detection than room presence - in my opinion

From my understanding you can modify them to adjust their sensitivity.

I didn’t have much luck with that

I definitely share your opinion that most of the PIRs are useless with ESPs (and I’ve tried all the methods, as well, to no avail). But, this sensor is different. It’s not a DIY “Arduino” style sensor - it’s actually made to be installed in commercial products (e.g. alarm motion detectors), so it has all kinds of fancy filtering and smarts built into the MCU. There was no support for it in any of the DIY projects, so I ended up writing my own plugin for ESP_Easy for it. And, running it next to my NodeMCU for a couple weeks, I’ve had 0 false positives, as well (no such luck with any of the HC-SR501, AM312, etc…type sensors I’ve tried). So, I’m cautiously optimistic with this sensor :slight_smile: In this application, it also sits on a double ground plane of the OLED carrier PCB, so there’s additional RF protection there, not that it seems to be needed, anyway…

I have seen that video, and I have an RCWL-0516 sensor I could try - but as @waspie says - it’s way too sensitive, and everyone I know who’s tried to adjust that sensitivity has failed (there are resistors you can place on the board, but they don’t seem to do much).

1 Like

Oh, I wasn’t referencing that board you posted, my bad. I looked at it a bit and found it pretty interesting especially since it was only 15 bucks. My first thought was, has anyone made a plug-in for espeasy :joy:

1 Like

Yup :slight_smile: PR is entered, but I haven’t had time to look at (and rewrite some of the plugin logic) per TD-er’s recommendations…

1 Like