Having trouble with the Door Switch project


#1

Well after 4 tries setting up the openHAB server (2.3.0), I finally got it set up so that the MQTT works using the MQTT.fx program. Next, I loaded the Door Switch sketch into my Wemos d1 mini with the changes to my network connection. I am using a pushbutton to simulate the door switch. The switch is set up with a 10K resistor to +5 volts and the other end connected to pin D4, which was changed from pin 13. The switch pulls pin D4 to ground, as shown in the schematics. When I press the button to simulate the door opening, the blue LED on the board lights. I am assuming that is when the board transmits the “OPEN” Topic to the server.
I’m monitoring the server log to see if I can see a switch change message. Nothing.

Next, I opened up the MQTT.fx as indicated in the setup documentation. I pressed the button several times and still get no indication that the switch opened or closed.

I started looking at the sketch and comparing the naming conventions between it and what was set up in the server. The only thing I can see different is in the server the Door Sensor is named MKDoorSensor1
and in the sketch it’s named: char* outTopic = “MK-SmartHouse/security/MK-DoorSensor1”; Where it has a dash between the MK and the DoorSensor1 I have tried to match what is in the sketch to what is in the server but that still didn’t work.

Now the other odd thing is if I reboot the server and watch the Log Viewer as it boots up I will see a list of times the DEMOSW shows up changing from ON to OFF.

As I don’t know much of anything about this system, I’m trying to learn as I go. At this point, I’m stuck as to what to try next. I figure once I get this working, I should be able to add more sensors to the system.

ANY help you can offer would be GREATLY appreciated!!

Thank you

John