nice code. got it working fine.
my reed switches are the both NC/NO. is there any benefit to choosing one over the other?
nice code. got it working fine.
my reed switches are the both NC/NO. is there any benefit to choosing one over the other?
Doesn’t matter at all, as long as you pick the correct config option either NO or NC will work correctly.
is there a limit to the length of wire between the mcu and the reed switch?
I’m sure there probably is a theoretical limit but practically speaking you’re probably ok. My own reed switch is approx 25 feet away from the NodeMCU and it works just fine.
yeah i got it working. thanks for your help and code. works great.
here are my full notes for anyone interested in using GarHAge for just a coupla reed switches.
update config with wifi and MQTT settings and then flash, use nodeMCU ESP-12e settings
(do not need the relay mentioned in the parts list)
WIRING:
——switch 1
wire reed switch NO and COM
COM to D5
NO to any GND
——switch 2
wire reed switch NO and COM
COM to D6
NO to any GND
——— check MQTT
mosquitto_sub -t “#” -v -u username -P password
reset MCU and it should broadcast it’s status to mosquitto.
——— HASS
customize:
binary_sensor.bedroom_door:
icon: mdi:home-assistant
friendly_name: "Bedroom Door"
binary_sensor.bedroom_window:
icon: mdi:home-assistant
friendly_name: "Bedroom Window"
binary_sensor:
- platform: mqtt
name: bedroom_door
state_topic: "door/1/status"
payload_on: "open"
payload_off: "closed"
device_class: opening
qos: 0
- platform: mqtt
name: bedroom_window
state_topic: "window/1/status"
payload_on: "open"
payload_off: "closed"
device_class: opening
qos: 0
groups.yaml
security:
name: "Security"
entities:
- binary_sensor.bedroom_door
- binary_sensor.bedroom_window
can you share your code for the bruh sensor with a reed switch integrated please? interested in this. Thanks
See here.
Thank you so helpful - how have you added this into HASS? Do you have to define a specific value_template ??
I have it as a mqtt sensor
- platform: mqtt
state_topic: "home/sensornode1"
name: "SN1 Reed"
value_template: '{{ value_json.reed }}'
Thanks, does that trigger the state instantaneous for you? Mine only seems to trigger when I go from open > closed… but now I can’t see to get it to display the state as open at all… the reed is connect to GND and D6. Would I also need to connect the D6 leg to 3.3v?
Yes mine is instant. Ill need to run out and double check But I am pretty sure oneside of the reed is to 3.3v and the other is to d6.
Just some food for thought…
I had a setup like this in place before I switched over to using Xiaomi Door Sensors. The setup ran on batteries and obviously power consumption is a big deal. I wasn’t impressed with the deep sleep of the ESP and so I sat a power control unit in the circuit.
Most of the time the ESP was completely off (the reed was NO / normally open). The door opening triggered the power control to power up the ESP, the ESP did its thing over MQTT and as soon as it had completed it sent a signal to the power control unit to power itself down. All in the all ESP was only on for about 3 seconds (using a static IP speeds the connection process).
Thanks - appreciate the help. I had a play, If I have one leg on the reed connected to D6, I have to switch the other leg between 3.3v and GND for it to switch between open and closed… So I tried having the D6 leg also connected to 3.3V (so it would switch between GND and 3.3 basically) but it must be shorting something because it gets incredible hot! (I only made this mistake once…)
Thank you - My reed switches don’t have a com port though, they’re just basic magnetic ones (NC)
Your write up looks very comprehensive though - can you share the reed switches you’re using?
https://www.amazon.com/gp/product/B0009SUF08/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1
your reeds should work. one of those wires is a COM and the other is an NC, tho i’m not sure which is which. [plus: make sure you set it to NC in the garHAge code before uploading to the esp8266]
my switches just give you an option of NC or NO. i chose NO. but it matters not which you chose.
Great info here! I have a lot of experience with ESP8266 and contact sensors, but new to HASS. I’m the creator of a similar project called Konnected that’s based on an NodeMCU ESP8266. The main use case here is for converting an old wired security system into a home automation platform (including reed switches and motion sensors and much more).
Right now Konnected integrates with SmartThings only, but we’re starting to accelerate our platform expansion plans and was thinking that HomeAssistant would be a great platform for Konnected.
The project is open-source on github: https://github.com/konnected-io/konnected-security and we sell DIY kits and (soon) custom hardware based on the ESP8266 for easy plug-and-play installation.
Is this something that would be interesting to you or the HASS community? I’m really interested in your thoughts/feedback on a product like this for HASS.
I have built this Multisensor. I am getting good indication from the PIR which is showing ‘standby’ or ‘motion detected’. I am struggling to implement the PIR state into an automation so that it will control a light.
Any suggestions would be greatly appreciated.
Had another attempt today and got it sorted. The states - ‘standby’ or 'motion detected ’ didn’t work yesterday when I used them as a trigger…but today it worked!!