-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shelly_2_5
182 lines (155 loc) · 3.54 KB
/
Shelly_2_5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Based on https://devices.esphome.io/devices/Shelly-25
substitutions:
name: "{{name of the device}}"
friendly_name: "{{friendly name}}"
channel_1: Light 1
channel_2: Light 2
max_power: "2000.0"
max_temp: "90.0"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
project:
name: esphome.shelly_2-5_switch-template
version: "1.0"
esp8266:
board: esp01_1m
restore_from_flash: true
preferences:
flash_write_interval: 0s
logger:
api:
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: !secret ap_password
captive_portal:
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
version: 2
local: true
text_sensor:
- platform: wifi_info
ip_address:
name: WiFi - IP-address
ssid:
name: WiFi - Connected SSID
bssid:
name: WiFi - Connected BSSID
mac_address:
name: WiFi - MAC-address
scan_results:
name: WiFi - Latest Scan Results
dns_address:
name: WiFi - DNS Address
sensor:
- platform: wifi_signal
name: "WiFi - Signal"
update_interval: 60s
entity_category: "diagnostic"
### EDIT BELOW THIS LINE ###
- platform: ade7953_i2c
irq_pin: GPIO16 # Prevent overheating by setting this
voltage:
name: Device - Voltage
# On the Shelly 2.5 channels are mixed ch1=B ch2=A
current_a:
name: Device - Current O1
internal: true
current_b:
name: Device - Current O2
internal: true
active_power_a:
name: Device - Power O2
id: power_channel_2
active_power_b:
name: Device - Power O1
id: power_channel_1
update_interval: 30s
- platform: total_daily_energy
name: Device - Power O1 (daily)
power_id: power_channel_1
filters:
# Multiplication factor from W to kWh is 0.001
- multiply: 0.001
unit_of_measurement: kWh
- platform: total_daily_energy
name: Device - Power O2 (daily)
power_id: power_channel_2
filters:
# Multiplication factor from W to kWh is 0.001
- multiply: 0.001
unit_of_measurement: kWh
# NTC Temperature
- platform: ntc
sensor: temp_resistance_reading
name: Device - Temperature
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: "mdi:thermometer"
calibration:
b_constant: 3350
reference_resistance: 10kOhm
reference_temperature: 298.15K
- platform: resistance
id: temp_resistance_reading
sensor: temp_analog_reading
configuration: DOWNSTREAM
resistor: 32kOhm
- platform: adc
id: temp_analog_reading
pin: A0
time:
- platform: sntp
id: my_time
i2c:
sda: GPIO12
scl: GPIO14
status_led:
pin:
number: GPIO0
inverted: yes
output:
- platform: gpio
pin: GPIO4
id: shelly_25_relay_1
- platform: gpio
pin: GPIO15
id: shelly_25_relay_2
light:
- platform: binary
name: Device - Relay O1
output: shelly_25_relay_1
id: lightid1
restore_mode: RESTORE_DEFAULT_OFF
- platform: binary
name: Device - Relay O2
output: shelly_25_relay_2
id: lightid2
restore_mode: RESTORE_DEFAULT_OFF
binary_sensor:
- platform: gpio
pin:
number: GPIO13
name: Device - Button 1
on_state:
then:
- light.toggle: lightid1
- platform: gpio
pin:
number: GPIO5
name: Device - Button 2
on_state:
then:
- light.toggle: lightid2
switch:
- platform: restart
name: "Device - Restart"