BRUH DIY Multisensor


not especially, but you can too if you do not want to have the led to go blue when it reboots/reconnects…
For you it was an edit to tell that the code to force the update was working. Or at least I thought it was working… I am not so sure now. I will check it a bit more in depth tonight


@lambtho Ah right OK, I wanted to try it but you are saying you are not sure if its working? how come?

On the original topic, did you say your sensor when you blow on it, it changes the values in 2 seconds and you can see the change on the front end?

I wonder what is wrong with mine and why I cannot see the change in roughly 2 seconds when I blow on it??!!


how did you manage to show in your graph for the real feel every 10 mins? and also how did you show the average?

BTW your graphs look amazing from the standard colours. How can I change the colour of my graphs on HA?



these graphs are made using grafana. It’s a third party software that let you further analyse the data you collected. This is not part of HA.

As for the response to my post, yes when I blow on it (or cover the light detector, or send an IR command) I can see a change within a few seconds in the frontend.
For the automatic update every 5min, after some extended tests, it does work properly (I can see a new line in the series monitor in arduino IDE every 5 min, even if nothing changes).
But as the value does not change, the last update data in HA does not change…

You could try the following code instead of BRUH’s (it’s a more complete version I would say). Note that it requires some modification of your HA configuration (as the MQTT topics are quite different).


Ah right perfect, thanks alot Thomas.

What I have noticed is that when I blow on my DHT22 sensor the values change on my front end after roughly 35-60 seconds.

Also what is the difference in this code and BRUH’s code?

Also I suppose this code does not contain the every 5 min reading?


the code I just posted was pointed out a few days/weeks ago in this topic (post 402 : BRUH DIY Multisensor). It is basically a rework of the BRHU’s code, but with many improvements. Like separate topics for each sensor, send only the state of updated components and not resend everything,…


Right ok I see.

Sorry to bother you again but the code that you just reposted what are:

lines 44 and 45? i.e.
#define DEVICE_NAME “MyDeviceName”
#define DEVICE_FRIENDLY_NAME “My Friendly Device Name”

Are these the MQTT topics or?


yes, it will change automatically all MQTT topics related to this sensor (lines 58 to 100). With that, each component has its own topic


Has anyone managed to print a 3d case for this sensor which is attached to the power socket something like this:


Did you end up working a complete yaml up for ShawnCorey’s ?

I did make a sensor but not the light and send/receive parts.


Did you get time to try this? My vibration sensors have just arrived, haven’t had time to try it yet but upon testing the vibration sensor using Digital PIN (basically replacing the PIR with the vibration sensor) and shaking it in my hand, sometimes it shows HIGH, but not all the time.

Might give it a go anyway but wondering if analogue reading might be better.


I was thinking along similar lines. If I find a small enough power supply I will design an .stl for it


I suppose it would be just a plug with some space to fit in all the sensors. The idea behind this is to stay clear of the clutter and wires.


I am having issues getting the PIR to work…
I have gone through this whole thread and followed various suggestions:

  • I followed the original diagram, so connected to the 5v connection
  • I followed one suggestion I found and connected to 3.3v instead
  • following the diagram the middle pin is signal and the outer ones are ground and voltage. It’s not clear to me though which is which…
  • so I have tried both sides without luck (both on 5v and 3.3v)
  • in one of these tests the sensor started smoking and I concluded that was the wrong connection :wink:
    Based on that I think it should be as per my attached picture, but happy to be corrected

Whatever combination I use though, it only shows “standby” and doesn’t change. The temperature sensor is working, so I do have a connection.


I did have the same problem until i got ground and power correct.


How did you find out which is which?
I have tried switching the cables / reversing the connection but it still doesn’t work
(For the record, I got rid of the one that started smoking, luckily I ordered a bunch of them)
Btw, what voltage did you end up using? 3.3 or 5?


Take a look at the blog referenced by @doubleUS . This should help clarify things.

doubleUS on Jun 7
Look here:


Thank you @gumbo and @Daniel_Gronlund !
The blog helped confirm that i had it attached correctly. Turns out that I had a different problem… the NodeMCU wasn’t working right. I tried it with another one, and it worked right away!
Glad i over-ordered all components since they are so cheap!
Now i can get to work on using the automations :slight_smile:

btw, the blog looks very interesting in general, many other ideas on how to use the NodeMCU in new projects.



Anyone have a idé how i can config the motion sensor to when it detects motion it should be in “motion detected” state for like 5 - 10 mins. Right now if i wanna control a lamp with the motion detection it would turn off after like 2 secs if im sitting still.


You can have it turn off if in ‘standby’ for 10 minutes, that’s how I got around that.
Not behind my PC at the moment put will paste my code once I’m back.
Basically it uses the 'for’command in the conditions.