#46 Add PIR Motion Sensor in Tasmota and use it in Home Assistant | How to | vccground

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
some of my viewers had been requesting for a video on how to configure a PIR sensor in test motor and use it with home assistant so on their request in today's video we will discuss about PIR Sensors how to configure them in test motor and how to integrate and use them in home assistant so let's get started [Music] foreign passive infrared sensors commonly known as PIR sensors are electronic sensors that measure infrared light radiating from objects in their field of view and are basically used in motion sensing applications they are available in many shapes and models but all of them work on the same principle to sense the movement in front of them all these modules are having three pins to connect them to other devices and they are VCC ground and the signal out pin connect the sensor as shown here the VCC pin connects to 3.3 volt and the ground pin connects to the ground of the circuit the signal out pin connects to any free gpio pin on the microcontroller these sensors can also be used directly without a microcontroller on detecting motion the signal out pin goes high for a preset time and then go low again when no motion is detected so basically PIR sensors output can only have two states either high or low alternatively we can say that PIR sensors act as a switch that can have only two states high or low so because it works similar to a switch it is configured as a switch in test mode also let's now configure a relay and a PIR sensor in test motor on my wemos D1 mini I have connected PIR sensor to pin D5 so configure this pin as a switch and my low level trigger relay module is connected to pin D6 so configure this pin as a relay now save the configuration and on the dashboard now we have a toggle switch and the current state of the relay and here when you move your hand in front of the sensor it will turn on the relay for a short time and then turn it off again this is because in test motor by default all switches are attached to their corresponding relays hence switch 1 which is our PIR sensor is controlling relay one and similarly switch 2 will control relay 2 and so on but if you don't want your PIR sensor to control the relay directly and instead want to Define its Trigger action from home assistant simply open console and type command set option or so in short 114 Space 1 and press enter this command will detach all switches from relays to Define switch 1 which is our PIR sensor as a binary sensor type command switch mode 1 space 15. now to send a mqtt message to home assistant we first need to give unique name to this device and its individual entities now configure your home assistant mqtt connection details here and that's it your test motor part is done let's now integrate it in home assistant go to settings devices and services tasmota and here you will find your PIR sensor click it and you will find relay one in control section and the switch one in sensor section click switch 1 settings and here give it a name let's call it office motion click the third row labeled show as and select Motion in the drop down list and click update and now your switch one has automatically been transformed into office motion sensor with straight clear or detected move your hand to test it great isn't it click add to dashboard and it will be shown on the dashboard automatically and now you can use this sensor to trigger any Automation in home assistant please note that I have added a relay with this sensor just for demonstration purpose if you don't require the relay you can simply configure your PIR sensor as a switch in test motor and it will still work absolutely fine hope I'm able to explain it in an easy way if yes please let me know by hitting the like button below consider supporting this channel by subscribing it if you haven't already so that's all for today we'll meet in the next video soon till then goodbye friends [Music]
Info
Channel: vccground
Views: 8,276
Rating: undefined out of 5
Keywords:
Id: _OUg7yUehVc
Channel Id: undefined
Length: 6min 16sec (376 seconds)
Published: Sat Oct 29 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.