What I like about these is that I don't have to worry about changing the batteries. I added some code in esphome to show the wifi signal strength and up time. It lets me know how my wifi network is preforming. Just add this to the yaml code and change the name to whatever you are using. sensor: - platform: wifi_signal name: "PIR WiFi signal" update_interval: 60s - platform: uptime name: "PIR uptime" unit_of_measurement: "min." filters: multiply: 0.0166666667
Great tips 👏 thanks for that! Do you have any issues with false positives? If yes, how you deal with them? Thanks one more time for the useful comment.
@@KPeyanski I had false positives when I used short Dupont wires like you did. I switched to longer wires, over a meter, and moved the sensor away from the D1-mini and it fixed the problem. I used cat 5e and connected it using a wire wrap tool, but soldering would also work. The PIR sensors appear to have been designed for alarm systems where they would be away from other electronics.
I've used Home Assistant for several years now and noticed the Esphome integration, but had no idea how easy it was to use. Just ordered 5 nodemcu and 5 motion sensors. Now I can have my lights come on as I ever l enter certain times. Can't wait to try them out. Thanks for this great tutorial. 👍
I also wanted to know as I want to build a floating pool temperature gauge and switch on every 2 hours and goes to sleep but I’m not good with electronics but I follow these videos easy
SUGGESTION.. Could you make a tutorial on building a cheap Wifi Door Sensor.? I'm sure using these D1 Mini boards and a cheap (Reed/Magnet) contact switch would be very useful to a bunch of people. Thanks in advance. 👍😊
Hi, I have my Home Assistant running on Synology NAS on virtual machine. Everything went ok until Install, where I got a message "No serial devices found". Validation went OK. I plugged in the sensor into USB of the NAS drive. Any ideas what went wrong and how it can be installed? Thank you !!
Excellent solution, cheap and effective! I looking for similar solution but working with zigbee instead of wifi. Do you know how to do it and can you please make a video explaining how to do it?
Yes, unfortunately false events are present. And this Is because of the sensor itself. There are some tricks that can be used to minimise them and I think we discussed them either here in the comments or in my written article.
@@ecoterrorist1402 fiddle with the 'time out' so it doesn't trigger the automation all wild like, then when triggered on add a "wait for time delay". in the same automation, send a command to turn lights off
#PIRowned the only issue is that the motion sensor must be attached to the Rasberry-pi/Laptop is there a way to use a battery to power it also the wireless option how it works ? thanks great video
Great, that you manage to make the PIR sensor ;) For sure there is a way to add a batteries, but I can't give you concrete directions, because I haven't done that yet and I don't want to give you false instructions.
4usd for the esp board and pir sensor, sure, but you still need to buy more stuff like usb cable and power adapter for each, case, wires. Tgis is more like a 20usd device once you finally assembled one.
You actually don't need a USB cable for power. Tons of ways to hook it up. For cases, there's 3D printing. Wires are super cheap if you're not using prototyping wires and buy rolls of the stuff. What he's showing here is how to get started. Use your imagination and get creative on what materials you can use to make dozens of them. I've been able to get mine down to about $1 a piece, not counting batteries (rechargable AA) which sure as heck beats off the shelf hardware, $15 to $30 a piece.
thanks for the tipp - using ikea trådfri motion sensor for €9 per piece but they suck after motion was detected you will have 60 seconds until the device will take a new motion detection - so deadtimer another questions: how do you power them? microusb is not available all the time where I need this sensors. any ideas? are these kind of ESP modules also available for Zigbee? I love it since I didn't have any outages or issues with that protocol.
ESP8266 and ESP32 are Wi-Fi microcontrollers only. I power them with microUSB cable and any USB adapter (from phone or other device) Probably you can attach a battery, but I didn't tried this and I don't know which battery I can recommend.
Thanks for the vid! Only downside to commercial solutions is the need for having it hooked up to a power source. I don't have a socket close to every point where I use those. Any way to make these battery powered? I guess that wifi will be eating to much power?
Thanks for the great video, but I'm getting error in binary_sensor: please help!! INFO Reading configuration /config/esphome/esp-motion-sens-2.yaml... Failed config captive_portal: [source /config/esphome/esp-motion-sens-2.yaml:31] [binary_sensor] is an invalid option for [captive_portal]. Please check the indentation.
#PIRowned Hi Kpeyanski, I took NMCUV3 ESP8266 and HC-SR501. Make all as you show in your Video and I say WOW. It work all fine and perfect. Please get so on by making this good and useful Videos, BRAVO
I didn't get one thing... In real world I would be able to know when someone is entering in a room and when someone is going out from a room so that in this way I could count the number of people in the room and turn the light off if and only if there are 0 persons in the room, so I would need two sensors. Could someone explain me if I get something wrong?
#PIRowned #DHTowned Works separately, but together on the same D1 Mini, after a few minutes it stops reporting the values. Do you know what can be? PIR - 5v DHT - 3v Thanks and great videos
Thanks @KPeyanski , it was a power supply problem. I changed the AC/DC supply to 2A and the problem was solved. I already have 3 mounted and are all ok. Thanks for your help. Now I will start another project. Maby the esp32-cam. ;)
@@KPeyanski - so just a simple wall adapter to provide power through the micro-USB port, correct? Seems simple enough, and never have to worry about battery life.
I've just set this up but using a microwave sensor rather than PIR (but same config) and I can say it's as quick as Philips Hue sensor and the microwave sensor even worked through an internal brick wall! (The sensor I'm testing is this one: www.amazon.co.uk/gp/product/B07W5G6M1B/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1)
I made three of these. One stays detected all the time. One constantly flips back and forth between detected and clear. The other sort of works correctly but has about 3 false positives every couple hours. After some research it turns out the cheap knock off boards recommended in this video, coupled with these sensors which are known to be noisy, and this is a terrible idea of a project.
@@hellothere9167 unfortunately I gave up on them after 3 or 4 stoped working in a day. I'm going to use a premade motion sensor via zwave or some presence detector.
this is my log screen after programing wemos, and wemos is offline, pleas help. " wemoINFO Reading configuration /config/esphome/gl-8.yaml... INFO Starting log output from gl-8.local using esphome API WARNING Can't connect to ESPHome API for gl-8.local: Error resolving IP address: [Errno -2] Name or service not known INFO Trying to reconnect to gl-8.local in the background"
I have always had too manyfalse positives with these sensors for some reason. Got fed up actually, tried microwave sensors and ended up with the same problem
@@KPeyanski yeah, I do. But it was some other interference, it would just keep triggering randomly. I tried microwave sensors as well and had the same problem
@@MrBlackpanther87 I have many sensor boxes with motion, lightsensor, temp and humidity running ESPHome. I use the same 501 PIR for motion. I had lots of false positives in the beginning, when I used Tasmota. Now I am on ESPHome, and appart from one of the sensors occationally giving me false positives, the others are 100% stable. Note, I've connected PIR Vcc to D1mini 3.3V pin, not 5V.
It's been a while, so I don't remember if I tested with just Arduino code direclty and faced the same problem. But worth retrying just to see how it works now. I got frustrated and ended up switching to zigbee sensor which are more convenient since they are battery based but spent a lot more money then I would have wanted to offcourse
Hey Alex, I'm having hard time to understand that comment. Maybe because I shoot two videos in a row and my head is kind of autopilot right now. Can you please explain again :)
#PIROwned ...me...! :( I got a lot of interference from the PIR sensor and during the night (with no motion) i get constantily the trigger ON and OFF... so unusable....
Sorry to hear that it seems that is often a problem with this exact PIR sensor model. Try to shorten the cables from the PIR sensor to the D1 mini some ppl are saying that this help.
@@KPeyanski i soldered on top on my wemos mini like other commercial motions sensors do... but no luck... anyway your videos are amazing as always! thanks so much
I had interference problems too. I solved the problem by using longer wires to get the PIR away from the esp board, CAT 5 about 2 meters long. Other sensors can also be hooked up to the same board, such as temperature/humidity sensors.
@@KPeyanski i see i dont entirely remember this but i think i was asking where you were from because i haddnt heard your accent before, i hope you have a good day sir
What I like about these is that I don't have to worry about changing the batteries. I added some code in esphome to show the wifi signal strength and up time. It lets me know how my wifi network is preforming. Just add this to the yaml code and change the name to whatever you are using.
sensor:
- platform: wifi_signal
name: "PIR WiFi signal"
update_interval: 60s
- platform: uptime
name: "PIR uptime"
unit_of_measurement: "min."
filters:
multiply: 0.0166666667
Great tips 👏 thanks for that! Do you have any issues with false positives? If yes, how you deal with them? Thanks one more time for the useful comment.
@@KPeyanski I had false positives when I used short Dupont wires like you did. I switched to longer wires, over a meter, and moved the sensor away from the D1-mini and it fixed the problem. I used cat 5e and connected it using a wire wrap tool, but soldering would also work. The PIR sensors appear to have been designed for alarm systems where they would be away from other electronics.
Incredible tips. I will pin this. Thanks 🙏 Also feel free to join my Discord server. We need ppl like you there - invite.gg/kpeyanski
I've used Home Assistant for several years now and noticed the Esphome integration, but had no idea how easy it was to use. Just ordered 5 nodemcu and 5 motion sensors. Now I can have my lights come on as I ever l enter certain times. Can't wait to try them out.
Thanks for this great tutorial. 👍
Super walkthrough! So cool too.... that GRAY thumbs up symbol is a great "mouse click" sensor, turns blue on a click, simply amazing!!!
hahah glad you like both the video and the thumbs up automation :) What do you say It works flawlessly? 🤣
Definitely worked! Happy 1k!
Another great video. Is there an easy solution to turn these into battery powered devices?
Following...I'm sold if these can be battery powered!
I'm also interested in that question, but don't know the answer yet.
Agreed. Anyone have a batteried solution for this?
I also wanted to know as I want to build a floating pool temperature gauge and switch on every 2 hours and goes to sleep but I’m not good with electronics but I follow these videos easy
@@KPeyanski hurry up and find a solution 😂😂😂 love your videos
Great video! The real hang-up is packaging these DIY devices, especially for outdoor use.
It sure is! That is why I'm asking for help with 3d printer models if there is someone that wish to help. Thanks for the comment.
Tell me when can I order
Followed the on al the way through so excellent. Love your work
Welcome aboard of #PIRowners! And thanks for that comment :)
SUGGESTION..
Could you make a tutorial on building a cheap Wifi Door Sensor.? I'm sure using these D1 Mini boards and a cheap (Reed/Magnet) contact switch would be very useful to a bunch of people. Thanks in advance. 👍😊
Hi, I have my Home Assistant running on Synology NAS on virtual machine. Everything went ok until Install, where I got a message "No serial devices found". Validation went OK. I plugged in the sensor into USB of the NAS drive.
Any ideas what went wrong and how it can be installed? Thank you !!
I tried the blue thumb automation and it worked! 😂😂
I told you and it works every-time 🤣 Thanks!
It is possible do with zigbee ? it will be greate because it will use battery. Thanks!
Is there any way yo add a led light or led strip to turn on where motion is detected?
Excellent guide! Straightforward and to the point! Thanks!
Glad it helped!
I like your videos, very easy to understand, thanks
Glad to hear that! Enjoy!
Thanks for a great presentation!
My pleasure! Glad you enjoy it!
Excellent solution, cheap and effective! I looking for similar solution but working with zigbee instead of wifi. Do you know how to do it and can you please make a video explaining how to do it?
Thanks for the comment and for the suggestion. I will think about it.
Great video!!!. I made Two of this sensor but I have a lot of false event. Have you the same problem?
Yes, unfortunately false events are present. And this Is because of the sensor itself. There are some tricks that can be used to minimise them and I think we discussed them either here in the comments or in my written article.
Great instructions. Thank you.
Thanks for watching and commenting, Ron!
As usual , Great job :)
Thank you! Cheers!
nice, wish i knew how to add a flexible timer to switch the light off
You can do that with the automation, but it depends what exactly want to achieve.
@@KPeyanski when pir activate light, it stays on for xx mins, then switches off
@@ecoterrorist1402 fiddle with the 'time out' so it doesn't trigger the automation all wild like, then when triggered on add a "wait for time delay". in the same automation, send a command to turn lights off
#PIRowned the only issue is that the motion sensor must be attached to the Rasberry-pi/Laptop is there a way to use a battery to power it also the wireless option how it works ? thanks great video
Great, that you manage to make the PIR sensor ;) For sure there is a way to add a batteries, but I can't give you concrete directions, because I haven't done that yet and I don't want to give you false instructions.
4usd for the esp board and pir sensor, sure, but you still need to buy more stuff like usb cable and power adapter for each, case, wires. Tgis is more like a 20usd device once you finally assembled one.
You actually don't need a USB cable for power. Tons of ways to hook it up. For cases, there's 3D printing. Wires are super cheap if you're not using prototyping wires and buy rolls of the stuff. What he's showing here is how to get started. Use your imagination and get creative on what materials you can use to make dozens of them. I've been able to get mine down to about $1 a piece, not counting batteries (rechargable AA) which sure as heck beats off the shelf hardware, $15 to $30 a piece.
thanks for the tipp - using ikea trådfri motion sensor for €9 per piece but they suck
after motion was detected you will have 60 seconds until the device will take a new motion detection - so deadtimer
another questions: how do you power them? microusb is not available all the time where I need this sensors. any ideas?
are these kind of ESP modules also available for Zigbee? I love it since I didn't have any outages or issues with that protocol.
ESP8266 and ESP32 are Wi-Fi microcontrollers only. I power them with microUSB cable and any USB adapter (from phone or other device) Probably you can attach a battery, but I didn't tried this and I don't know which battery I can recommend.
Why did you use the d7 pin?
Thanks for the vid! Only downside to commercial solutions is the need for having it hooked up to a power source.
I don't have a socket close to every point where I use those.
Any way to make these battery powered? I guess that wifi will be eating to much power?
Sure there is a way to use batteries, but I can’t recommend you anything at the moment. Maybe I’ll make another video when I have more info.
Thanks for the great video, but I'm getting error in binary_sensor:
please help!!
INFO Reading configuration /config/esphome/esp-motion-sens-2.yaml...
Failed config
captive_portal: [source /config/esphome/esp-motion-sens-2.yaml:31]
[binary_sensor] is an invalid option for [captive_portal]. Please check the indentation.
Thank you. This worked beautifully. :)
You're welcome!
Anyone have a solution to solution? I'm very new to this but I got the sensor work but I'd love to be able to use batteries to power it.
Can you explain about the ESP Mesh feature? Is it something the can be used alongside ESPHome? Thanks
I'm not familiar with that sorry!
Thank you for the detailed video!
My pleasure!
#PIRowned Hi Kpeyanski, I took NMCUV3 ESP8266 and HC-SR501. Make all as you show in your Video and I say WOW. It work all fine and perfect. Please get so on by making this good and useful Videos, BRAVO
Welcome to the club! I'm very glad that I managed to help
Another great video Kiril! Thanks. I love how easy Esphome has become to use.
Yes, ESPHome become like native way to go after Nabu Casa acquired the ESPHome. Love it.
I clicked the thumbs up button twice and is didn't stay blue. :D
Haha only odd numbers are counted for this automation :)
Is it possible to add bot pir and a dht22 for example to one board?
Yes, sure!
Any thoughts on how to power via battery?
It is possible, but I haven't done any research on this yet so I can't tell any details.
I didn't get one thing... In real world I would be able to know when someone is entering in a room and when someone is going out from a room so that in this way I could count the number of people in the room and turn the light off if and only if there are 0 persons in the room, so I would need two sensors. Could someone explain me if I get something wrong?
Great!, any clues how to make a HTTPS home assistance?
Sure, here is a video tutorial of mine - ua-cam.com/video/jkBcGl7Vq8s/v-deo.html
Can i use this in other place but still appear in my HA? I use wled in my store via mqtt and can control fine from home
yes, you can use it wherever you wish as long as it have wi-fi coverage there.
Is there a was to link the activation to my cell phone to give an alert ?
Yes - ua-cam.com/video/JCjzEKdlezk/v-deo.html
Is a great video. Thx
Thank you as well for the good words! 👌
#PIRowned #DHTowned
Works separately, but together on the same D1 Mini, after a few minutes it stops reporting the values.
Do you know what can be?
PIR - 5v
DHT - 3v
Thanks and great videos
Congratulations on the efforts! Regarding your Q - I'm not sure I never tried that. Is it the same with power adapter?
Thanks @KPeyanski , it was a power supply problem. I changed the AC/DC supply to 2A and the problem was solved.
I already have 3 mounted and are all ok. Thanks for your help.
Now I will start another project. Maby the esp32-cam. ;)
Great video! Can you share your experience about battery life?
I'm not using battery for this, but an USB adapter
@@KPeyanski - so just a simple wall adapter to provide power through the micro-USB port, correct? Seems simple enough, and never have to worry about battery life.
#PIROwned with ESP Easy Mega, Domoticz and Wemos D1 Mini expansion boards
Great to hear! Very good job! Enjoy!
hi, is it possible to do this with rain sensor instead of PIR sensor?
Yes, check the esphome web page to find some examples.
Hey do you have the Philips Hue motion sensors? Do you find any drawbacks in reporting rate or speed between the DIY and Philips Hue ones?
No, I don't have PH motion sensor, but the speed of the DIY Motion sensor is pretty good.
I've just set this up but using a microwave sensor rather than PIR (but same config) and I can say it's as quick as Philips Hue sensor and the microwave sensor even worked through an internal brick wall! (The sensor I'm testing is this one: www.amazon.co.uk/gp/product/B07W5G6M1B/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1)
PIROwned ! The only problem is the false positive. so i'm sourcing for the AM312 PIR sensor for replacement.
Great to hear! Good luck with the other sensors and let us know the results afterwards!
so cool!
Glad you think so! Enjoy!
Dose this work with any esp8266
Most probably, yes! But not 100% sure here as I don't know all of the available esp8266 devices
I made three of these. One stays detected all the time. One constantly flips back and forth between detected and clear. The other sort of works correctly but has about 3 false positives every couple hours. After some research it turns out the cheap knock off boards recommended in this video, coupled with these sensors which are known to be noisy, and this is a terrible idea of a project.
Same I'm gonna attempt to make another tonight but I had 3 stop responding completely in one day
@@kyleawilliams91 how does it go, I'm trying to use this as a college project.
@@hellothere9167 unfortunately I gave up on them after 3 or 4 stoped working in a day. I'm going to use a premade motion sensor via zwave or some presence detector.
@@kyleawilliams91 dang, guess I'll just wing it then
I know from using reed sensors(magnetic) you can lower the sensitivity to reduce false positives, say has to be trivgered for 200ms before triggers...
this is my log screen after programing wemos, and wemos is offline, pleas help. " wemoINFO Reading configuration /config/esphome/gl-8.yaml...
INFO Starting log output from gl-8.local using esphome API
WARNING Can't connect to ESPHome API for gl-8.local: Error resolving IP address: [Errno -2] Name or service not known
INFO Trying to reconnect to gl-8.local in the background"
Sorry I don't know what could be the reason. Try to start from scratch and use my article instructions if it is easier for you
#PIRowned - working great!
Perfect! Thanks for sharing!
How is this powered when not connected to the USB?
USB adapter from an old phone or something.
You rock
Thanks, glad you like it!
if we can power de nodemcu with batterys will be very nice!
How to order
Use the links in the video description
#PIRowned
awesome tutorial and very useful
Glad to hear that! Congrats and enjoy! Good job 👍
What's the battery life?
no battery here it should be connected to a USB port or you have to use USB adapter
I have always had too manyfalse positives with these sensors for some reason. Got fed up actually, tried microwave sensors and ended up with the same problem
You can adjust the sensitivity with the yellow knobs but you probably already know that.
@@KPeyanski yeah, I do. But it was some other interference, it would just keep triggering randomly. I tried microwave sensors as well and had the same problem
@@MrBlackpanther87 I have many sensor boxes with motion, lightsensor, temp and humidity running ESPHome. I use the same 501 PIR for motion. I had lots of false positives in the beginning, when I used Tasmota. Now I am on ESPHome, and appart from one of the sensors occationally giving me false positives, the others are 100% stable. Note, I've connected PIR Vcc to D1mini 3.3V pin, not 5V.
@@ollyalme makes sense. I have used tasmota only. So might actually be a tasmota problem then.
It's been a while, so I don't remember if I tested with just Arduino code direclty and faced the same problem. But worth retrying just to see how it works now.
I got frustrated and ended up switching to zigbee sensor which are more convenient since they are battery based but spent a lot more money then I would have wanted to offcourse
I have them to still have to do it my kid Will do it they even sell mount for it
Hey Alex, I'm having hard time to understand that comment. Maybe because I shoot two videos in a row and my head is kind of autopilot right now. Can you please explain again :)
#PIROwned ...me...! :( I got a lot of interference from the PIR sensor and during the night (with no motion) i get constantily the trigger ON and OFF... so unusable....
Sorry to hear that it seems that is often a problem with this exact PIR sensor model. Try to shorten the cables from the PIR sensor to the D1 mini some ppl are saying that this help.
@@KPeyanski i soldered on top on my wemos mini like other commercial motions sensors do... but no luck... anyway your videos are amazing as always! thanks so much
Thanks and I hope to minimise the false positives to 0.
I had interference problems too. I solved the problem by using longer wires to get the PIR away from the esp board, CAT 5 about 2 meters long. Other sensors can also be hooked up to the same board, such as temperature/humidity sensors.
@@vegaswayne247 So you suggest longer and shielded?
but.. what about the false trigger?
if you have such you can try to play with the sensitivity knobs and/or the cables length
2:05 ha....... ha....... ha......
easy, right? :)
I didn't know Slavoj Zizek was into home automation xD
Who is this guy? And is this good or bad?
@@KPeyanski hes a socialist from slovakia if I remember it correctly. Hes got a similar accent. Id take it as a compliment.
Mine turned white and not blue 😂
Really, how come? What device/browser are you using? 🤪
@@KPeyanski Stock UA-cam app on Android ;)
I see, thanks for sharing :)
#PIRowned
Wow great! I really love that ❤️ Was it hard to implement?
@@KPeyanski I had it up and running within 10 minutes of receiving the sensor. Thanks for your help 😊
Very glad to hear that! Enjoy 😊
#PIROWNED
Great to heart that. Enjoy! Also, check my other DIY smart sensors videos that I have ;)
not to be offensive but, wtf is you from? i havent ever heard your accent. again i did not mean that in an offensive manner
I'm from Bulgaria. Not to be offensive, but "wtf is you from?" is a totally wrong written question!
@@KPeyanski i see i dont entirely remember this but i think i was asking where you were from because i haddnt heard your accent before, i hope you have a good day sir
#PIRowned
Wow great to hear that. Congrats :)