Last active
January 1, 2022 11:35
-
-
Save jonlachmann/ed792797c83fe3d2d8dc06fac0a47936 to your computer and use it in GitHub Desktop.
Nedis 16A WiFi Smart Plug ESPHome configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: nedis-16a | |
esp8266: | |
board: esp01_1m | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
ota: | |
password: "b00b5e84777a5024832203f24fad2b3b" | |
wifi: | |
ssid: YOURSSID | |
password: YOURPASSWORD | |
# Enable fallback hotspot (captive portal) in case wifi connection fails | |
ap: | |
ssid: "Nedis-16A Fallback Hotspot" | |
password: "abc123" | |
captive_portal: | |
output: | |
- platform: gpio | |
id: led1 | |
pin: | |
number: GPIO1 | |
inverted: true | |
sensor: | |
- platform: hlw8012 | |
sel_pin: | |
number: 12 | |
inverted: true | |
cf_pin: GPIO04 | |
cf1_pin: GPIO05 | |
current: | |
name: "Current" | |
accuracy_decimals: 3 | |
voltage: | |
name: "Voltage" | |
accuracy_decimals: 0 | |
filters: | |
# Map from sensor -> measured value | |
- calibrate_linear: | |
- 0.0 -> 0.0 | |
- 266.1 -> 231.5 | |
power: | |
name: "Power" | |
accuracy_decimals: 1 | |
energy: | |
name: "Energy" | |
accuracy_decimals: 2 | |
update_interval: 10s | |
binary_sensor: | |
# Binary sensor for the button press | |
- platform: gpio | |
name: Button | |
pin: | |
number: GPIO0 | |
inverted: true | |
mode: INPUT_PULLUP | |
on_press: | |
- switch.toggle: relay | |
switch: | |
- platform: gpio | |
name: "Switch" | |
id: relay | |
pin: GPIO14 | |
on_turn_on: | |
- output.turn_on: led1 | |
on_turn_off: | |
- output.turn_off: led1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment