ST_Anything - with NodeMCU ESP8266-12e - getting phantom notifications on contact sensors

ST_Anything Contact sensors - report open/closed when they are not opening and closing.

The sensor works when I physically open and close the door. (100% of the time)
Unfortunately - it also mis-reports sometimes and I don’t know why? (example middle of the night)

The magnet is a neodymium and is perfectly aligned with the contact sensor. The gap is very close 1/8 of an inch.
The door does not wiggle in the jam. If I shake or wiggle the door - I am not able to get the sensor to show ‘open’ or generate an event.

At first I thought maybe the unit was rebooting and sending alerts?
However, If I cycle power to the NodeMCU and it powers up and reboots - it does not send any door alerts.

Environment: (No batteries)

NodeMCU-12E - powered with a USB-cable to a 110 outlet.
Using GPI-PINS: 2 & 6

The physical hardware that connects to the NodeMCU-12E is a contact/magnet sensor.
It’s a round white piece of plastic with 2 wire whips / and their is a magnet attached to the door frame

One sensor is on the garage service door, the other sensor is on the Garage overhead door.

ST_Anything Example script with the following lines uncommented:

#define PIN_CONTACT_1 D6 //SmartThings Capabilty “Contact Sensor”
#define PIN_CONTACT_2 D2 //SmartThings Capabilty “Contact Sensor”

static st::IS_Contact sensor3(F(“contact1”), PIN_CONTACT_1, LOW, true);
static st::IS_Contact sensor7(F(“contact2”), PIN_CONTACT_2, LOW, true);


try adding a value after your pull-up value. So, it would look like this:
static st::IS_Contact sensor3(F(“contact1”), PIN_CONTACT_1, LOW, true,500);

The 500 signifies the number of counts of it being LOW before it would signify a change in status. This prevents false alarms.


THANK YOU! I will try it tonight!

1 Like

Since you’re using an ESP8266, please be aware that there is a bug in v2.4.x of the ESP8266 Board support package for Arduino. Please revert your version of ESP8266 Arduino to v2.3 until the devs fix this memory leak. Much thanks to @Jason_Brown who uncovered this problem.

Please note - This is not a bug in ST_Anything. Users who have reverted their ESP8266 Board package to v2.3 have reported the memory leak is resolved.

1 Like