Hier ein Beispiel ESPHome-Programm für die Gosund SP1 Steckdose OHNE USB.
Alle Standardfunktion sind gegeben
configuration.yaml
1substitutions:
2 plug_name: HIER DER NAME
3 # Higher value gives lower watt readout
4 current_res: "0.00221"
5 # Lower value gives lower voltage readout
6 voltage_div: "920"
7
8esphome:
9 name: HIER DER NAME
10 platform: ESP8266
11 board: esp8285
12
13wifi:
14 networks:
15 - ssid: "WLAN"
16 password: "WLAN PW"
17
18 ap:
19 ssid: "access point daten"
20 password: "AC PW"
21
22captive_portal:
23
24logger:
25
26api:
27
28ota:
29
30# Enable Web server
31web_server:
32 port: 80
33
34time:
35 - platform: homeassistant
36 id: homeassistant_time
37
38
39binary_sensor:
40 # Binary sensor for the button press
41 - platform: gpio
42 name: "${plug_name}_button"
43 pin:
44 number: GPIO3
45 inverted: true
46 on_press:
47 - switch.toggle: relay
48
49
50
51switch:
52 - platform: gpio
53 id: relay
54 name: "${plug_name}_Relay"
55 restore_mode: ALWAYS_OFF
56 pin: GPIO14
57 on_turn_on:
58 - light.turn_on: led
59 on_turn_off:
60 - light.turn_off: led
61sensor:
62 - platform: hlw8012
63 sel_pin:
64 number: GPIO12
65 inverted: True
66 cf_pin: GPIO04
67 cf1_pin: GPIO05
68 current_resistor: ${current_res}
69 voltage_divider: ${voltage_div}
70 current:
71 name: "${plug_name}_Amperage"
72 unit_of_measurement: A
73 voltage:
74 name: "${plug_name}_Voltage"
75 unit_of_measurement: V
76 power:
77 name: "${plug_name}_Wattage"
78 unit_of_measurement: W
79 id: "${plug_name}_Wattage"
80 change_mode_every: 8
81 update_interval: 10s
82 - platform: total_daily_energy
83 name: "${plug_name}_Total Daily Energy"
84 power_id: "${plug_name}_Wattage"
85 filters:
86 # Multiplication factor from W to kW is 0.001
87 - multiply: 0.001
88 unit_of_measurement: kWh
89
90# Extra sensor to keep track of plug uptime
91 - platform: uptime
92 name: ${plug_name}_Uptime Sensor
93
94 - platform: wifi_signal
95 name: "LED Schuppen WiFi Signal"
96 update_interval: 60s
97
98output:
99 # Relay state led
100 - platform: esp8266_pwm
101 id: state_led
102 pin:
103 number: GPIO1
104 inverted: true
105
106light:
107 # Relay state light
108 - platform: monochromatic
109 output: state_led
110 id: led
111
112# Uses the red LED as a status indicator
113status_led:
114 pin:
115 number: GPIO13
116 inverted: true
