-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdryer_current.yaml
83 lines (72 loc) · 2.22 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
80
81
esphome:
name: dryer_current
platform: ESP8266
board: d1_mini
includes:
- currentsensor.h
libraries:
- "EmonLib"
wifi:
ssid: "Your SSID"
password: "Your Password"
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
sensor:
- platform: custom
lambda: |-
auto current_sensor = new CurrentSensor(
A0, /* Current Pin */
2, /* Led Pin - 2 (D4) Wemos Mini D1 and NodeMCU */
LOW, /* LEDon */
HIGH, /* LEDoff */
15000, /* emonCalcIrms - current calibration settings */
30, /* emonCurrent - current calibration settings */
10000 /* Update Interval - 10 seconds or more is recommended*/
);
App.register_component(current_sensor);
return {current_sensor};
sensors:
name: "Dryer Current"
unit_of_measurement: "A"
accuracy_decimals: 2
icon: "mdi:flash-circle"
id: dryer_current
on_value:
then:
- sensor.template.publish:
id: dryer_code
state: !lambda 'if (x > 50) { return 2; } else if ( x > 1 ) { return 1; } else { return 0; }' # codes: 0 Idle, 1 Door Open, 2 Drying
# state: !lambda 'if (x > 1) { return 2; } else { return 0; }' # Without door detection
- platform: wifi_signal
name: "DryerMon Signal"
update_interval: 5min
on_value:
then:
- text_sensor.template.publish:
id: dryermon_status
state: !lambda 'return std::string("LS-digiDryerMon - Build: ") + __DATE__ + " " + __TIME__ + " - " + id(ip_address).state;'
- platform: template
id: dryer_code
internal: true
filters:
- debounce: 5s
on_value:
then:
- text_sensor.template.publish:
id: dryer
state: !lambda 'if (x == 2) { return "Drying"; } else if (x == 1) { return "Door Open";} else { return "Idle"; }'
text_sensor:
- platform: template
name: "Dryer"
id: dryer
icon: "mdi:tumble-dryer"
- platform: wifi_info
ip_address:
id: ip_address
internal: true
- platform: template
name: "DryerMon Status"
id: dryermon_status