michel72
(Michel - espthings.io)
March 16, 2019, 9:04pm
1
Took me a little while to get it right, so I’m sharing it with you guys:
Buy, Tuya convert it and use with esphome!
Slitinto NX-SP2021:
Slitinto WLAN Smart Steckdose Intelligente Plug Wifi Steckdose,funktioniert mit Google Home und IFTTT, Kein Hub erforderlich, separat mit App Steuerung jederzeit und überall 16A - 2 Packs: Amazon.de: Baumarkt
Digoo DG-SP202:
Config:
esphome:
# Digoo DG-SP202 wifi plug with power monitoring
name: digoo01
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret esphome_wifi_ssid
password: !secret esphome_wifi_password
api:
password: !secret esphome_api_password
ota:
password: !secret esphome_ota_password
logger:
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: hlw8012
sel_pin:
number: GPIO16
inverted: True
cf_pin: GPIO5
cf1_pin: GPIO14
current_resistor: 0.00221 ## Higher value gives lower watt readout
voltage_divider: 896 ## Lower value gives lower voltage readout
current:
name: "Digoo01 amperage"
unit_of_measurement: A
voltage:
name: "Digoo01 voltage"
unit_of_measurement: V
power:
name: "Digoo01 wattage"
unit_of_measurement: W
id: "wattage"
change_mode_every: 8
update_interval: 30s
- platform: total_daily_energy
name: "Digoo01 daily power usage"
power_id: "wattage"
filters:
- multiply: 0.001 ## Multiplication factor from W to kW is 0.001
unit_of_measurement: kWh
binary_sensor:
- platform: gpio
pin:
number: 13
mode: INPUT_PULLUP
inverted: true
name: "Digoo01 button-1"
on_press:
- switch.toggle: relay1
- platform: gpio
pin:
number: 4
mode: INPUT_PULLUP
inverted: true
name: "Digoo01 button-2"
on_press:
- switch.toggle: relay2
- platform: status
name: "Digoo01 Status"
switch:
- platform: gpio
name: "Digoo01 Plug 1"
pin: GPIO15
id: relay1
- platform: gpio
name: "Digoo01 Plug 2"
pin: GPIO12
id: relay2
3 Likes
Nuick
March 21, 2019, 10:08am
2
Thanks for the how-to !
I just received a DG-SP202 and I will try to flash it very soon
Klagio
(Klagio)
March 22, 2019, 7:52am
3
michel72:
Buy, Tuya convert it
is it difficult to flash it?
michel72
(Michel - espthings.io)
March 24, 2019, 6:10am
4
You have to use tuya convert (once). I would say it’s fairly easy.
1 Like
Klagio
(Klagio)
March 24, 2019, 7:01am
5
Pretty cool.
Is smart life the app of Tuya based products?
On amazon its full of those smart plugs, like this one
Ciabatta Multipresa, Houzetek Presa Intelligente Smart Wifi Plug Supporta App Alexa / Google Home/ IFTTT, Ciabatta Elettrica Con Interruttore Con 4 Prese Polivalenti e 3 Prese Usb,Wifi 2.4G. https://www.amazon.it/dp/B07H5JVF4R/ref=cm_sw_r_cp_apa_i_6QYLCbY05KCAP
michel72
(Michel - espthings.io)
March 24, 2019, 7:23am
6
Don’t know, don’t use it I convert. I don’t want any Chinese cloud stuff on my network.
Take a look at the supported devices page.
michel72
(Michel - espthings.io)
March 24, 2019, 7:28am
7
I got this one for EURO 17,94. As soon as it arrives, I’ll convert it, i’ll get it to work somehow and post the config
After having multiple fails with a tasmota build this worked instantly!!!
Could you help me point me in the right direction to get a usable HA desktop layout? All i can see is 9.8A usage (while the device has nothing connected) and i have to add everything one by one ?!
Klagio
(Klagio)
April 12, 2019, 5:45pm
9
Mine arrived now, did yours ? Any problem with tuya convert? I try now
michel72
(Michel - espthings.io)
April 12, 2019, 6:14pm
10
Please post your findings here
Buy, tuya convert, and enjoy!
https://amzn.to/2Tzmacc
single click toggles socket 1
double click toggles socket 2
tripple click toggles socket 3
single long click toggles USB power
There is one little flaw. The blue led turns on when activating any of the sockets. The red led turns on when activating USB power.
I am still looking for a solution to switch the blue_led off if ALL sockets are off.
esphome:
## Zeoota power strip with 3 sockets and USB charging
name: zeoota01
platform…
Klagio
(Klagio)
May 29, 2019, 2:42pm
11
Hi, I converted and upload succesfully ESPHome. One of thje two plug works perfectly , while the other not (neither the switch, nor the binary_sensor)
The below is NOT working
binary_sensor:
- platform: gpio
pin:
number: 4
mode: INPUT_PULLUP
inverted: true
name: "Small oven button"
on_press:
- switch.toggle: relay2
switch:
- platform: gpio
name: "Small oven power plug"
pin: GPIO12
id: relay2
THe below IS working
switch:
- platform: gpio
name: "Micro power plug"
pin: GPIO15
binary_sensor:
- platform: gpio
pin:
number: 13
mode: INPUT_PULLUP
inverted: true
name: "Micro button"
on_press:
- switch.toggle: relay1
Klagio
(Klagio)
May 29, 2019, 3:00pm
12
Below the correct code
sensor:
- platform: hlw8012
sel_pin:
number: GPIO16
inverted: True
cf_pin: GPIO5
cf1_pin: GPIO4
binary_sensor:
- platform: gpio
pin:
number: 0
mode: INPUT_PULLUP
inverted: true
name: "Micro button"
on_press:
- switch.toggle: relay1
- platform: gpio
pin:
number: 16
mode: INPUT_PULLUP
inverted: true
name: "Small oven button"
on_press:
- switch.toggle: relay2
switch:
- platform: gpio
name: "Micro power plug"
pin: GPIO15
id: relay1
- platform: gpio
name: "Small oven power plug"
pin: GPIO14
id: relay2
michel72
(Michel - espthings.io)
May 29, 2019, 6:35pm
13
Both are correct, there is a internal hardware difference. Externally the devices look exactly the same.
Hi! Can you point me to what firmware to flash with Tuya-convert? One of the included sonoff-basic.bin or espurna-base.bin? Or where can I find the ESPHome firmware? Many thanks
I succesfuly converted this device and uploaded the esphome firmware, this configuration worked for me:
esphome:
name: digoo01
platform: ESP8266
board: esp01_1m
wifi:
ssid: "xxxxx"
password: "xxxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Digoo01 Fallback Hotspot"
password: "xxxxxx"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "xxxxx"
ota:
password: "xxxxx"
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO4
cf1_pin: GPIO5
current_resistor: 0.00221 ## Higher value gives lower watt readout
voltage_divider: 779 ## Lower value gives lower voltage readout
current:
name: "Digoo01 Current"
unit_of_measurement: A
voltage:
name: "Digoo01 Voltage"
unit_of_measurement: V
power:
name: "Digoo01 Power Consumption"
unit_of_measurement: W
id: "wattage"
change_mode_every: 8
update_interval: 30s
- platform: total_daily_energy
name: "Digoo01 Daily Power Consumption"
power_id: "wattage"
filters:
- multiply: 0.001 ## Multiplication factor from W to kW is 0.001
unit_of_measurement: kWh
binary_sensor:
- platform: gpio
pin:
number: 16
mode: INPUT_PULLUP
inverted: true
name: "Digoo01 Button Left"
on_press:
- switch.toggle: relayLeft
- platform: gpio
pin:
number: 0
mode: INPUT_PULLUP
inverted: true
name: "Digoo01 Button Right"
on_press:
- switch.toggle: relayRight
- platform: status
name: "Digoo01 Status"
switch:
- platform: gpio
name: "Digoo01 Plug Left"
pin: GPIO14
id: relayLeft
- platform: gpio
name: "Digoo01 Plug Right"
pin: GPIO15
id: relayRight
Klagio
(Klagio)
December 2, 2019, 2:18pm
16
Hi, I installed ESPHome, was not working totallyu ok, but it was, today I tried to upload a changed firmware, but something happened, now I can’t see the plug in my WiFi.
How to make a reset/ put in AP mode? With Sonoff is pressing 4 times the button, but with these plugs?
Or any other way to be able to upload the firmware?
edwinm
(Edwin Martin)
June 20, 2020, 7:26pm
17
I bought a Digoo DG-SP202 in June 2020 and it seems tuya-convert is no longer supported.
When I try to upload firmware with tuya-convert, I get this error message in the file smarthack-web.log:
WARNING: it appears this device does not use an ESP82xx and therefore cannot install ESP based firmware
Sad…
michel72
(Michel - espthings.io)
June 21, 2020, 9:15am
18
Yup, that has been the case with many tuya devices lately.
bcwhite
(Brian White)
July 6, 2020, 2:42am
19
I have a Slitinto NX-SP201 dual-outlet plug. After some experimenting, I’ve found that it’s configuration is:
binary_sensor:
- platform: gpio
pin:
number: GPIO4
inverted: True
name: "${plug_name}_button1"
on_press:
then:
- switch.toggle: "${plug_name}_relay1"
- platform: gpio
pin:
number: GPIO13
inverted: True
name: "${plug_name}_button2"
on_press:
then:
- switch.toggle: "${plug_name}_relay2"
switch:
- platform: gpio
id: "${plug_name}_relay1"
name: "${plug_name}_relay1"
pin: GPIO12
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
id: "${plug_name}_relay2"
name: "${plug_name}_relay2"
pin: GPIO15
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
name: "${plug_name}_led_blue"
pin: GPIO0
inverted: True
restore_mode: RESTORE_DEFAULT_OFF
sensor:
- platform: hlw8012
sel_pin:
number: GPIO3
inverted: True
cf_pin: GPIO5
cf1_pin: GPIO14
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
current:
name: "${plug_name}_current"
unit_of_measurement: A
voltage:
name: "${plug_name}_voltage"
unit_of_measurement: V
power:
name: "${plug_name}_power"
unit_of_measurement: W
id: "${plug_name}_power"
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: "${plug_name}_consumption_today"
power_id: "${plug_name}_power"
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
# Extra sensor to keep track of plug uptime
- platform: uptime
name: ${plug_name}_uptime