YouTube doesn't want you know this subscribers secret
Get Free YouTube Subscribers, Views and Likes

Cheap DIY Motion Sensor that works with ESPHome u0026 Home Assistant

Follow
KPeyanski

Wemos D1 Mini (AliExpress affiliate) https://s.click.aliexpress.com/e/_AFgAIp'>https://s.click.aliexpress.com/e/_AFgAIp
5 Pack Hcsr501 Pir Motion Ir (AliExpress affiliate) https://s.click.aliexpress.com/e/_Atijaj'>https://s.click.aliexpress.com/e/_Atijaj
Passive Infrared Sensors or #PIR sensors for short or just Motion Sensor are completely supported by #HomeAssistant and ESPHome. I have a question for you why to buy an expensive motion sensor when you can #DIY for cheap. In this video I will show you what parts you will need, how to install ESPHome, how to add the motion sensor to Home Assistant and how to make automations.

Using smart motion sensors on strategic places at your home is one of the quick wins when you are turning your home into a smart home. Of course you can use out of the box motion sensors like Shelly Motion or other similar, but they are not coming cheap, especially if you have to buy a lot of them. That is why we are going to create one that will cost around 4 US dollars and it will take only few minutes of your time to make it. I will show you everything step by step and at the end we will see a real demo with Home Assistant automation.

Let’s see how.

► TIME TABLE
00:00 Intro
01:38 What is needed for the DIY Motion Sensor?
03:04 How to connect the D1 Mini to PIR sensor?
03:34 Install ESPHome as Home Assistant addon
05:00 Editing the ESPHome configuration
06:59 Install ESPHome on D1 Mini
07:55 Add the DIY Motion sensor to Home Assistant
09:02 How to make Home Assistant automation with the DIY Motion Sensor?
10:38 Outro

► MY WRITTEN ARTICLE https://peyanski.com/cheapdiymotion...

► MY GUIDE ON SALE
Smart Home Getting Started Smart Home Guide v2.0 https://peyanski.com/product/smartho...

► SUPPORT MY WORK
Patreon –   / kpeyanski  
Paypal – https://www.paypal.me/kpeyanski
Bitcoin – 1GnUtPEXaeCUVWdJxCfDaKkvcwf247akva
Revolut https://revolut.me/kiriltk3x

► COME AND SAY “HI” on:
My Discord server: https://invite.gg/kpeyanski
My Twitter:   / kpeyanski  

► AFFILIATE LINKS
Wemos D1 Mini https://s.click.aliexpress.com/e/_AFgAIp'>https://s.click.aliexpress.com/e/_AFgAIp
5 Pack Hcsr501 Pir Motion Ir Sensor Body Module Infrared https://s.click.aliexpress.com/e/_Atijaj'>https://s.click.aliexpress.com/e/_Atijaj
jumper (Dupont) wires https://s.click.aliexpress.com/e/_A3YiR3
USB to microUSB Cable https://s.click.aliexpress.com/e/_9QW1Wv
USB Plug Adapter 1A https://s.click.aliexpress.com/e/_9xdSIH
NodeMCU32 ESP32 wifi+Bluetooth (ESP32) https://s.click.aliexpress.com/e/_AVGyc1
NodeMCU V3 (ESP8266) (AliExpress affiliate link) https://s.click.aliexpress.com/e/_AArg2V
Ubiquiti UniFi Dream Machine (UDM) https://amzn.to/34B0FQK
Raspberry Pi 4 4GB Starter Kit with 32GB Micro SD Card https://amzn.to/3qaI5qN
Raspberry Pi Zero W kit 2 https://s.click.aliexpress.com/e/_A47KBK
Raspberry Pi Zero W Official Starter Kit (Amazon Affiliate link) https://amzn.to/3ndcX87
Tech that I’m using right now https://www.amazon.com/shop/kpeyanski
Get $100 in credit over 60 days for DigitalOcean https://m.do.co/c/6dd2caef1f1f

► CRYPTO AFFILIATE LINKS
Sign up for Crypto.com and we both get $25 USD (Referral code: xn86atnceg) https://crypto.com/app/xn86atnceg
Coinbase Get $10 in Bitcoin when you buy or sell $100 or more https://www.coinbase.com/join/peyans_4
Binance One of the biggest Crypto currency exchange https://www.binance.com/en/register?r...

► ESPHome configuration
esphome:
name: pirsensor1
platform: ESP8266
board: d1_mini

Enable logging
logger:

Enable Home Assistant API
api:

ota:
password: “512345rt234gwef”

wifi:
ssid: "A IoT"
password: “SmashTheLike”

Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "PirSensor1 Fallback Hotspot"
password: “somepass”

captive_portal:

binary_sensor:
platform: gpio
pin: 13
name: "PIR Sensor"
device_class: motion

► HOME ASSISTANT MOTION SENSOR AUTOMATION
automations.yaml entry
alias: When PIR motion sensor is activated
description: ''
trigger:
platform: state
entity_id: binary_sensor.pir_sensor
to: 'on'
condition: []
action:
service: light.turn_on
target:
entity_id: light.shellybulbduo_8caab5616d5c
mode: single

► USEFUL LINKS
PIR Sensor 3D printed cases https://www.yeggi.com/q/hc+sr501/
ESPHome PIR Sensor page https://esphome.io/cookbook/pir.html

✅ Don't Forget to like comment ✍ and subscribe to my channel!

► DISCLAIMER
Some of the links above are affiliate links, where I earn a small commission if you click on the link and purchase an item. You are not obligated to do so, but it does help fund these videos in hopes of bringing value to you!

posted by Kreissaal21