ESP-01 and HW-655 Relay not working with Virtual Pin

Pete,

I only need one relay to open or close the door. Apart from it being on an app, the real value is being able to see if the door is open or not (wife sometimes thinks it may not have closed properly)

If I went to OTA updates and not Serial.begin(9600); do you think I could then use GPIO1 or GPIO3 without locking up the unit?

At the moment I am using a NO reed switch. If the door is closed then it wants to put the ESP-01 into flash mode. One option I have thought of is going to NC reed switch so with the door closed it would be happy. This would mean if I have a power failure and the door is closed it would all reset happily.

Regards
Don

In other posts on this forum the honorable @PeteKnight has suggested 433mhz door sensors that talk to a esp8266 running a 433 listener (simpler than it sounds) and sending that info to Blynk. I have been meaning to ask him a question personally. There are apparently some devices that send Low Batter, Door Opening, and Door Closing codes. My searches on AliExpress haven’t give me a clue to which those are.

Like this. NZ$ 5.15 10% Off | 1/5/10 PCS 433MHz Wireless Magnetic Contact Switch Sensor to Detect Door Open for House Security Alarm System

Looks very interesting. I am interested to know too

The relays are controlled via serial commands, so I don’t see how this would work.

My advice would be to use a Wemos D1 Mini (or D1 Mini Pro if you need an external antenna) and a Wemos relay module. These can stack on top of each other, or be mounted on a double base.
This would give you all the pins you need.

The Wemos D1 Mini/Pro and accessories are discussed in depth towards the end of this topic:

Pete.

@daveblynk @flyonly some info about 433MHz door/window contacts…

BTW, @flyonly I don’t see this as a solution to your issue with the HW-655 relay module.

I use these wireless switches:

The important thing is that they have a sticker on the back that says “Door/window contact with door open/close code 433Mhz”

This means that they send a different code when the magnet is offered-up to the side of the sensor to when it’s taken away from the sensor.
Some devices send the same code in both situations, which makes life more difficult.
There is no mention of low battery notification, but connecting the sensor to a bench PSU and slowly reducing the voltage from 1.5v causes a different code to be transmitted.
Each sensor will give different codes, so that multiple ones can be used together, but the one I have to hand does this:

700422 Low Battery
700423 Tamper switch activated (back cover removed)
700426 Open (magnet removed)
700430 Closed (magnet present)

Note that these codes are transmitted once, when a change of state occurs, not constantly.
This means that you have to constantly listen for and remember, the last code that was received. This will probably mean storing the door status in SPIFFS or LittleFS, and will require you to be able to manually reset a low battery warning when the batteries are changed, and maybe do an open/close cycle of the door if ever it’s opened manually when the MCU is offline.

These type of switches are great for domestic doors & windows if you’re building a security or ‘granny monitoring’ system, but in a garage door scenario I think I’d go for hard-wires reed or microswitches as surface mounted wiring and unsightly looking switches aren’t really such an issue, and hard-wired switches have the advantage of being able to be read at any point.

Pete.

Thank you for the information. Just had a random thought. The ESP-01 is cheap. I could use one to run the relay and a second one to monitor the reed switch and have them both talking to the one blynk app?

The ESP-01 is cheap, but NodeMCU and Wemos D1 Mini dev boards aren’t exactly going to break the bank.
In the UK an ESP-10 will cost around £3.10 including postage, and a Wemos D1 Mini is around £3.70

The issue you’re going to have is that if you use two ESP-01’s then it’s very easy to display data from both in the same app project, but if you need one ESP-01 to talk directly to the second ESP-01 (to stop driving the door motor when the door is closed for example) then you’ll need to use Bridge code on both ESP-01s. Many people find this type of code difficult to comprehend (even though it’s actually quite straightforward) and for me it just adds an unnecessary degree of complexity to what should be a straightforward project.

The other issue is that the ESP-01 which controls the motor will only know if the door is closed if both ESP-01s have a connection to the Blynk server, as the communication between the two devices is via the Blynk server.
Personally, in this type of application, I’d prefer my MCU to be working autonomously, and not relying on a connection to WiFi and the Blynk server for it to control the motor in the the correct way.

Pete.