Skip to content

Instantly share code, notes, and snippets.

@rufik
Last active February 7, 2020 20:12
Show Gist options
  • Save rufik/4c23eb83912f7d109930ea829cc8d9d6 to your computer and use it in GitHub Desktop.
Save rufik/4c23eb83912f7d109930ea829cc8d9d6 to your computer and use it in GitHub Desktop.
SmartDGM PP-W162 smart outlet configuration for ESPHome 1.4.x
esphome:
name: smartdgm_outlet
platform: ESP8266
board: esp01_1m
wifi:
ssid: .....
password: .....
logger:
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO3
mode: INPUT_PULLUP
inverted: true
name: "SmartDGM Button"
on_press:
- switch.toggle: relay
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: true
cf_pin: 4
cf1_pin: 5
current:
name: "SmartDGM Current"
accuracy_decimals: 1
voltage:
name: "SmartDGM Voltage"
accuracy_decimals: 1
power:
name: "SmartDGM Power"
accuracy_decimals: 1
update_interval: 30s
voltage_divider: 788
current_resistor: 0.00245
change_mode_every: 3
- platform: wifi_signal
name: "SmartDGM WiFi RSSI"
update_interval: 60s
- platform: uptime
name: "SmartDGM uptime"
switch:
- platform: gpio
name: "SmartDGM Led"
id: led
pin:
number: GPIO13
inverted: true
icon: "mdi:led-on"
- platform: gpio
name: "SmartDGM Switch"
pin: GPIO14
id: relay
icon: "mdi:power-socket-fr"
on_turn_on:
- switch.turn_on: led
on_turn_off:
- switch.turn_off: led
# status_led:
# pin:
# number: GPIO13
# inverted: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment