-->
Page 1 of 1

PIR to switch in light +MQTT

PostPosted: Wed Nov 07, 2018 3:35 am
by atux_null
Hi. Kinda new to ESP8266 and the whole IOT world. I would like some project guidance and help with the code. I would like to monitor the backyard or my cottage house. It does not have street lights and it is easy for someone to do its work, as it is pitch black in that part of the street.

i am thinking to get a PIR sensor and a 5v relay. Any movement detected by the PIR sensor it will send command to relay to switch ON for xsecs. Also it will publish an event to my MQTT broker. The light switching ON is for 2 reasons. 1. to "scare" the intruders, 2. to help my camera pickup the image.
That is in the night.
In the morning i would like to do the MQTT publish only, just to save energy.
I have an ESP8266 nodemcu.

May i have your suggestions please?