|
Post by papa on Sept 20, 2017 14:44:06 GMT
From time to time, this forum discusses a smart wall switch that would use our forum's home automation software. This thread includes my thoughts about making a Sonoff Smart Wall Switch, especially starting with this post. We've bumped into various difficulties, but the following may provide a good way to do this, starting with a manufactured device & reprogramming it. Currently for $15 USD, Itead (China) sells a smart wall switch called a Sonoff Touch. At the moment, a banggood promotion sells a U.S. style Sonoff Touch for $15.11, including 3-7 days shipping. Amazon lists them for more money. As of Sept. 20, 2017, it costs $11.65 if you are willing to wait longer. For good or ill, the Sonoff Touch switches via touch rather than a physical switch. The Sonoff Touch's price is better than other options I've seen. It should fit inside the limited space of a regular wall switch box. This is good for safety's sake. Note: banggood.com & Itead have not compensated me. I admire the program-ability & pricing of Itead products. One remaining obstacle for some situations: As mentioned elsewhere, installing this requires the wall switch box to contain both mains' hot wire AND a true neutral wire. Why? The Sonoff Touch's electronics needs constant power in order to detect the wall switch change in state & to close the open relay. That is usually not possible without BOTH a mains hot wire AND a mains neutral wire. (Some expensive proprietary switches claim they overcome this obstacle.) More on this below
|
|
|
Post by papa on Sept 21, 2017 15:52:27 GMT
Again, installing a Sonoff Touch requires the wall switch box to contain both mains' hot wire AND a true neutral wire. If a switch box has wires only on the switch's terminals (In/Out or In/Out/GND, as in older homes), it probably does not have a true neutral wire. I believe a true neutral wire will typically be separate from the wall switch & may be in a bundle of 2 or more wires (with white insulation?). Caution: a white insulated wire on a switch terminal is NOT a neutral wire, but rather continues the hot wire.
How can you check your wiring? Please, please, check your wiring SAFELY, avoiding shocks or worse from mains voltage. You can remove the switch plate cover & perhaps see enough with a flashlight.
If you cannot see enough of the switch box wiring with a flashlight, please do not proceed without shutting off the power supply to that switch box. That is, more than switch off the wall switch, in the circuit breaker panel, switch off the circuit breaker that supplies that wall switch. To do this, turn on this wall switch & its light. Then turn off the circuit breaker that may be labelled for that location. If the light goes off, things are safe to proceed.
If the circuit breaker is not labelled or the light did not go off yet, one at a time, flip off circuit breakers until the light goes off. (Do yourself a favor: on the circuit breaker box, list the circuit breaker's number & that it includes the wall switch you are working on.) Once the circuit breaker (not the wall switch) has turned off the light, you can safely proceed. You can remove the screws which hold the wall switch in the switch box, pull out the wall switch so you can see the wiring.
You may wonder, "To a switch box could I bring in a missing neutral wire from elsewhere?" I'm no expert, but I believe with older, existing construction, this is probably not very easily or cheaply done & still address safety & electrical code obedience. Of course, new construction would be easier, but I believe current construction would already provide hot & neutral in a switch box.
To Be Continued
|
|
|
Post by papa on Sept 21, 2017 16:14:33 GMT
If your wall switch box, does NOT have a mains true neutral wire AND if you cannot fix this in a safe fashion that obeys electrical code, a Sonoff Touch will not work for you. This also rules out other smart switches with the possible exception of (expensive?) proprietary smart switches that claim to overcome this problem. A possible alternative could function somewhat like what a smart switch accomplishes. It does NOT require a mains true neutral wire in a wall switch box. I've used an Itead Slampher smart light bulb socket for this purpose. It only requires reprogramming the Slampher, not changing the wall switch circuitry. The wall switch turns the bulb on & off. Limitations: One can only remotely turn the bulb on & off IF the wall switch is on (to power the Slampher electronics). Also my Slampher only worked with old-style incandescent bulbs, not CFL or LED bulbs (at least not the standard, cheaper kind). See this thread for the details. Below: IF you have the right wiring, a smart wall switch that would use our forum's home automation software
|
|
|
Post by papa on Sept 22, 2017 16:28:05 GMT
Disclosure: I did not have a Sonoff Touch until Sept. 27, 2017. So far I do not have a true neutral mains wire in the wall switch boxes where I might desire a smart switch. At this point, Sonoff Touch would be the smart switch I would try. Curious, I ordered the $15.11 banggood offer & hoped to have it in about a week.
Until I had a Sonoff Touch in my hands, this thread was based on my previous experience with Itead products & on what I've seen online about the Sonoff Touch.
For the benefit of others & for my preparation, this thread will aim to document how to use the Sonoff Touch with this forum's home automation programming. I would appreciate feedback from people who have & will try this.
From what I've seen online, Itead makes the Sonoff Touch (like its other products), friendly for reprogramming. So it should be possible to reprogram this product with computourist-derived home automation software like we use on this forum. Once the Sonoff Touch is programmed with this software, one should be able to update programming over WiFi.
Below: IF you have the right wiring, a smart wall switch that would use our forum's home automation software
|
|
|
Post by papa on Sept 22, 2017 19:06:28 GMT
Reprogramming a Sonoff Touch: Shopping List, What Is Needed Besides a Sonoff Touch (& a true mains neutral wire in the switch box):- an FTDI programmer with USB cable which must be able to function at 3.3 volts (much more can damage the Sonoff Touch's processor). I use this FTDI. jimkernsjr uses this FTDI. These header pins will require some soldering, but, given the pin spacing, I don't believe it will be too difficult. We'll need to solder & place these header pins so it's possible to reassemble the Sonoff Touch. - Four short dupont cables (4 colors including red or orange & black or brown), male on one end to connect to the Touch's circuit board & on the other end male or female (as needed) to connect to the FTDI programmer. Short wires help reduce resistance & maximize electrical current available to keep the ESP8285 processor in programming / flashing mode. ^^ updated 9/27/2017- One short dupont cable ( male on one end & female on the other end is needed to connect Sonoff Touch's GPIO-0 to GND. ^^ updated 9/28/2017- You may need 3 machine screws that are 3mm (screw diameter) by 6mm (long) with a shallow head of about 8mm diameter. These are to replace the screw terminals that came too long on my Sonoff Touch. << Added 9/30/2017- Optional: a large electrolytic capacitor (220 microFarads to 1,000 microFarads) can help with reprogramming if a FTDI programmer does not provide enough power. I recommend you have a couple such capacitors on hand. - Optional ( Update, 9/27/2017): - 4 sockets from a break away female header (.1 inch or 2.54mm spacing between pins) I now see that soldering connections is NOT necessary. (See more below) IF you use these, I suggest you buy a long strip of female header pins at the best price & break off a strip of 4 sockets. See this source for examples. In this post, see " break away header strips" for tips on using them. Next: More preparations for reprogramming a Sonoff Touch smart switch
|
|
|
Post by papa on Sept 23, 2017 15:36:24 GMT
Preparing to Program the Itead Sonoff Touch, Continued (Somewhat similar to Preparations for Programming the Itead Slampher) If you have not already done all or some of the following ... Also needed: a computer running a recent version (at least version 1.6.8) of the Arduino IDE. Adapted from what jimkernsjr said here, Install support for the ESP8266-related boards. Follow instructions here ... but stop at the heading "Selecting the ESP8266 Thing Board", you don't need to go any further. After installing support for ESP8266-related boards ... make the proper settings in the Arduino IDE environment. Open Arduino IDE (at least version 1.6.8). -In Tools menu, under boards, scroll down to the ESP8266 boards section, and select "Generic ESP82 85 Board", NOT ESP82 66. This will give you all options! -Don't touch ... CPU frequency, leave at default. ... -Select 1M(128K SPIFFS) from the flash size.
|
|
|
Post by papa on Sept 24, 2017 12:39:17 GMT
I'm waiting for my Sonoff Touch to arrive. I'm also studying online pictures & descriptions about programming the Touch. In preview, we'll likely need to make the following connections between FTDI & the Touch's microprocessor board: (Some soldering required ??) Connect FTDI 3.3 volts to Touch VCC or 3.3 volts Connect FTDI GND to Touch GND Connect FTDI Tx to Touch Rx Connect FTDI Rx to Touch Tx Before connecting FTDI's USB to the programming computer, Connect FTDI GND to Touch GPIO-0 (zero) (Then when the Touch's ESP8285 boots into programming / flashing mode, then this connection can be removed.) It looks like Banggood's promotional sale of Sonoff Touch may end in 13 hours. See here.
|
|
|
Post by papa on Sept 27, 2017 18:26:13 GMT
From banggood.com, I ordered a U.S. style Sonoff Touch smart wall switch (USD $15.11 total) on Sept. 20 & it arrived today from California. As of today, the cost is still $15.11, 3-7 days from a U.S. warehouse ($11.65 if you wait longer) & I no longer see a countdown timer for the end of the offer. I've opened the Sonoff Touch & I'm preparing to re-program it with our forum's software. Studying the Touch's insides, I now see soldering connections is NOT required. (more on this later) Required parts (the Dupont cables) & optional parts changed on 9/27 AND 9/28/2017 in the post above. IF you solder connectors for re-programing the Sonoff Touch, I recommend female header sockets instead of male header sockets. ( See the end of this post.) Today (9/28/2017) I successfully programmed a Sonoff Touch with this forum's software & will proceed to describe what worked for me.
|
|
|
Post by papa on Sept 28, 2017 23:54:28 GMT
Open Sonoff Touch's Case & Expose Circuit Boards, Revised 9/30/2017Note: My Sonoff Touch differs somewhat from online pictures & descriptions, but that online info still helped. My Touch is for U.S. installation. Your Touch may differ from mine, but my documentation below may still be useful. Be careful with the front touch panel (made of glass). Until you install the Touch, leave on the front panel's thin, plastic covering. As you do the following, note how the front touch panel & the other 2 layers should snap back together later. See the image below. Orient the Touch like the image (Touch's back with its label text upside down, "notches" to the right). At the lower right, cut the flimsy seal, but leave the seal's pieces on the case. Near the bottom, remove the 3 brass terminal screws & be ready to replace them with shorter screws ( see "3 machine screws" here.). Three layers snap together near the outside 4 edges. Separate the top 2 layers from the front panel: Gently twist a flat screwdriver blade alternately in the 2 "small notches" on the right (NOT the larger middle notch). You might use a thin blade to further open the "seam" that starts opening on the right. You might also lift on the "box" labelled "Electronics Compartment." < Click on image for larger view, updated 10/1/2017When the Touch's front glass panel comes free from the other 2 layers, set it aside in a safe place. Opening Sonoff Touch's Case Continues
|
|
|
Post by papa on Sept 29, 2017 0:11:03 GMT
Opening Sonoff Touch's Case to Expose the Circuit BoardsSet the electronics compartment on its back that is labelled with Lin (Line In), etc. See the first picture below: Now on top will be a green rectangular circuit board (CB) which contains a smaller raised, white rectangle (the large LED night light that will shine through the front panel). That raised white rectangle also seems to have glass so be gentle & protective with it. In the pic, see that my circuit board (CB) is labelled Sonoff Touch US WiFi Ver 1.0 2016-8-19. Near that label are 4 pins. Gently lift the "top" CB to free those 4 pins from their sockets. Gently swing the CB up like a hinge & on the opposite side of the CB, gently cut the CB free from the tape holding it to the case. See the next pic. << After separating the 2 boards, set aside this larger board & its compartment. For here on, we work with only the smaller board. Next: Preparing to Connect the Sonoff Touch CB for programming
|
|
|
Post by papa on Sept 29, 2017 14:35:51 GMT
Preparing to Program the Sonoff Touch Smaller Circuit Board, ContinuedCautions: Make sure the FTDI programmer is in 3.3 volt mode. Using the dupont cables, make a DIY 4-wire cable ready to achieve the following connections (& like the pics below): In order, starting at "square" hole, Sonoff Touch holes on strip to be connected to FTDI's 3V3 (VCC) ........................................... VCC Rx ..................................................... Tx Tx ..................................................... Rx GND ................................................... GND < Click on pics for larger view In each picture ... on the right: FTDI programmer & its USB cable left: taped together & labelled cable ends for Touch's programming strip Below: Preparing to Connect GPIO-0 to GND To Put Sonoff Touch into Programming / Flashing Mode
|
|
|
Post by papa on Sept 29, 2017 21:09:56 GMT
Preparing to Connect GPIO-0 to GND To Put Sonoff Touch into Programming / Flashing Mode << Click on pic for larger view. In this pic, see the 2 locations for connecting to GPIO-0 (a circuit board trace runs between them) & a view of the dupont cable for connecting GPIO-0 to Gnd. My preferred connection to GPIO-0 is (with the PSF-A label so you can read it) on the right side of the metal PSF-A shield, the 2nd solder pad from the bottom. The dupont cable female is on the pin labelled GND in the circuit board's 4 pin cluster. When the cable's male pin is held to the GPIO-0 connection WHILE the FTDI programmer is plugged into the computer's USB, the Sonoff Touch should enter programming / flashing mode to receive new firmware. In the pic above, the strip of programming holes (for the 4-pin cable) is on the left side of the circuit board. Below: Connecting the Programming Cable to the Sonoff Touch Circuit Board & Programming the Sonoff Touch with ANY New Firmware
|
|
|
Post by papa on Sept 29, 2017 21:24:39 GMT
Connecting the Programming Cable to the Sonoff Touch Circuit Board & Programming the Sonoff Touch with ANY New FirmwareThe circuit board's bottom (same side as the PSF-A label) has room to solder breakaway female header sockets & still re-install the circuit board. ( See this post about using break aways.) However ... Though awkward, you could avoid soldering with a method like jimkernsjr used: ( Again, the FTDI programmer is in 3.3 volt mode.) Have the new firmware programming opened in Arduino IDE. (This could be any new firmware. The next post has the firmware we use on this forum). Image A) Image B) Image C) As in image A), with the PSF-A label on top, insert the 4 cable pins (2) into the bottom of the circuit board (CB) programming holes, Gnd in Gnd, VCC in 3v3. If you made your 4-pin cable as above, Rx & Tx pins should be positioned correctly. As in image B), use something (like my clothespin or a rubber band) to stabilize the pins in the holes. If needed, with tape, protect the pins from touching the PSF-A's metal shield. Also as in image B), put the extra dupont cable's female on the GND pin of the CB's 4-pin cluster. Again in image C), see the 2 locations where one can connect to GPIO-0 (a CB trace runs between them) & another view of the dupont cable for connecting GPIO-0 to Gnd. My preferred connection to GPIO-0 is (with the PSF-A label so you can read it) on the right side of the metal shield, the 2nd pad from the bottom. Put the CB on the edge of a table top with the programming cable pins to the outside & pointing up. Then plug the FTDI programmer's USB cable into the computer. In the Arduino IDE tools/port menu, select the (Com) port your FTDI programmer uses when connected to USB. Put the cursor over the Arduino IDE's upload button. Then UN-plug the FTDI programmer from the computer's USB. The next step starts like the last step, but goes further: Put the CB on the edge of a table top with the programming cable pins to the outside & pointing up. Have one hand's middle finger press the CB to the table & with the same hand's thumb & pointer finger hold the spare dupont cable male pin against the GPIO-0 connection. << WHILE doing this, have your other hand plug the FTDI programmer's USB cable into the computer. If successful, this will GND GPIO0 & the small LED will NOT (faintly) flash & the device will be in programming mode. Now you can remove the pin from GPIO-0. Start the Arduino IDE compiling & uploading the sketch. Repeat this process until uploading is successful. PS You might use another clothes pin or rubber band to hold the dupont male pin against the GPIO-0 connection. A later post will describe reassembling & installing the re-programmed Sonoff Touch.
If you have trouble programming the Sonoff Touch with new firmware, see this post.
|
|
|
Post by papa on Sept 30, 2017 14:56:09 GMT
Programming the Sonoff Touch with This Forum's Firmware ESP82xx_Devices.ino (22.54 KB) TouchPorch41.h (2.22 KB) << Download & install so these two files are in the same Arduino IDE sketch folder. I renamed jimkernsjr's ESP_SonoffAndEcoPlug.ino to ESP82xx_Devices.ino & added an UNcommented, active include (TouchPorch41.h) for a Sonoff Touch customization. In TouchPorch41.h, I set node 41, not OnAtPowerup, etc. EnToggle is left UNdefined since a Sonoff Touch is not a motion light. See jimkernsjr's thread for more about the options & also more GitHub files for other devices. So far, for the Sonoff type devices, Itead seems to use the same GPIOs for button (0), relay (12), & LED (13). Thus the Sonoff Touch uses the same pins as Sonoff Singles. BTW for a helpful database of smart devices & their GPIO pins for button, relay, & LED, see here AND here. Programming the Sonoff Touch with This Forum's Firmware, Continues Below
|
|
|
Post by papa on Sept 30, 2017 15:04:39 GMT
Programming the Sonoff Touch with This Forum's Firmware, ContinuedOpen ESP82xx_Devices.ino (downloaded above) with Arduino IDE. TouchPorch41.h should also open in another tab. Customize TouchPorch41.h with your WiFI SSID, WiFi password, & IP of the computer running your MQTT server. Follow this post's instructions to upload this firmware to the Sonoff Touch. If you have trouble programming the Sonoff Touch with new firmware, see this post. After the upload finishes successfully, unplug from USB (UNpower the board). Then reconnect the USB (power the board). The LED should flash once & then stay on steady indicating the Sonoff Touch has connected to your local WiFi network & MQTT. Sometimes, we may need to reboot our WiFi router in order for the Sonoff Touch to connect to the network. The following pictures my Arduino IDE Serial Monitor results at this point ... < click on pic for larger results. You should not need to program the Sonoff Touch with the wires any more. You can now remove the FTDI programmer & dupont cable connections. Then reassemble & install the Sonoff Touch as below. Via my local network router's settings, I give Sonoff Touches permanent IP addresses. That might make them more likely to reconnect automatically after a power outage. To reprogram this Sonoff Touch "Over the Air" ( via the WiFi connection), the wall switch box holding the Sonoff Touch must be powered. Also for the following to work, you'll likely need to close & reopen the Arduino IDE. In the IDE's tools/port menu, see & select this node's OTA name (TouchPorch41). Make your desired changes in the header file for this node (TouchPorch41.h). Upload the changed package. To reprogram firmware on other Sonoff Touches, use an editor like Notepad++ to copy, customize (node ID, etc), & rename the TouchPorch41.h file accordingly. Edit ESP82xx_Devices.ino: Comment out (//) #include "TouchPorch41.h" AND add a new UNcommented include line for the next Sonoff Touch's .h header file. Repeat the steps above for flashing the firmware on the next Sonoff Touch.
|
|
|
Post by papa on Sept 30, 2017 15:36:55 GMT
Having Trouble Programming New Firmware on a Sonoff Touch ??Make sure you make the right connections between the FTDI programmer & the Sonoff Touch Circuit Board AND between GPIO-0 & GND. Make sure you hold the grounding wire's male pin securely to GPIO-0 just before & just after you connect the FTDI programmer to the computer's USB port. A sufficient, reliable power supply is critical to this operation. Perhaps with a clothes pin or rubber band, keep dupot cable pins stay securely positioned in the Sonoff Touch programming holes. Your FTDI programmer may not have sufficient power to complete this operation. In another thread, I described to andies a way to overcome this & andies documented it this way ... FTDI Arduino USB-TTL (->Arduino IDE) Sonoff Touch ------------------------------------------------------------------------ 3.3V (not 5V) ................. not connected ......................... 3v3 GND ............................... GND ...................................... GND not connected ................... Tx ......................................... Rx not connected ................... Rx ......................................... Tx Following the above table, disconnect the 3.3 volt wire from the FTDI programmer & instead connect it to an ( UNpowered) Arduino's 3.3 volt socket. Connect the Sonoff Touch's Gnd hole to GND on BOTH FTDI & Arduino. Leave Rx & Tx connected as before between FTDI & Sonoff Touch programming holes. Then use a rubber band or clothes pin to hold the Gnd wire to GPIO-0. Then power the Arduino. Then plug the FTDI into the computer. Now use the Arduino IDE to upload the new firmware. - You may need 3 machine screws that are 3mm (screw diameter) by 6mm (long) with a shallow head of about 8mm diameter. These are to replace the screw terminals that came too long on my Sonoff Touch. << Added 9/30/2017Ahead: Using the Re-Programmed Sonoff Touch with OpenHAB Reassembling & Installing the Sonoff Touch
|
|
|
Post by papa on Oct 1, 2017 20:14:02 GMT
Using the Re-Programmed Sonoff Touch with OpenHABThe following assumes a computer (possibly a Raspberry Pi) that hosts MQTT & OpenHAB. For help installing those, see here. As above, you might program a Sonoff Touch as Node41 & use it to control a wall switch for the porch. Here are OpenHAB entries to accomplish that: (For these to work, the Sonoff Touch must be powered & connected to your WiFi network. Out of the wall switch box, the Touch could be powered by an FTDI programmer connected to USB or by another 3.3 volt power supply like an Arduino. In the wall switch box, the Sonoff Touch must be powered from the circuit breaker box.) .items file Switch Act_Node41 { mqtt="<[mosquitto:home/esp_gw/nb/node41/dev16:state:default::]", mqtt=">[mosquitto:home/esp_gw/sb/node41/dev16:command:*:default]" } .rules file rule "Random timer for Porch Output ON around 8:26pm" // Porch Activity on (Node41) when Time cron "0 21 20 * * ?" then // Schedule a random ON event up to 15 minutes from now createTimer(now.plusMinutes((new java.util.Random).nextInt(15)) ) [| sendCommand(Act_Node41, ON) ] end rule "Random timer for Porch Output OFF around 8:42pm" // Porch Activity done (Node41) when Time cron "0 37 20 * * ?" then // Schedule a random OFF event up to 15 minutes from now createTimer(now.plusMinutes((new java.util.Random).nextInt(15)) ) [| sendCommand(Act_Node41, OFF) ] end .sitemap file Switch item=Act_Node41 label="Porch41"
|
|
|
Post by papa on Oct 1, 2017 20:19:55 GMT
Once the above is accomplished ... To toggle the porch light (or other appliance) on or off, one can use the Sonoff Touch touch plate OR use the virtual switch on the OpenHAB User Interface. The first rule above will turn on the light semi-randomly between 8:21pm & 8:36pm. The second rule will turn off the light semi-randomly between 8:37pm & 8:52pm. For help interpreting the above OpenHAB entries see this thread. Ahead: Reassembling & Installing the Sonoff Touch
|
|
|
Post by papa on Oct 2, 2017 21:26:43 GMT
Before Reassembling the Sonoff Touch Make Sure It Will Probably WorkConnect your smaller Sonoff Touch circuit board how you did to program it: home made 4 pin programming cable in the Touch's correct programming holes, (possibly 3.3 volts & GND from an Arduino), & FTDI programmer connected to the USB of a computer running Arduino IDE. When you open the IDE's Serial Monitor, you should get results similar to mine in this post. If you do not get results similar to mine, you probably need to use the programming cable to try again on re-programming the Sonoff Touch circuit board. Ahead: Reassembling & Installing the Sonoff Touch
|
|
|
Post by papa on Oct 2, 2017 21:32:31 GMT
Start Reassembling the Sonoff Touch, Step by Step
Once uploading new firmware to the Touch is successful (as above), start reassembling the Sonoff Touch: I recommend you do the following step by step (of course adapting as needed) so you will not need to undo assembly.
With all programming wires removed, insert the smaller circuit board's 4 pin cluster into the larger circuit board's sockets. << Be careful with this. Look under the board to make sure you did not (as I did) have 2 pins plugged into the wrong sockets & the other 2 pins were along side the sockets. As needed, tape the other side of the smaller circuit board to the case.
Do NOT snap the Sonoff Touch's front panel to the other parts yet.
A preparation to improve reassembly & installation: For installing the Sonoff Touch into the wall switch box, my original 3 brass terminal screws are too long & the plastic holes around them are too small so when the wiring is installed in the terminals, the Sonoff Touch will not snap into the frame-shaped mounting plate.
I replaced the original 3 screw terminals with machine screws that are 3mm (screw diameter) by 6mm (long). (My new screw head with 8mm diameter has a button socket so I needed a small metric allen wrench to tighten the screws). I used a utility knife's tip to enlarge the curved end of the plastic hole so the screw's head can go totally below the top of the plastic hole. << This is needed so the Touch's top 2 layers will snap all the way into the framed-shaped mounting plate.
Ahead, More Preparations for Reassembling & Installing the Sonoff Touch
|
|
|
Post by papa on Oct 3, 2017 18:40:54 GMT
More Preparations for Reassembling & Installing the Sonoff TouchAgain, for installing a working Sonoff Touch, it needs a wall switch box that has both a mains hot wire AND a true neutral wire. See this post. Check & prepare the wall switch box's wiring. As indicated in this post, turn OFF the switch at the circuit breaker. Remove the existing wall switch. If there is a white green or bare ground wire, push it compactly to the back of the wall switch box. Note the two wires (black?) that were connected to the old switch. Notice these "hot" wires that must be connected correctly to terminals labelled Lin & Lout on the back of the Sonoff Touch. While the circuit breaker switch is OFF AND all programming wires are off the Touch, check the wires in the wall switch box: When (later) the Touch's terminal holes will be a little outside the switch box opening, are wires just long enough to reach the terminal holes & not so long they will resist the Touch's going fully into the wall switch box. To be able to connect the Touch's Nin terminal, do you need to add another true mains neutral wire (white?)? Are ends of all 3 wires bared to the metal for just for the depth of the Touch's terminal holes & insulation will cover wires above the holes? << Check & correct as needed. While the circuit breaker switch is still OFF, using the (new) mains terminal screw on the Sonoff Touch's back, connect a true neutral wire (white?) to Nin. To the Lin terminal, connect the hot wire (black?) coming from the circuit breaker box. (The following tells how to know the right wire.) When the old switch is out & the circuit breaker switch is on, ( be careful!) a non-contact voltage tester can tell you which hot wire is "live" & thus comes from the circuit breaker box. IF you do not have a tester, find the right wire this way: While the circuit breaker switch is OFF, pick one hot wire (black?) to connect to Lin. Then turn on the circuit breaker switch. If the Sonoff Touch now has power, the small LED flashes under the front panel's WiFi symbol, etc. If the Touch has power, you picked the correct wire so mark it somehow & turn off the circuit breaker switch. If the Sonoff Touch does NOT have power, turn OFF the circuit breaker & connect the other (black?) wire to LIN. Temporarily turn on the circuit breaker. If the Touch has power, you know the right wire for LIN. Turn OFF the circuit breaker & mark the correct wire for Lin. For now, remove all wires from the Sonoff Touch.
By this point, if the Touch does NOT have power, recheck your work. For one thing, make sure the cluster of 4 pins on the Touch's smaller circuit board are all correctly in the larger circuit board's sockets. Next: How to Position a Working Sonoff Touch in the Wall Switch Box
|
|
|
Post by papa on Oct 3, 2017 19:20:51 GMT
How to Position Sonoff Touch in the Wall Switch BoxThe center of one short side of the Sonoff Touch has a larger "tab" (See Image 1) that fits into a larger "notch" in the front plate. Note which way to position that tab on the wall switch box opening to make the shortest distance between the switch box wires & the Touch's terminal holes. << Image 1, click on for larger view If not done already, separate the frame-shaped mounting plate (see Image 2) from the front touch panel. You can start this by twisting a flat screwdriver blade under the mounting plate's large tab on one short side. << Image 2, click on for larger view Using what you learned in the post just above, position the mounting plate's "tab" on the wall switch box's opening with the mounting plate's "flatter" side facing out. Using holes in the mounting plate & screws from the old wall switch, mount the plate against the wall switch box opening so that the plate's "flatter" side is out & facing you. Also position the mounting plate so it's 4 small, rectangular holes are not obstructed. The Touch's middle layer has protruding tabs that snap into those rectangular holes. Ahead: Install Mains Wires, Reassemble Sonoff Touch, Install Touch into Switch Box
|
|
|
Post by papa on Oct 4, 2017 20:41:49 GMT
Install Mains Wires, Reassemble Sonoff Touch, & Install Touch into Switch BoxBe sure the circuit breaker box switch for this wall switch box is OFF. Matching the mounting plate's large tab & the middle layer's large notch, hold the labelled back of the Touch near the wall switch box opening. Insert the true mains neutral wire into the Nin hole & tighten the terminal screw. Into Lin, insert the hot wire you marked as coming from the circuit breaker box & tighten the screw. Insert the other hot wire into Lout & tighten the screw. Before final insertion of the Touch into the switch box, test your work: Matching the large tab & notch, & starting on the opposite short side, snap the Touch's front panel SECURELY over the circuit boards. Turn ON the circuit breaker supply to the wall switch box. ( Be careful not to touch powered wires or terminal screw heads.) Is the Sonoff Touch getting power (LED on)? When you touch the front panel does it toggle the light or other appliance controlled by the switch? If not, check your work. This post has another way to test your re-programmed Sonoff Touch. When everything works, turn OFF the circuit breaker switch. Now while matching tab & notches (& starting opposite to the tab), snap the joined front panel / circuit board layer SECURELY & completely into the mounting plate. Turn ON the circuit breaker box switch & enjoy your Sonoff Touch. You may now remove the thin plastic from the front touch panel. Over the Air Programming via WiFI Again, if your Sonoff Touch is powered & connected to your WiFI, you can change its programming / firmware while it is still in the wall switch box. See this post for more about this. Next: Another Way I Tested MY Re-Programmed Sonoff Touch
|
|
|
Post by papa on Oct 5, 2017 14:07:26 GMT
Another Way I Tested MY Re-Programmed Sonoff TouchNot having a suitable wall switch box yet (no true mains neutral wire), I tested my re-programmed Sonoff Touch this way: I have an old two-pronged extension cord whose female socket is cut off. I bared the female end's wires & installed them in the Touch's Lin (mains' line or hot coming in) & Nin (mains' neutral coming in) terminals. Note: The extension cord prong that goes into the smaller female outlet hole will carry mains line or hot. The bared wire connected to that prong should go in the Sonoff Touch's Lin terminal. The prong that goes into the larger female outlet hole will carry mains neutral. The bared wire connected to that prong goes in the Nin terminal.Properly orienting the extension cord's prongs (see blue text just above), I plugged the cord into an electrical outlet ( being careful of the now powered wires & terminal screws). After a short time, the Sonoff Touch's LED under the front panel's WiFI symbol blinked (looking for WiFI connection) then lit steady (connected to WiFi & to MQTT on the host computer). When I touched the front panel, the large front circle lit & I heard the relay close. When I touched the front panel again, the large circle went dim & I heard the relay open. From this post, I successfully used the OpenHAB items file & sitemap file entries. From the sitemap, I could toggle the relay state of the Sonoff Touch. When I used the Touch's front panel to toggle the relay, the resulting state displayed on the sitemap. When wired within a suitable wall switch box, my re-programmed Sonoff Touch should work.
|
|