$5 DIY Wireless MQTT Smart Home Window Sensors
HTML-код
- Опубликовано: 28 авг 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/the...
STL Files:
Main Case: github.com/the...
Case Cover: github.com/the...
Magnet Holder: github.com/the...
Support my channel:
Patreon: / thehookup
Tesla Refferal Code: www.tesla.com/...
Music by BenSound.com
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
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!
Glad to hear it, if you need help with a project just leave a comment and I'll see it.
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.
@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!
As an electrician, i always suggest clients put in more wiring during building stage !!
Or lots of conduit
You should use a static ip address for your esp - it should lower the time to connect to 2s or less
SornDP suggested that below. That's in my weekend plans.
@@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.
@@ahmedalshamsi1723 MQTT IN node connected to DEBUG node. Then configure MQTT IN node to your topic in code (PICK_UNIQUE_WINDOW_TOPIC)
D DEE hey thanks for the reply
@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.
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.
Yep, it's a pretty good option these days. I believe this video predates zigbee2mqtt by 6 months or so.
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
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.
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.
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
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).
Imagine opening your windows less than 20 times in 6 years 🤯
I think this project is brilliant: outside-of-the-box thinking! Very clever.
oh, great, an other brand new channel with very interesting tutorials! Thanks :D
You could use the normally closed leed part of the reed switch to determine if the esp should shutdown or not
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.
Also a loud siren is good for making sure they don't stick around for long.
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 :)
If you use the updated code from this video: ruclips.net/video/2kLZ7DlP9KU/видео.html
You will just add a sensor for each window like this:
sensor:
- platform: mqtt
name: "Dining Room Window"
state_topic: "windowStatus/diningRoom"
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.
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
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.
You could use the mac Adress for the unique Adress
I was about to ask about how you got the ESP8266 to deep sleep and then... GENIUS!
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.
Only if you have a local mqtt broker like a raspberry pi with mosquito and home assistant.
Sweet this looks easy to do .....
Thank you for making this! I was looking for a cheap window sensor and it looks like I just found one!
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.
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.
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. :(
I would like to see an update of this video with ESP NOW, very easy and less energy consuming.
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.
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.
Open a window 20 times in 6 years? Must be a crack house!
Florida. Only open the widows if you want hot wet air streaming into your house.
reed switches don't like switching much current at all, usually they are used in conjunction with a snubber circuit.
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
Looks like a great article. What about how to set up MQTT software to communicate with the boards?
Great write up and lots of detail. Thanks for the great ideas!
You should use a tiny boot converter to get the full life from the batteries :)
They take up even more energy
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.
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.
@@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 :)
@@JohnVanderbeck Your understanding is correct :)
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.
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.
Love your detail and DIY sharing attitude! However, now WYSE Sense Door/window sensors 4 for $20.
Yep, they're pretty cool. Proprietary protocol, but still cool.
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
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
Go to the HA forum and you should be able to find your answer with step by step mqtt setup.
What are the chances of getting a dozen of those window sensor cases/cover/magnet holders?
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!
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.
Thanks for your answer...that makes sense. How about the buckyball size?
@@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
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.
Did you end up doing this?
Dude this is cool stuff ....Keep it up...well described Tutorial...Thanks for sharing..
Best youtuber/teacher in the world!!!
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?
Gonna try that out this weekend.
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
@@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.
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?
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!
Yeah, not good for your use case.
@@TheHookUp be good to see how long a CR2450 would last in comparison.
I think the next logical step is an A123
@@TheHookUp yeah that’s around 1600 mAh, would last a long time!
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()”
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
Great video. Just what I wanted. You made it look easy. No I have to go to work!!!!
make sure you check out the updated version: ruclips.net/video/2kLZ7DlP9KU/видео.html
I really appriciate your explaination. Great project.
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.
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...
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?
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.
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: ruclips.net/video/2kLZ7DlP9KU/видео.html
@@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.
Simple. Thank you!
interesting idea. Could you do a project showing how to hook your projects up hardwired? Or at least to a hardwired power source?
I use NodeMCUs for all of my hardwired stuff, but yes, one of the next videos will be using a hardwired microcontroller.
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.
Few months ago I asked If you have a channel in microbiology, my son is estading , I think you are in that area.
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.
Very cool video ! Thnxs for sharing !
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!
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
I really enjoyed this video. I am trying to create something out of an ESP-01. Is there a way to contact you?
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?
Probably not. Deauth only works on currently connected devices, but they would be vulnerable to ssid spoofing.
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]
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
Hi can you make a video with this hardware for a mailbox door open closed notifications system with 3 cr2032 in parallel
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?
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
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
Set static IP for the ESP - will start MUCH faster ;)
I've got a follow up video to this where I set a static IP.
Is there a way to detect when the battery is low?
Great project! But I don't think most of people can do this. The WiFi definitely is not good choice for smart home applications, specially for the battery powered sensors. The LoRa wireless will be the best future for smart home. There is a new brand YoLink smart home products available on Amazon. The whole house smart security system including door sensor, leak sensor, smart plug and LoRa hub, all together cost under one hundred dollars. I strongly recommend everyone should use it and try this new long range tech.
Given that the default state is off, you wouldn't know if a chip failed or battery died without periodically testing each one.
Does it post "closed" when power drops out?
you can add very small solar panel and rechargeable battery
I'd love to do this, but it introduces a bunch of other circuitry (need a voltage regulator and a charging circuit).
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.
That's a bummer. The case would need to be modified but I wonder how an A123 battery would do in this situation.
@@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.
Hi any update on this project ? Can this be accomplished with Esp home?
have you ever work on android broker such as moquette or something like that ?
Hi The Hook up where is the home assistant setup for this project?
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?
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.
Any cheap android tablet that you recommend for running Home assistant dashboard kiosk mode?
Better to buy coin cells with leads. U cannot solder directly to the coin cell or u will easily break it
No solder here, just press fit
this is some triple OG gangster shit
Do you have the Arduino connection parameters for the esp1. thanks.
Great video!
Please review zigwee sensor or wifi door sensor
Still don't get how can it send close message? Reed relay disconnects power to ESP....
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.
very cool design
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
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.
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
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.
The Hook Up
Still no reply from Dale L. Makes one wonder, might he accidentally have glued his fingers to the window?
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
Doesn't need to be local, you could use cloud mqtt if you wanted to.
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.
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
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.
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.
That’s what the program does. That is working as intended, this is not meant for windows that you will leave open.
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
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?
because the code turns the wifi radio off after a successful transmission
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?
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..
@@madzur
Triple check your SSID and password. If your SSID has spaces or special characters, try changing that?
you should make it deep sleep after it boots and sends a message to conserve power
It does.
neat project, but 20 times to drain the battery - that's not suitable for most of the use cases
Are you still using these in you smart home?
Yep, I actually just checked their batteries a few weeks ago.
@@TheHookUp I'm about to build a house, I would really be interested in a long winded version of what you'd do differently (0:55, i.e. wiring)!
Hi, This is great info, I have order the components to have a go myself. Only problem with Arduino cant find library ESP8266WiFi.h
Thats incuded in the esp8266 board install
how did you remove the header pins from the esp-01. it does not fit the case with them.
Check out 4:03 in the video. You can push the pins through with a hot soldering iron.
and i watched this 4-5 times, and just missed that. tnks
How does Amazon dash button do it? It’s WiFi too
It's quite a clever beast. It actually never connected to wifi, it just sent some broadcast initialization packets to the router that would then get processed by echo devices on the same network. By avoiding the full WiFi handshake it saves a TON of battery.
I don’t think having an echo on the local network was a requirement. I think you are talking about the ARP packets that hackers/DIY-ers used to listen to the button presses. You might be able to replicate the ARP packet approach. ARP packet is sent when any device connects to wifi. So you don’t have to send anything to mqtt. Just fall asleep immediately after connecting to SSID and have a script listening to ARM packets with the known MAC address of your esp-01. They claimed 250 button presses of off one AA
mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/
I am having around 50 connected devices. Can you suggest a good economical router for my house ?
I love my google wifi, I have 60-70 devices at any given time and google wifi never skips a beat: amzn.to/2SnnWgr
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.
Could you work with deep sleep to optimize de battery.
This unit already uses deep sleep
Thanks