forked from willbob8/willsurridgetech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clampSensor.yaml
59 lines (48 loc) · 1.19 KB
/
clampSensor.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
esphome:
name: power
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifiSSID
password: !secret wifiPass
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "power"
password: "powerpower"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret passESPH
ota:
password: !secret passOTA
sensor:
- platform: ct_clamp
sensor: adc_sensor
name: "Measured Current"
update_interval: 5s
id: measured_current
filters:
- calibrate_linear:
# Measured value of 0 maps to 0A
- 0 -> 0
# Known load: 5.0A - change this!
# Value shown in logs: 0.01229A - change this!
- 0.01229 -> 5
# Example source sensor
- platform: adc
pin: A0
id: adc_sensor
- platform: total_daily_energy
name: "Total Daily Power"
power_id: my_power
- platform: template
id: my_power
name: "Measured Power"
lambda: return id(measured_current).state * 230.0 / 1000; #Power = Current * Voltage (so change 230 to whatever your mains voltage is)
unit_of_measurement: 'kW'
update_interval: 5s
time:
- platform: sntp
id: my_time