summaryrefslogtreecommitdiffstats
path: root/esphome/config/powerplug_awp07l.yaml
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2025-10-22 14:36:08 +0200
committermanuel <manuel@mausz.at>2025-10-22 14:36:08 +0200
commit59bff47792e1e308b04c274d408c5b19c5f9d89a (patch)
tree621bf294ae03344fcf7dda7ee51227d7f6e3e5c2 /esphome/config/powerplug_awp07l.yaml
parent60391c4fb817a825e71d49a15b5a24b158c5d4d5 (diff)
downloadarduino-59bff47792e1e308b04c274d408c5b19c5f9d89a.tar.gz
arduino-59bff47792e1e308b04c274d408c5b19c5f9d89a.tar.bz2
arduino-59bff47792e1e308b04c274d408c5b19c5f9d89a.zip
add power plugs
Diffstat (limited to 'esphome/config/powerplug_awp07l.yaml')
-rw-r--r--esphome/config/powerplug_awp07l.yaml128
1 files changed, 128 insertions, 0 deletions
diff --git a/esphome/config/powerplug_awp07l.yaml b/esphome/config/powerplug_awp07l.yaml
new file mode 100644
index 0000000..08a9e62
--- /dev/null
+++ b/esphome/config/powerplug_awp07l.yaml
@@ -0,0 +1,128 @@
1substitutions:
2 device_name: powerplug-awp07l
3 friendly_name: "Power Plug AWP07L"
4 #current_resistor: 0.001
5 #voltage_divider: 1886
6 current_resistor: 0.000995585395670478
7 voltage_divider: 1913.830752419618
8 current_multiply: 0.8667070272988949
9 # max power is 3450W for 15A and 2300W for 10A
10 max_power: "2300"
11
12esphome:
13 name: ${device_name}
14 friendly_name: ${friendly_name}
15
16esp8266:
17 board: esp01_1m
18
19# Enable logging
20logger:
21 # make RXD / TXD available
22 baud_rate: 0
23
24# Enable Home Assistant API
25api:
26 encryption:
27 key: !secret api_encryption_key
28
29# OTA
30ota:
31 - platform: esphome
32 password: !secret ota_password
33
34# WiFi Credentials
35wifi:
36 domain: .lan
37 ssid: !secret wifi_ssid
38 password: !secret wifi_password
39 # see https://github.com/esphome/issues/issues/1532
40 power_save_mode: HIGH
41
42 # Enable fallback hotspot (captive portal) in case wifi connection fails
43 ap:
44 ssid: "${device_name} Hotspot"
45 password: !secret wifi_ap_password
46
47captive_portal:
48
49binary_sensor:
50 - platform: gpio
51 name: "Button"
52 device_class: power
53 pin:
54 number: GPIO13
55 inverted: true
56 on_press:
57 - switch.toggle: relay
58 internal: true
59
60sensor:
61 - platform: hlw8012
62 model: BL0937
63 sel_pin:
64 number: GPIO12
65 inverted: true
66 cf_pin: GPIO05
67 cf1_pin: GPIO14
68 current_resistor: ${current_resistor}
69 voltage_divider: ${voltage_divider}
70 current:
71 name: "Current"
72 unit_of_measurement: "A"
73 accuracy_decimals: 3
74 icon: "mdi:flash-outline"
75 filters:
76 - multiply: ${current_multiply}
77 - throttle_with_priority:
78 timeout: 10s
79 value:
80 - nan
81 - 0
82 voltage:
83 name: "Voltage"
84 unit_of_measurement: "V"
85 icon: "mdi:flash-outline"
86 filters:
87 - throttle_with_priority:
88 timeout: 10s
89 value:
90 - nan
91 - 0
92 power:
93 name: "Power"
94 unit_of_measurement: "W"
95 icon: "mdi:flash-outline"
96 filters:
97 - throttle_with_priority:
98 timeout: 10s
99 value:
100 - nan
101 - 0
102 on_value_range:
103 - above: ${max_power}
104 then:
105 - switch.turn_off: relay
106 - output.turn_off: led
107 energy:
108 name: "Energy"
109 unit_of_measurement: "Wh"
110 icon: "mdi:flash-outline"
111 update_interval: 1s
112 change_mode_every: 4
113
114switch:
115 - platform: gpio
116 name: "Relay"
117 pin: GPIO15
118 id: relay
119 on_turn_on:
120 - output.turn_on: led
121 on_turn_off:
122 - output.turn_off: led
123
124output:
125 - platform: esp8266_pwm
126 id: led
127 pin: GPIO00
128 inverted: true