Now re-assemble the two boards. Be careful to adjust the boards to be parallel to each other. I did this by soldering the TAB and Black Wire first. Then soldered one pin on one end of the ESP Module, verify the spacing. next solder a pin on the other end and verify the spacing. Route the wire between the two boards and to one side of the button on the board. This seems to be the best place as there is a little extra room for the wire when the case is re-installed.
When putting the plug back in the case avoid allowing the wire to be on the button side of the button as there is little room and there is a standoff in the case that will force the PC Board up a little and the button will always be pressed.
If you have a switched power strip plug the outlet in, stand back and turn it on and wait for sparks or smoke. There will be none if you did everything right.
Configure the like normal, your WiFi, MQTT Server, Host name and all that stuff. Use the following template:
{“NAME”:“ESW01”,“GPIO”:[0,0,0,0,21,157,0,0,132,133,17,0,131],“FLAG”:15,“BASE”:18}
Activate the profile and Save. The Plug will reboot and you should see the Blue Light blinks as it connects. Pressing the button should toggle the switch. Connect via web page and Toggle should act on the switch, show status and toggle the relay and LED.
At this point all readings on mine were wrong so I decided to calibrate.
Get a known load, like a 60 watt light bulb (incandescent, not LED). Plug the bulb into the plug and turn it on. Verify the wattage (if possible with a meter) and then open console on the EWS01 web page.
Enter: “PowerSet 60.0” ( or whatever watt load you have).
Measure the voltage with a good meter.
Enter: “VoltageSet 120” (or whatever voltage you read with the meter).
Last calculate the current by measuring it or calculating it with this formula P/V=A.
Enter the current in Milliamps.
Enter: “CurrentSet 5000”
In theory resistive loads will always provide a power factor of 1.00. If that is not the case, I recommend you repeat the calibration process and make sure everything was done correctly.
Please comment if you try this and let me know your results. it seems to work for me so far.