$5 DIY Wireless MQTT Smart Home Window Sensors

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ค. 2024
  • Bare Reed Switches: amzn.to/2qJ7Wcg
    ESP-01 Microcontrollers: amzn.to/2HJ8xTo
    CR2032 Batteries: amzn.to/2JWVgY1
    Resistors: amzn.to/2J67k8c
    Soldering Iron: amzn.to/2JUP3Mm
    USB to TTL Adapter: amzn.to/2Hak9BW
    3d Printer: amzn.to/2vqMpuz
    Bucky Ball Magnets: amzn.to/2vqMBdh
    *As an Amazon Associate I earn a % of qualifying purchases at no cost to you.*
    Arduino code on github: github.com/thehookup/MQTT_Win...
    STL Files:
    Main Case: github.com/thehookup/MQTT_Win...
    Case Cover: github.com/thehookup/MQTT_Win...
    Magnet Holder: github.com/thehookup/MQTT_Win...
    Support my channel:
    Patreon: / thehookup
    Tesla Refferal Code: www.tesla.com/referral/robert...
    Music by BenSound.com
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 276

  • @harrison298
    @harrison298 5 ปีที่แล้ว +7

    I just discovered your channel when researching the SONOFF basic, and I love it. Your videos actually make these projects feel achievable for mere mortals like myself. Thanks!

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Glad to hear it, if you need help with a project just leave a comment and I'll see it.

  • @DriftwoodME
    @DriftwoodME 4 ปีที่แล้ว +14

    I’m got a Wyze bridge hooked up to my pi, then I use the custom integration to bring the Wyze sense into HA. With this I can get their motion sensors for $6 each, and their door and window sensors for $5. And their batteries last a year. Mine have been working great so far and update instantly in HA

  • @squalazzo
    @squalazzo 6 ปีที่แล้ว +3

    oh, great, an other brand new channel with very interesting tutorials! Thanks :D

  • @cornstarch28
    @cornstarch28 6 ปีที่แล้ว

    Great write up and lots of detail. Thanks for the great ideas!

  • @kennethbell4681
    @kennethbell4681 3 ปีที่แล้ว

    Thank you for making this! I was looking for a cheap window sensor and it looks like I just found one!

  • @MrGramcs
    @MrGramcs 6 ปีที่แล้ว +1

    Great videos please keep them coming, but I've got to say I love my Xiaomi sensors & switches running in Home Assistant but great to see an alternative.

  • @ericolson9695
    @ericolson9695 4 ปีที่แล้ว

    I think this project is brilliant: outside-of-the-box thinking! Very clever.

  • @russzaccari7761
    @russzaccari7761 2 ปีที่แล้ว +1

    @the hook up I sure wish you'd do a remake on this with a USB C or USB Micro jack for powering. I found this video looking for MQTT sensors to put in refrig & freezer doors. Since I'm doing a powered device with an outlet behind it, I don't really want to replace batteries ever :) Thanks for the video!

  • @MrBobWareham
    @MrBobWareham 5 ปีที่แล้ว

    Would love to build one but want to do my front door and that would mean at least two times a day so if I changed the battery to a rechargeable battery would it last longer for a front door? Thanks for the video and project Bob-in the UK

  • @demps7765
    @demps7765 5 ปีที่แล้ว +3

    What are the chances of getting a dozen of those window sensor cases/cover/magnet holders?

  • @johnfrankforther8162
    @johnfrankforther8162 5 ปีที่แล้ว

    Looks like a great article. What about how to set up MQTT software to communicate with the boards?

  • @yawarsaeed6499
    @yawarsaeed6499 5 ปีที่แล้ว

    Thanks for the prompt response.
    What I meant was that is it possible to get the sensor status notification when there is no internet access or connectivity.
    Waiting for your reply.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Only if you have a local mqtt broker like a raspberry pi with mosquito and home assistant.

  • @nicholasrefalo7744
    @nicholasrefalo7744 4 ปีที่แล้ว +2

    Excellent solution Rob I've replicated this in my lab and it works great. Is there a way to adjust the code to stop the chip returning to the default state of closed? I want to use this on some windows which stay open for an hour or two and with the state returning back to close within 50seconds I don't know if my window is still open at the end of the day. I know this will drain the battery faster but I'm okay with that.

  • @johnjacobjinglehimerschmid3555
    @johnjacobjinglehimerschmid3555 5 ปีที่แล้ว +4

    Sweet this looks easy to do .....

  • @TecSanento
    @TecSanento 3 ปีที่แล้ว

    You could use the normally closed leed part of the reed switch to determine if the esp should shutdown or not

  • @gokul5693
    @gokul5693 5 ปีที่แล้ว +1

    Dude this is cool stuff ....Keep it up...well described Tutorial...Thanks for sharing..

  • @guatagel2454
    @guatagel2454 5 ปีที่แล้ว

    Simple. Thank you!

  • @romwil
    @romwil 5 หลายเดือนก่อน

    It’s a great solution for something that should never be moved or opened. A great way to also make a lock with included alarm if you don’t correctly disable it by moving the magnet with the sensor. Very neat project to build on due to the power disabled normal state. Or have an always ready to go ‘wipe it all’ kill switch handy to purge drives.

  • @starshipduck
    @starshipduck 5 ปีที่แล้ว

    Hi nice video! So I’m trying to follow your code but I’m not sure what is going on in the reconnect loop and why you set boot to true on the beginning as well as why you have certain if statements checking if boot equals true when it will be true in the beginning from the get. It would be good if you could add comments on why you are doing it this way. Also why is the while loop checking if client is NOT connected “!client.connected()”

  • @kabturek
    @kabturek 6 ปีที่แล้ว +27

    You should use a static ip address for your esp - it should lower the time to connect to 2s or less

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว +10

      SornDP suggested that below. That's in my weekend plans.

    • @ahmedalshamsi1723
      @ahmedalshamsi1723 4 ปีที่แล้ว

      @@TheHookUp I am facing a problem with knowing what to choose on node-red can you help me with making a tutorial and not depending on other channels vids this is a suggestion that will help you increase the quality of your channel.

    • @ddee2501
      @ddee2501 4 ปีที่แล้ว +1

      @@ahmedalshamsi1723 MQTT IN node connected to DEBUG node. Then configure MQTT IN node to your topic in code (PICK_UNIQUE_WINDOW_TOPIC)

    • @ahmedalshamsi1723
      @ahmedalshamsi1723 4 ปีที่แล้ว

      D DEE hey thanks for the reply

    • @ahmedalshamsi1723
      @ahmedalshamsi1723 4 ปีที่แล้ว

      @D DEE what about flashing the firmware first to the esp8266 0-1 and then flashing the sketch. Cause whenever i try to compile a sketch it does not work, even flashing the firmware to the esp8266. I bought ftdi, usb to ttl and usb to esp8266, i worked first with @The Hook Up way using the ftdi but did not work. Then used usb to esp8266 wired the pins from the back of the usb to allow it to compile a sketch to the esp but did not work so as the usb to ttl. And know i bought an arduino but waiting for the jumper wires to hook em up. IN BRIEF HOW SHOULD I CONNECT THE ESP8266 0-1, THEN IF THE CONNECTION WORKED TO FLASH THE ESP FIRMWARE USING THE FLASHER AND FINALLY WILL IT WORK TO COMPILE A SKETCH.

  • @jayare7750
    @jayare7750 5 ปีที่แล้ว

    Is there a way (being powered by a wall adapter) to make a door sensor that can send open triggers, closed triggers and get current status of the reed switch with an ESP-01?

  • @simon77809
    @simon77809 5 ปีที่แล้ว +4

    I've been watching your videos on node red, thanks by the way, and whilst I agree this is an interesting project, I would suggest you look at the CC2351 devices and Zigbee2mqtt software, so far I have bought aqara sensors Windows latch, temp/humidity and a double pole switch. All work brilliantly with MQTT, Home assistant and node red. And NO aqara xiaomi hub required, I also control my idea tradfris with this too no messing with upgrading them or linking to hue.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว +2

      Yep, it's a pretty good option these days. I believe this video predates zigbee2mqtt by 6 months or so.

  • @gileansolomonsz6931
    @gileansolomonsz6931 3 ปีที่แล้ว

    Hi Mate, awesome video and great to be on the hook up. Totally new to the entire home automation and only got hooked onto it during lock down so bare with me. I followed this video ordered the parts and got them last week. have made the window sensor and it works as expected and I installed a mqtt snooper app and i can read the open close messages. My issue is how do i now add it to my home assistant like you had on your video where it monitors all the windows

    • @hbosch5223
      @hbosch5223 3 ปีที่แล้ว

      Go to the HA forum and you should be able to find your answer with step by step mqtt setup.

  • @martinsmith5419
    @martinsmith5419 3 ปีที่แล้ว

    I am relatively new into smart home tech, could this be modified to be used with a battery-powered doorbell as the switch instead? Thanks for your help!

  • @ItianNerona
    @ItianNerona 4 ปีที่แล้ว +1

    I really enjoyed this video. I am trying to create something out of an ESP-01. Is there a way to contact you?

  • @mkrice2
    @mkrice2 6 ปีที่แล้ว

    Great video. Just what I wanted. You made it look easy. No I have to go to work!!!!

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว

      make sure you check out the updated version: th-cam.com/video/2kLZ7DlP9KU/w-d-xo.html

  • @stupossibleify
    @stupossibleify 3 ปีที่แล้ว

    I was about to ask about how you got the ESP8266 to deep sleep and then... GENIUS!

  • @Micahberger1
    @Micahberger1 3 ปีที่แล้ว

    I really appriciate your explaination. Great project.

  • @testchannel1834
    @testchannel1834 4 ปีที่แล้ว

    Hi can you make a video with this hardware for a mailbox door open closed notifications system with 3 cr2032 in parallel

  • @bamc3835
    @bamc3835 3 ปีที่แล้ว

    what if i don't want to do a diy window sensor? can you please make a video about different security system window sensors that won't easily be tripped by somebody who is just a regular guy (for example, somebody can just peel off the simplisafe door and window sensor and come back later and reglue it back on like it didn't happen)...pls feature both wired and wireless versions...also would you have a video on a good setup for whole house security system setup for a new build - really need that right now...thanks and love your channel; just wish i am more of a techy diy type

  • @joemasterson8860
    @joemasterson8860 3 ปีที่แล้ว

    How long do your batteries last? Thinking of putting this setup on my garage freezer to alert me when it doesn't close all the way.

  • @msmadaram
    @msmadaram 4 ปีที่แล้ว

    have you ever work on android broker such as moquette or something like that ?

  • @Stony5438
    @Stony5438 6 ปีที่แล้ว

    interesting idea. Could you do a project showing how to hook your projects up hardwired? Or at least to a hardwired power source?

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว

      I use NodeMCUs for all of my hardwired stuff, but yes, one of the next videos will be using a hardwired microcontroller.

    • @willhutcheon4144
      @willhutcheon4144 5 ปีที่แล้ว

      The hardwiring isn't that bad. Making it look good an concealing the wires - that is the trick. Some people have old (disabled)) security systems and those wires running to normal contacts. You could convert those (leave the normal contact if it is working) and "remotely" locate at the other end of the wiring, giving clean, easy access to power/wiring. In this scenario, 1 NodeMCU or D1 Mini or ESP32 could likely monitor all of your windows/doors as desired. Now that would be awesome! -- Another idea is to use a "cell phone powerbank" get one that looks good, and just wire it nearby. It would last a long time, and easily change standard AA batteries (or recharge the bank). It all depends on esthetics/look and feel. it might be a good way to "test" and start by installing contacts, then worry about concealment after 1 month and deciding it's working well for you. Just a thought.

  • @whatevah666
    @whatevah666 5 ปีที่แล้ว +1

    Hmm, the battery limitations is a bummer, any cheap/sane way of hardwiring it to a powersupply of some kind? I'm about to remodel the house sso putting stuff into the walls does not bother the the least, perhaps something over PoE would work in this case? I have a few of those switches.

    • @Wrenchmonkey1
      @Wrenchmonkey1 5 ปีที่แล้ว

      Just run low voltage wiring, and run it off a DC transformer. New construction is easy to wire up for stuff like this. Existing homes are a bit more difficult, hence the need for wireless...

  • @adambaker5854
    @adambaker5854 5 ปีที่แล้ว +1

    Rob, thanks again for all your awesome work. Two questions:
    1. The Amazon link for the buckyball magnets goes to 2.5mm magnets, but the holes in the magnet holder's .stl file sure looks to be near 5mm. What size magnets is the .stl file designed for?
    2. Have you ever thought about integrating a simple database into your Node Red flow, so that rather than have a "default" state, every time the sensor's state changes, it pushes the most recent state to a database, and THAT's the value that is displayed in a dashboard? That way, you know whether your window is actually open or closed...
    Thanks again!

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว +1

      The problem is the device never knows when it is closed. It wakes when it goes from closed to opened, sends a message, then goes into deep sleep. Closing the window cuts all power to the device so it can't send a closed message.

    • @adambaker5854
      @adambaker5854 5 ปีที่แล้ว +1

      Thanks for your answer...that makes sense. How about the buckyball size?

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว +2

      @@adambaker5854 ​ You are correct about that, mine are 5mm. For some reason I assumed the 2.5mm was a radius, but it appears that is the diameter. This is the correct size: amzn.to/2UG8u4K

  • @myounges
    @myounges 5 ปีที่แล้ว +2

    Nice video! Another solution are those RF Reed switches on AliExpress and use a sonoff RF bridge to listen for the rf signals and forward them via mqtt to nodered or HA. I used this setup batteries last year's on doors i open and close every day. And the cost is similar. The sonoff bridge was 8 euros i think. I use espurna firmware on the rf bridge. Hope it helps

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว +1

      Yeah, DrZzs has a good video on the RF bridge with tasmota too. I ordered one to try it out but it was DoA and I haven't gotten another one yet.

    • @myounges
      @myounges 5 ปีที่แล้ว

      Using this RF bridge this gives you lots of things you can interact with. Smoke detectors, leak sensors, rf relays, garage doors, pir, alarm sirens, etc. I personally like espurna over tasmota just because it has a nicer gui but the functionalities are similar.

  • @berczidavid2813
    @berczidavid2813 3 ปีที่แล้ว

    Best youtuber/teacher in the world!!!

  • @koenzele9579
    @koenzele9579 4 ปีที่แล้ว

    I would like to see an update of this video with ESP NOW, very easy and less energy consuming.

    • @TheHookUp
      @TheHookUp  4 ปีที่แล้ว

      The issue with ESP NOW is you also need a always on ESP8266 as the receiver (hub). I've played around with it but ended up sticking with the initial design. About a month ago I opened up all the windows to make sure they were still kicking, all messages came through as expected.

  • @aaaafaaaaf
    @aaaafaaaaf 6 ปีที่แล้ว

    Do you have the Arduino connection parameters for the esp1. thanks.

  • @JohnVanderbeck
    @JohnVanderbeck ปีที่แล้ว

    I know this is an old video but I'd love to some someone like you dig into making DIY devices for Thread. I've been doing a lot of digging and slowly learning but looking at building something like these window sensors that work with Homekit using Thread.

    • @TheHookUp
      @TheHookUp  ปีที่แล้ว

      Thread is going to be replaced by, or rather is going to become Matter. At this point there's no reason to make a purely thread device. I actually just ordered a matter dev board and will be doing a video on it.

    • @JohnVanderbeck
      @JohnVanderbeck ปีที่แล้ว +1

      @@TheHookUp My understanding is Matter is an application layer that will use Thread as a preferred transport protocol which is why I said Thread but yes Matter is the end goal here :)

    • @TheHookUp
      @TheHookUp  ปีที่แล้ว

      @@JohnVanderbeck Your understanding is correct :)

  • @PhG1961
    @PhG1961 6 ปีที่แล้ว

    Very cool video ! Thnxs for sharing !

  • @SornDP
    @SornDP 6 ปีที่แล้ว +3

    Very cool, I will be trying this for myself. I believe part of the 4 sec response time could be shortened by using static IPs rather than DHCP assigned ones. Is is possible to test that?

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว +2

      Gonna try that out this weekend.

    • @shaunwhiteley3544
      @shaunwhiteley3544 6 ปีที่แล้ว +2

      The Hook Up, hi, did you try this? Any time improvement? I wanted to go all static ip for all my nodes but my router has a hard limit of 30 static addresses. Have you tried the Hassio dhcp addon? I need to check if that has a limit or other limitations? I’m saving this tutorial for when I manage to fix my 3D printer, I’ve messed all the settings up flashing the firmware, doh! Cheers

    • @lmaoroflcopter
      @lmaoroflcopter 5 ปีที่แล้ว

      @@shaunwhiteley3544 your router shouldn't limit anything. Instead of using static DHCP leases, just configure your DHCP pool to be smaller than the full subnet and allocate IPs yourself in the esp01 code.

  • @TheBauwssss
    @TheBauwssss 5 ปีที่แล้ว

    I would love to buy one but I think i'll modify it to use two or 3 AAA cells, since I open my windows a lot. I have not done the math but that should give it a LOT more opens.

  • @deez-nutskroll7223
    @deez-nutskroll7223 2 ปีที่แล้ว

    I love these and have them in all my window’s but I’m not sure how to get it in home assistant. I did get it to notify me when a window is open with node red. But I know there’s a way of seeing them in Lovelace. Could you help me. Thanks

  • @pjrt_tv
    @pjrt_tv 3 ปีที่แล้ว

    yeah, this kind of sensors make more sense in a normally-closed window environment (like Florida). But I'm in NY, and opening windows throughout the year is necessary. :(

  • @danielmosquera3512
    @danielmosquera3512 4 ปีที่แล้ว

    Hi, i have a question... will the device create an entity automatically in hassio? i'm using mosquitto broker and in node-red i see the "close" and "open" message but i do not know how to integrate it to hassio lovelace as a window
    im trying this in my file sensors.yaml
    - platform: mqtt
    name: "window1"
    state_topic: "test/window1"
    but nothing. could you help me? thanks

  • @rafac13
    @rafac13 5 ปีที่แล้ว

    Great video!

  • @ddee2501
    @ddee2501 4 ปีที่แล้ว +4

    As an electrician, i always suggest clients put in more wiring during building stage !!

  • @mrq3969
    @mrq3969 4 ปีที่แล้ว

    I do all the above steps perfectly. Wifi connected. But what about node-red configuration? please help me. How can the home assistant add it?

  • @garethsmith7628
    @garethsmith7628 3 ปีที่แล้ว

    reed switches don't like switching much current at all, usually they are used in conjunction with a snubber circuit.

  • @hbosch5223
    @hbosch5223 3 ปีที่แล้ว

    Is there a way to incorporate a delay in the reed switch action ? I want to create a wifi button from this, but I don't want to press the button and hold it while it boots and sends a message. Would this be some mosfet thing ? I've been using WyzeSense for a button with HA, but these sensors all full stop unreliable. I have 5 dead ones already. The amount of labor I've spent with debugging the WyzeSense problem could have paid for a hardwire of my house. Thanks

  • @DB-nl9xw
    @DB-nl9xw 5 ปีที่แล้ว

    Please review zigwee sensor or wifi door sensor

  • @Freestila
    @Freestila 4 ปีที่แล้ว

    Use a sonoff rf bridge and standard rf window sensors. Sensors are around 5$ but use AA /AAA batteries and will work way longer. Also they have real open / close messages and sometimes anti tamper contact or battery low message

    • @JimBell20
      @JimBell20 4 ปีที่แล้ว

      Ditto. I have 5 rf windows sensors with the sonoff rf bridge. Works great. Dr ZZs has a video on using these sensors with the bridge and where to get them cheap.

  • @Zeric1
    @Zeric1 5 ปีที่แล้ว

    Cool idea of just using the reed switch to turn on the device. As others have pointed out battery life could be a concern on windows that are left open. I think the bigger thing for people to consider is the value of any security system if the intent is to catch a potential burgler, although it may be deterrent, especially cameras. The reality is burglaries only last at most 10 minutes, not enough time for a central monitoring company to verify with the owner that it's not a false alarm, call the authorities, and for the authorities to respond on site. My house was burglarized during the great recession, it was very obvious that they were only inside 5 minutes at the most, certainly not enough time for any alarm to do much. At the time I had two medium sized dogs, and an alarm sign prominently posted outside...neither, dogs, nor the fact I had an alarm system made any difference (the alarm system wasn't functional, but they didn't know that). Some rooms they didn't go into at all. I don't have any valuable jewelry or significant cash to speak of. They did take a cheap netbook and $40 sitting on the dresser. I was just glad they didn't injure my dogs. I now have hardwired security cameras that cover the full exterior of my house. I think that is a better deterrent. If one's intent is just to be reminded that a door or window has been left open, then sensors work well.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว +1

      Also a loud siren is good for making sure they don't stick around for long.

  • @rottison
    @rottison 6 ปีที่แล้ว

    hi just got all the parts to make my first 10 units I was concerned about how small the magnets are. Do you use just one in each of the 3 holes? and to fasten them in I got a tube of super glue to put just a small amount in the hole then drop the ball in

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว

      Yep, just one in each. you can put them next to the reed switch and hear them doing their thing. You'll hear a faint "click" when it disengages the circuit. Good luck! make sure you post a reply on how your build went.

    • @Conservator.
      @Conservator. 5 ปีที่แล้ว

      The Hook Up
      Still no reply from Dale L. Makes one wonder, might he accidentally have glued his fingers to the window?

  • @mumbles1justin
    @mumbles1justin 4 ปีที่แล้ว

    I like the the idea and may make a few myself for use on cabinets. But aren’t all your windows susceptible to deauth attacks?

    • @TheHookUp
      @TheHookUp  4 ปีที่แล้ว +1

      Probably not. Deauth only works on currently connected devices, but they would be vulnerable to ssid spoofing.

  • @boviac
    @boviac 5 ปีที่แล้ว

    Love your detail and DIY sharing attitude! However, now WYSE Sense Door/window sensors 4 for $20.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Yep, they're pretty cool. Proprietary protocol, but still cool.

  • @JH_Tech49
    @JH_Tech49 5 ปีที่แล้ว +1

    nice project and nice video, but it would be better if more instructions on how to integrate it in Home assistant were provided. I am still a newbie :)

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      If you use the updated code from this video: th-cam.com/video/2kLZ7DlP9KU/w-d-xo.html
      You will just add a sensor for each window like this:
      sensor:
      - platform: mqtt
      name: "Dining Room Window"
      state_topic: "windowStatus/diningRoom"

  • @yawarsaeed6499
    @yawarsaeed6499 5 ปีที่แล้ว

    Awesome Project.
    Sir , can you confirm , do I still need to set up local mqtt broker on Raspberry pi to use this sensor.
    Please reply.
    Thanks

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Doesn't need to be local, you could use cloud mqtt if you wanted to.

    • @Zeric1
      @Zeric1 5 ปีที่แล้ว

      running a local MQTT server is more reliable and you have full control of who sees your data. If you were setting up MQTT devices for the first time, you could start with cloud mqtt for proof of concept, but would definitely move over to a local server. I started off directly with a local mosquito mqtt broker on a RPi a couple of years ago, it wasn't hard to setup...there are lots of "how to" sites and videos online.

  • @StripesOO7
    @StripesOO7 2 ปีที่แล้ว +2

    Imagine opening your windows less than 20 times in 6 years 🤯

  • @madzur
    @madzur 5 ปีที่แล้ว

    Hello there and props for the very cool idea. I tried to follow your instructions, however it seems something is not right. I can get the Arduino IDE to program my ESP-01 with the supplied sketch, I even uncommented the few lines in your "static IP" sketch, however I don't see the ESP come online in my router's web interface and I also don't see any responses when connected to the ESP using a serial interface through Termite. Any tips on how to debug what is going on here, please?

    • @madzur
      @madzur 5 ปีที่แล้ว

      hey @thehookup, any tips, please? I tried different ESP01 chips (I have 3) and none of them seems to work. When I connect and disconnect them from the serial adapter some garbled text shows up in Termine, otherwise not even a single character. I’m pretty sure it's something simple, and being a noob, I can't figure it out..

    • @Wrenchmonkey1
      @Wrenchmonkey1 5 ปีที่แล้ว

      @@madzur
      Triple check your SSID and password. If your SSID has spaces or special characters, try changing that?

  • @user-zr7kz4vs7c
    @user-zr7kz4vs7c 3 ปีที่แล้ว

    Any cheap android tablet that you recommend for running Home assistant dashboard kiosk mode?

  • @TecSanento
    @TecSanento 3 ปีที่แล้ว

    You could use the mac Adress for the unique Adress

  • @klincecum
    @klincecum 5 ปีที่แล้ว

    It would make it a little bigger, but if you add two relays, you could have it completely unpowered, latch the power on relay, send the messages you want, and then have the 2nd relay break the power connection and turn it completely off again. No deep sleep required. May not be for this particular project but maybe give someone some ideas. Thx for the video, it inspired some other projects.

    • @Wrenchmonkey1
      @Wrenchmonkey1 5 ปีที่แล้ว

      The current a relay would draw would likely be more than the sleep function draws.
      Bottom line is, it's probably not the best option for windows that are opened frequently.

  • @generonnebaum1989
    @generonnebaum1989 3 ปีที่แล้ว

    Nice Video, I learned much. I hooked this up and started the debug program in Node-Red. I noticed though when I run the script code that it says "open" when I apply power to it on node-red. Then after approximately 23 seconds, it says "closed". I use mosquitto broker. The mosquitto says that it exceeded timeout and disconnected when I look at it even when I still have power on it. Is there a problem with the code. I can't seem to keep the ESP8266 alive. I have tryed two different ESP8266 modules and I am using a standalone power supply for 3.3V.

    • @TheHookUp
      @TheHookUp  3 ปีที่แล้ว +1

      That’s what the program does. That is working as intended, this is not meant for windows that you will leave open.

    • @Xalies
      @Xalies 3 ปีที่แล้ว +1

      if you still want one that stays open you need to keep the connection alive... heres one I have here pastebin.com/t5jiEwTS it only sends the open message on boot and sends "0" to another topic on loop and a closed when you disconnect

  • @oblongx
    @oblongx 6 ปีที่แล้ว

    very cool design

  • @davidwalker575
    @davidwalker575 3 ปีที่แล้ว

    Hey, love your channel. I'm just getting started and trying to follow along. I get the following message when I both up the ESP-01 and check the Mosquito log on HA:
    1. New connection from 192.168.1.153 on port 1883.
    2. 1596619053: New client connected from 192.168.1.153 as KITCHEN_WINDOW (p2, c2, k15, u'mqttuser').
    3. 1596619075: Client KITCHEN_WINDOW has exceeded timeout, disconnecting.
    Any idea why it's timing out?

    • @TheHookUp
      @TheHookUp  3 ปีที่แล้ว

      because the code turns the wifi radio off after a successful transmission

  • @dannytech4709
    @dannytech4709 4 ปีที่แล้ว

    Hi any update on this project ? Can this be accomplished with Esp home?

  • @justinsarmento8809
    @justinsarmento8809 4 ปีที่แล้ว

    Does anyone think that 4 AA's would be to much for it? I am looking at putting them on doors and would like for it to live longer then 20 openings.

  • @danhalliwell5397
    @danhalliwell5397 3 ปีที่แล้ว

    HI, I have a Kerui Wireless Alarm System. I have all the door sensors and alarm panel setup but would love it to be intergrated via the Home Assistant. Does anybody know how I could do this at all. I am new to the Raspberry Pi but loving it. Any help would be much appreciated. Many thanks

    • @hbosch5223
      @hbosch5223 3 ปีที่แล้ว

      If you have the Kerui I see on amazon, there is no real way to do this. It is a completely closed RF system without an integration point. I used wyzesense contact and motion sensors with HA, but reliability has been terrible. That is why I am looking at these or just getting the house hardwired.

  • @JohnnieHougaardNielsen
    @JohnnieHougaardNielsen 5 ปีที่แล้ว +1

    Wouldn't the three second delay mean that the alarm would not sound if the window is closed again quickly, cutting off power to the ESP-01? While that time is probably not realistic for someone to pass through the window before slamming it again, it could be feasible to throw some object inside the house, like some nasty gas, surveillance device, or whatever undesirable thing. I'm thinking that transmitting a 433Mhz signal (like from a wireless doorbell) could have a shorter reaction time than connecting to Wifi. It shouldn't add a lot of volume or cost to the window sensor.
    Another thing is that a somewhat smart miscreant could bring along a magnet to interfere with the sensor. This could be made harder by adding a second normally-open reed switch just outside the range of the installed magnets.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Yep, these things fall under the "good enough" catagory for me, not "perfect". They have some downfalls and there are situations where they won't work (a wifi blocker or deauther would be the easiest route), but introducing additional complexity to the circuit seems like a waste just to cover those edge cases.

  • @jeevakkuwar
    @jeevakkuwar 3 ปีที่แล้ว

    Any way I can receive similar notification with Amazon Alexa?
    I am not using Home Assistant and would like such sensors to work with alexa

  • @NextLevelCode
    @NextLevelCode 3 ปีที่แล้ว +1

    You should use a tiny boot converter to get the full life from the batteries :)

    • @TecSanento
      @TecSanento 3 ปีที่แล้ว

      They take up even more energy

  • @bm830810
    @bm830810 4 ปีที่แล้ว +1

    1- use a cheap boost converter (under 1$) to boost the voltage and get much more out of the battery
    2- use ESP-Now instead of wifi and make a simple custom esp-now to mqtt bridge for all your modules, you can reduce transmission time from 4s to around 0.1s, also the system would be much more secure
    now your batteries would last forever

    • @TheHookUp
      @TheHookUp  4 ปีที่แล้ว +1

      Both really good suggestions. The purpose of this project was to make something as simple as possible, so I didn't want to add a boost converter and double the price and complexity of the board. I also wanted them to work independently of a hub which is why I decided against ESP-Now (although I did experiment with it and I do have a working version that utilizes it).

  • @hennieviljoen4335
    @hennieviljoen4335 4 ปีที่แล้ว +1

    Hi The Hook up where is the home assistant setup for this project?

    • @hackup3841
      @hackup3841 3 ปีที่แล้ว

      I would also like to know about the integration in home assistant. I subscribed Mosquitto mqtt broker to the topic of the sensor. But now I need to include it as sensor. I would like to integrate it as binary_sensor though. Anyone any ideas how to achieve that?
      In complex heating control with schedy in HA I see the window sensor switching from closed to open and back to closed from time to time. I just want it to show open and not send any more message on the mqtt topic. Is that possible?

  • @RossCanpolat
    @RossCanpolat 3 ปีที่แล้ว

    Is there a way to detect when the battery is low?

  • @JamesMossR33
    @JamesMossR33 4 ปีที่แล้ว

    Sadly it appears that the four ESP-01s I bought must be the power hungry type. When I hook up to 3.3v it works perfectly in about 2 seconds, but when I use a new CR2032 straight out of the packet the lights come on then dim or go out, and no message is sent. Checking with a multimeter the cell voltage drops to ~1.4v when the circuit is made. I've nipped the LEDs off a couple of boards but no difference.

    • @TheHookUp
      @TheHookUp  4 ปีที่แล้ว +1

      That's a bummer. The case would need to be modified but I wonder how an A123 battery would do in this situation.

    • @JamesMossR33
      @JamesMossR33 4 ปีที่แล้ว

      @@TheHookUp Thanks for the steer I'll look into them, and thanks for the videos on these sensors. As I'm new to smart home stuff your videos have been gold.

  • @dweebyone
    @dweebyone 4 ปีที่แล้ว

    Hi, This is great info, I have order the components to have a go myself. Only problem with Arduino cant find library ESP8266WiFi.h

    • @Ed19601
      @Ed19601 4 ปีที่แล้ว

      Thats incuded in the esp8266 board install

  • @TecSanento
    @TecSanento 3 ปีที่แล้ว

    Does it post "closed" when power drops out?

  • @FranciscoJGomez-CHSM
    @FranciscoJGomez-CHSM 4 ปีที่แล้ว

    Could you work with deep sleep to optimize de battery.

  • @glen4cindy
    @glen4cindy 11 วันที่ผ่านมา

    I know this is a pretty old video but I'm having trouble getting the ESP device programmed. I've failed several times. I'm guessing I may have the wrong board selected. Can you help?

  • @teodorbirca
    @teodorbirca 5 ปีที่แล้ว

    what is the enabled pin on ESP-01? what would be in a Wemos D1? can you post a clearer picture or schematic please? thanks

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Wemos D1 doesn't have an enable pin, it's just hardwired on the development board, you don't need to do anything special.

    • @teodorbirca
      @teodorbirca 5 ปีที่แล้ว

      @@TheHookUp thanks for the quick replay, so its possible to use it with your implementation? If so between wich pins i should add the 10k resistance? Thanks

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      You don't need it at all.

    • @teodorbirca
      @teodorbirca 5 ปีที่แล้ว

      @@TheHookUp ok, sorry then without a 10k resistor to what pins on wemos the door sensor should be hooked up? If i hook one sensor wire to ground and the other one to the ground power supply , when window is closed the circuit will be on when closed and off when window open, this is what i don't get , sorry for bothering with so many questions :)

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      oh, sounds like you bought the wrong kind of reed switch. You'll need a normally closed switch, that is open circuit when it is next to a magnet.

  • @rklauco
    @rklauco 4 ปีที่แล้ว

    Set static IP for the ESP - will start MUCH faster ;)

    • @TheHookUp
      @TheHookUp  4 ปีที่แล้ว

      I've got a follow up video to this where I set a static IP.

  • @linuxboi2869
    @linuxboi2869 3 ปีที่แล้ว

    Onboard until I saw the open windows 20 times. I open my windows that many times in a day sometimes. Still have an upvote though dude!

    • @TheHookUp
      @TheHookUp  3 ปีที่แล้ว +1

      Yeah, not good for your use case.

    • @linuxboi2869
      @linuxboi2869 3 ปีที่แล้ว

      @@TheHookUp be good to see how long a CR2450 would last in comparison.

    • @TheHookUp
      @TheHookUp  3 ปีที่แล้ว +1

      I think the next logical step is an A123

    • @linuxboi2869
      @linuxboi2869 3 ปีที่แล้ว

      @@TheHookUp yeah that’s around 1600 mAh, would last a long time!

  • @synco1985
    @synco1985 5 ปีที่แล้ว

    Hey, is there a possibility to put TASMOTA on esp-01?

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Theoretically yes, but your functionality will be very limited because most of the pins on the ESP8266 don't have break out pins on the ESP-01.

    • @badandyg
      @badandyg 5 ปีที่แล้ว

      Yes you can. I've done it for temp / humidity sensors

    • @willhutcheon4144
      @willhutcheon4144 5 ปีที่แล้ว

      Yes- Most certainly. Personally I think ESPHome (Yaml firmware creation right in home assistant) might be the way to go !! Although I must admit I am weak at "coding" so I avoid Arudino IDE as much as possible. -- Great video Rob!!!

  • @thetinytrader1564
    @thetinytrader1564 5 ปีที่แล้ว

    I am having around 50 connected devices. Can you suggest a good economical router for my house ?

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      I love my google wifi, I have 60-70 devices at any given time and google wifi never skips a beat: amzn.to/2SnnWgr

    • @Leonvolt28
      @Leonvolt28 4 ปีที่แล้ว

      Little late reply. But I would suggest to buy an Asus router. You can easily extend it with Asus Aimesh. Plus you can integrate asuswrt with home assistant for presence detection.

  • @andy1979s
    @andy1979s 5 ปีที่แล้ว

    Followed your tutorial. im 90% there. Hassio sees the sensor, displays closed while magnet is attache and open when magnet is away. The only think i cant get to work is the push notification (html5 push notification working with other stuff) not sure what im doing wrong or not doing. Any help appreciated.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Are you trying to do an iOS push or an HTML5 push?

    • @andy1979s
      @andy1979s 5 ปีที่แล้ว

      got it working in the end... woohoo!

    • @andy1979s
      @andy1979s 5 ปีที่แล้ว

      Doing it on android. But it works now... bit I have another question if you don't mind. I adapted your original design. And am powering the sensor with an 18650 battery. I left your code as it was. How does the battery voltage alert works. ? Does the sensor logs the voltage in mqtt every time it connects? I would like to add that to my push notifications.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      You can modify it to do that. Just change the if statement where it measures the voltage and have it always return true.

    • @andy1979s
      @andy1979s 5 ปีที่แล้ว

      Cool will try it out. Here is my current notification in automation.yaml -

      - alias: Send me a message
      trigger:
      platform: state
      entity_id: sensor.patio_door
      to: 'open'
      action:
      service: notify.notification_test_s8
      data_template:
      title: "Patio Door Open"
      message: "Patio Door Open {{ states.sensor.patio_door }}"
      How to add the voltage info once I have it in mqtt?

  • @FranciscoJGomez-CHSM
    @FranciscoJGomez-CHSM 4 ปีที่แล้ว

    Few months ago I asked If you have a channel in microbiology, my son is estading , I think you are in that area.

  • @yurid7418
    @yurid7418 5 ปีที่แล้ว

    for wireless sensors should be used cheapest and low power solutions based on STM32 MCUs. For standard wireless alarm system should take less than two seconds to send alarm event. Otherwise the sensor can be destroyed by intruder person. Also system must monitor battery state that means to send message with battery state. Any way good start and system step by step can be improved.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Using an STM32 kinda misses the point. The whole reason I made this was to be able to use them with WiFi without needing a hub. If you used an STM32 you'd need to use some other module like RF or wifi (in which case you'd be using both the ESP01 and the STM32).
      Check out my follow up video to this one, I was able to get the transmission time down to around 2 seconds using a static IP: th-cam.com/video/2kLZ7DlP9KU/w-d-xo.html

    • @yurid7418
      @yurid7418 5 ปีที่แล้ว

      @@TheHookUp Agree with you that for STM32 + nRF / CC11xx / CC25xx / OTHER_RADIO require some gateway to connect sensor over Wi-Fi . I found some gateway solutions based on ESP8266 like: github.com/derkzomer/nrf24l01-esp8266/blob/master/post.ino
      or github.com/1technophile/OpenMQTTGateway
      It could improve power consumption, extend range in case of use 868MHz / 915MHz . In near feature I planning to connect my Irrigating system over the similar gateway solution to MQTT broker located in Raspberry. It will be nice to collaborate and share and publish source code.

  • @GlennTrefethen
    @GlennTrefethen 6 ปีที่แล้ว

    how did you remove the header pins from the esp-01. it does not fit the case with them.

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว +1

      Check out 4:03 in the video. You can push the pins through with a hot soldering iron.

    • @GlennTrefethen
      @GlennTrefethen 6 ปีที่แล้ว

      and i watched this 4-5 times, and just missed that. tnks

  • @StePhanMckillen
    @StePhanMckillen 6 ปีที่แล้ว

    Nice

  • @nicksharp7680
    @nicksharp7680 3 ปีที่แล้ว

    It is late and I have not slept for the past 28 hours so please excuse me if I'm missing something?
    The way I have seen this is, with the window closed, no current is passed, open the window and woosh, current passed, ESP boots, sends MQTT message to say the windows open.
    But...
    What if the window is not closed for a good while? surely the ESP is fully powered for that entire time thus draining battery?
    Would it not be better to have some timing circuit on the VCC that once the reeds are triggered runs for say 15 seconds then cuts VCC and puts everything back to 0 current?
    This would reduce battery drain a great deal.
    But like I said, tired... dead servers to resurrect.
    [Strummers Law: No input, no output]

    • @nicksharp7680
      @nicksharp7680 3 ปีที่แล้ว

      OK. how about using an XOR to detect the stat change of the reed switch, that would be simple enough?
      Going to bed
      [The future is unwritten] Joe Strummer

  • @ashoktvm
    @ashoktvm 3 ปีที่แล้ว

    For me it dont go to closed with few seconds even after the esp01 is off but get closed after 22 seconds even if the esp01 is still on. How to rectify this

    • @bitterrotten
      @bitterrotten 3 ปีที่แล้ว +1

      That 22 second delay is probably caused by your home assistant setup. I know my Raspberry Pi install with SD card is pretty lax with timings. I've read that moving it to SSD will speed things up.
      Your second problem with the window being marked as closed while it's still open, that's the way he's coded it. It only sends the open status once. He's using it for the notification that the window was opened rather than as a status indication. You could try playing with the ESP.deepSleep(0) value to make it keep sending an open status but then you'll get some weird toggling issues when your home assistant sends it's default closed value. There's a way to do this smoothly with an automation but I'm not good enough at HA to guide you.

  • @sallen135
    @sallen135 5 ปีที่แล้ว

    Even after installing the drivers for the FT232 I cannot see any port options. I cannot even see the device in device manager whatsoever. Do you have any suggestions?

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      Is it the adapter from the description, or a different one?

    • @sallen135
      @sallen135 5 ปีที่แล้ว

      No it is not, I'll order that now and give it a try. The one I have is from Banggood and I'm now seeing in the description "This chip is not orignal, do not have EEPROM, can not invert the signals." so im gonna assume its bad

    • @sallen135
      @sallen135 5 ปีที่แล้ว

      UPDATE: Second FT232 did not work either. Bought a new cable and everything works.

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      @@sallen135 Ug. I wish there were a mandatory marking for power only USB cables. I run into this problem ALL the time. I guard my power+data usb micro cables like they are made of gold.

    • @sallen135
      @sallen135 5 ปีที่แล้ว

      @@TheHookUp I didn't realize there were power only cables! Good to know. What's funny is I have a vague memory of realizing this cable only did power (thought it was broken) and still putting it away with all my other cables thinking oh I'll remember it only does power... classic. I probably forgot instantly. Thanks for the videos and the responses, keep it up

  • @chrisgo4668
    @chrisgo4668 6 ปีที่แล้ว +1

    Whats about windows that are opened regularly and stay open for hours? How does this affect the battery life?

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว +3

      Staying open would put moderately more drain on the battery... It goes into deep sleep after sending the original message so we're talking about microcurrent draw. The biggest issue is that it will inaccurately report the window status.
      A major goal of this project was to keep them as easy to make as possible. There are certainly ways to allow it to do open/closed operation, but they would require a larger circuit.

    • @chrisgo4668
      @chrisgo4668 6 ปีที่แล้ว +1

      Ah, it goes to deep sleep after sending out the open message. Thanks!
      So if I use a battery pack with some aa-cells instead of a coincell, I could get it running for years.

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว +1

      yep.

    • @jaredkindred
      @jaredkindred 5 ปีที่แล้ว +3

      If you open a window often just keep a spare magnet near by and place it on the sensor when you have the window open for long periods of time. Don't forget to remove the magnet prior to closing the window again.

    • @chrisgo4668
      @chrisgo4668 5 ปีที่แล้ว +2

      Thats a cool idea!
      Maybe putting one of those fancy "remove before flight" things on the magnet, so everybody recognizes it.

  • @aliayan1995
    @aliayan1995 5 ปีที่แล้ว

    you can add very small solar panel and rechargeable battery

    • @TheHookUp
      @TheHookUp  5 ปีที่แล้ว

      I'd love to do this, but it introduces a bunch of other circuitry (need a voltage regulator and a charging circuit).

  • @KazimsChannel
    @KazimsChannel 4 ปีที่แล้ว

    Still don't get how can it send close message? Reed relay disconnects power to ESP....

    • @TheHookUp
      @TheHookUp  4 ปีที่แล้ว +1

      Last will and testament (lwt) is stored on the MQTT broker and basically says “if you don’t hear from me again, tell my family I love them”, except it just says “close” instead.

  • @ssinseeme
    @ssinseeme 6 ปีที่แล้ว

    Do you have the code on the HA. To make this work.

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว

      Your names and topics will be different, but they are mqtt sensors: github.com/thehookup/MQTT_Window_Sensors/blob/master/windows.yaml

    • @ssinseeme
      @ssinseeme 6 ปีที่แล้ว

      Thanks.

    • @ssinseeme
      @ssinseeme 5 ปีที่แล้ว

      Should the light stay blue on the ESP is its connected? I set my topic correctly and flashed and configured HA correctly but it doesn't seem that my HA seeing ESP.

  • @kylegurney8610
    @kylegurney8610 ปีที่แล้ว

    What did you use for the wired door sensors?

    • @TheHookUp
      @TheHookUp  ปีที่แล้ว

      These are my goto, paired with a tasmota device: amzn.to/3E2JSrt

    • @kylegurney8610
      @kylegurney8610 ปีที่แล้ว

      @@TheHookUp oh sweet! Is there any real difference between the mc-31 and mc-38? Also have you ever flashed those sonoff devices to esphome?

    • @TheHookUp
      @TheHookUp  ปีที่แล้ว +1

      I'm not a big ESPHome user, I prefer MQTT and Tasmota over the ESPHome API.

    • @TheHookUp
      @TheHookUp  ปีที่แล้ว +1

      MC38 is pre-wired.

  • @achmed20
    @achmed20 6 ปีที่แล้ว

    meh, none of my esp-01 want to boot from fresh cr2032 batteries. im goign a different route now. im reusing some 18650's i have left and just design a case for them.

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว +1

      That's really strange. Did you use a resistor or a plain wire to pull up the chip enable pin? Even that one random ESP-01 that I mentioned booted fine when I switched to a plain wire.

    • @achmed20
      @achmed20 6 ปีที่แล้ว

      all plain wiring here, no resistors involved. mine seem to be particulary power hungry during bootup.
      maybe i just got unlucky with my ESP-01's ;)

    • @BarryWise
      @BarryWise 6 ปีที่แล้ว +1

      It's because of the current draw and probably the model of esp822-01 you're using. The esp8266-01 version with 1MB of memory requires a burst of 320 mAh @3.3 volts at boot, and the CR2032 is only rated at 220mAh - so they will never work with that battery. I've tried on half a dozen over time and never found one that would boot with such little current, but all mine are the newer 1 MB version. There was an older version of the 8266 that only had 512k memory, idk if that one less peak current or not. Either way, I think you just got lucky somehow finding 8266's that will boot on a 2032 - if you google it you'll see people have been trying since they came out to no avail!

    • @TheHookUp
      @TheHookUp  6 ปีที่แล้ว

      I've had really really good luck then. I've got 12 ESP-01s in my drawer right now (don't judge me), and all of them boot just fine on 2032s. I used that power hungry one for my roomba project.
      I ordered most of the 12 from amazon (the brand in the above link), but a few are from aliexpress. All of them are the black PCB 1mb type.

    • @BarryWise
      @BarryWise 6 ปีที่แล้ว

      Wow. and the only mod you did was remove the on-board LED? I'll have to try that and your code, maybe you're on to something here. Technically the 8266 should run on the 2032, it's just the startup current spike that prevents it. Maybe your configuration minimizes that spike