Announcement

Collapse
No announcement yet.

WS212 WiFi Dual Plug with Energy Monitoring

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • WS212 WiFi Dual Plug with Energy Monitoring

    Amazon sells a WiFi controlled dual plug that has energy monitoring. https://www.amazon.com/gp/product/B0...0?ie=UTF8&th=1 for $16 and often shows up on Lightning deals. There are others that look similiar. It comes with Tuya firmware which I reflashed to use Tasmota.

    It is similar in size to the Sonoff S31 and has the advantage of dual rather than single plug. Its downsides are 10A vs. 16A for the S31 and no easy way to open up the device.

    This device did not have a standard configuration within Tasmota or Espurna. A new characterization for WS212 was added to http://mcsSprinklers.com/mcsTasmota.zip as version 6.4.1.9. It is similar to the Blitzwolf plug but uses GPIO12 for Relay #1 and GPIO 3 for the BL0937 SEL pin.

    Code:
    { "WS212 Energy",   // WS212 dual plug with energy monitoring (ESP8286 - BL0937 or HJL-01 Energy Monitoring)
         GPIO_LED2_INV,    // GPIO00 Red Led (1 = On, 0 = Off)
         GPIO_USER,        // GPIO01 Serial RXD and Optional sensor
         GPIO_LED1_INV,    // GPIO02 Blue Led (1 = On, 0 = Off)
         GPIO_NRG_SEL_INV,  //BL0937 or HJL-01 Sel output (0 = Voltage)  GPIO_USER,        // GPIO03 Serial TXD and Optional sensor
         0,
         GPIO_HJL_CF,      // GPIO05 BL0937 or HJL-01 CF power
                           // GPIO06 (SD_CLK   Flash)
                           // GPIO07 (SD_DATA0 Flash QIO/DIO/DOUT)
                           // GPIO08 (SD_DATA1 Flash QIO/DIO/DOUT)
         0,                // GPIO09 (SD_DATA2 Flash QIO or ESP8285)
         0,                // GPIO10 (SD_DATA3 Flash QIO or ESP8285)
                           // GPIO11 (SD_CMD   Flash)
         GPIO_REL1,        // GPIO15 Relay (0 = Off, 1 = On)  GPIO_NRG_SEL_INV, // GPIO12 BL0937 or HJL-01 Sel output (0 = Voltage)
         GPIO_KEY1,        // GPIO13 Button
         GPIO_NRG_CF1,     // GPIO14 BL0937 or HJL-01 CF1 current / voltage
         GPIO_REL2,        // GPIO15 Relay (0 = Off, 1 = On)
         0, 0
      }
    Each of the two plugs can be independently turned on and off. Energy monitoring is for the total utilized by both plugs. MQTT reporting for STATE and SENSOR are shown below: The plug takes up one position in the wall plug so the other wall plug can still be used. The right side of WS212 plugs into the wall and the left overhangs to the left of the wall plate. One button is used for local control of the left plug when running Tasmota.

    Energy/STATE = {"Time":"1970-01-01T00:30:14","Uptime":"0T00:30:14","Vcc":3.456,"SleepMode":" Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","POWER2":"ON ","Wifi":{"AP":1,"SSId":"Anthem","BSSId":"E0:3F:49:9D:B9:68" ,"Channel":8,"RSSI":66}}

    Energy/SENSOR = {"Time":"1970-01-01T00:30:14","ENERGY":{"TotalStartTime":"2019-02-23T22:32:45","Total":0.002,"Yesterday":0.000,"Today":0.002," Period":0,"Power":1,"ApparentPower":7,"ReactivePower":7,"Fac tor":0.18,"Voltage":128,"Current":0.056}}
    Click image for larger version

Name:	Capture.PNG
Views:	13
Size:	34.8 KB
ID:	1287476

    There is one uncommitted GPIO (GPIO 1). GPIO 4 appears to have a solder pad, but I did not see a trace for the ESP8266 to it. Since the device is very hard to open the extra GPIO does not have much practical use. The digital part of the item is on a circuit card of 3/4" by 5/8" including the WiFi antenna. It stands off from the main circuit card that holds all of the mains voltage components, power supply, and relays. It has a MOV so considerations have been given to power surges. What I did not recognize is any transformer to step the voltage down.

    Click image for larger version

Name:	20190223_164359.jpg
Views:	9
Size:	83.4 KB
ID:	1287477
Working...
X