-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.device-shelly-25.yaml
121 lines (110 loc) · 2.86 KB
/
.device-shelly-25.yaml
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
esphome:
name: ${devicename}
platform: ESP8266
board: esp01_1m
comment: ${devicetype}
logger:
i2c:
sda: GPIO12
scl: GPIO14
sensor:
- platform: ade7953
irq_pin: GPIO16 # Prevent overheating by setting this
voltage:
name: ${friendly_name} Voltage
# On the Shelly 2.5 channels are mixed ch1=B ch2=A
#current_a:
# name: ${friendly_name} Current B
#current_b:
# name: ${friendly_name} Current A
active_power_a:
name: ${friendly_name} Power B
unit_of_measurement: W
id: "shelly25_powerb"
device_class: power
state_class: measurement
accuracy_decimals: 0
filters:
# Make everything below 1W appear as just 0W.
#- lambda: if (x < 1) return 0; else return x;
# active_power_a is normal, so don't multiply by -1
active_power_b:
name: ${friendly_name} Power A
unit_of_measurement: W
id: "shelly25_powera"
device_class: power
state_class: measurement
accuracy_decimals: 0
filters:
# active_power_b is inverted, so multiply by -1
- multiply: -1
# Make everything below 1W appear as just 0W.
- lambda: if (x < 1) return 0; else return x;
update_interval: $sensor_refresh
- platform: total_daily_energy
name: "${friendly_name} daily energy A"
power_id: "shelly25_powera"
device_class: energy
state_class: measurement
filters:
- multiply: 0.001
unit_of_measurement: kWh
- platform: total_daily_energy
name: "${friendly_name} daily energy B"
power_id: "shelly25_powerb"
device_class: energy
state_class: measurement
filters:
- multiply: 0.001
unit_of_measurement: kWh
# NTC Temperature
- platform: ntc
sensor: temp_resistance_reading
name: ${friendly_name} 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
status_led:
pin:
number: GPIO0
inverted: yes
binary_sensor:
- platform: gpio
pin:
number: GPIO13
name: ${friendly_name} Switch1
on_press:
then:
- switch.toggle: shelly_relay_1
- platform: gpio
pin:
number: GPIO5
name: ${friendly_name} Switch2
on_press:
then:
- switch.toggle: shelly_relay_2
switch:
- platform: gpio
id: shelly_relay_1
name: ${friendly_name} Relay1
pin: GPIO4
icon: "mdi:electric-switch"
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
id: shelly_relay_2
name: ${friendly_name} Relay2
pin: GPIO15
icon: "mdi:electric-switch"
restore_mode: RESTORE_DEFAULT_OFF