-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdryer_current.yaml
79 lines (65 loc) · 1.54 KB
/
dryer_current.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
esphome:
name: dryer_current
platform: ESP8266
board: d1_mini
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
manual_ip:
static_ip: !secret ip_dryermon
gateway: !secret ip_gateway
subnet: !secret ip_subnet
dns1: !secret ip_dns1
# Enable logging
logger:
# Comment out and/or remove MQTT if you want to use the ESPHome API
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_user
password: !secret mqtt_pass
# Uncomment if you want to use the ESPHome API
#api:
ota:
web_server:
sensor:
- platform: ct_clamp
sensor: adc_sensor
name: "Dryer Current"
unit_of_measurement: "A"
icon: "mdi:lightning-bolt-circle"
id: dryer_current
update_interval: 20s
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 0.058 -> 7.00
on_value:
then:
- sensor.template.publish:
id: dryer_code
# codes: 0 Idle, 1 Door Open, 2 Drying
state: !lambda |-
if (x > 5) return 2;
return 0;
# if (x > 1) return 1;
- platform: template
id: dryer_code
internal: true
# filters:
# - debounce: 2s
on_value:
then:
- text_sensor.template.publish:
id: dryer
state: !lambda |-
if (x == 2) return "Drying";
return "Idle";
# if (x == 1) return "Door Open";
- platform: adc
pin: A0
id: adc_sensor
text_sensor:
- platform: template
name: "Dryer"
id: dryer
icon: "mdi:tumble-dryer"