-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathespsense-example.yml
67 lines (55 loc) · 1.69 KB
/
espsense-example.yml
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
esphome:
name: espsense
platform: ESP8266
board: nodemcu
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
fast_connect: on
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${plug_name} Fallback Hotspot"
password: !secret ap_pass
captive_portal:
# Enable logging
logger:
level: DEBUG
ota:
safe_mode: True
password: "ota_safe_pass"
# Template sensor, random values published by the below time component as an example
sensor:
- platform: template
name: Test Sensor
id: test_sensor
unit_of_measurement: W
time:
- platform: sntp
id: sntp_time
on_time:
# Every 5 sec
- seconds: /5
then:
# Change the sensor value randomly every 5 seconds
# !!!!! Don't actually use this! For demo purposes only !!!!!
- lambda: !lambda |-
long randomPowerState = random(5, 15);
id(test_sensor).publish_state((float)randomPowerState);
external_components:
# Pull the esphome component in from this GitHub repo
- source: github://cbpowell/ESPSense
components: [ espsense ]
espsense:
# You can define up to 10 "plugs" to report to Sense
# Power value can come from any of the following:
# * A power sensor (in Watts)
# * Calculated from a current sensor (in Amps) and a voltage sensor (in Volts)
# * Calculated from a current sensor (in Amps) and a fixed voltage value
plugs:
- name: espsense
power_sensor: test_sensor
# current_sensor: some_current_sensor
# voltage_sensor: some_voltage_sensor
# voltage: 120.0
# encrypt: false
# mac_address: 35:4B:91:A1:FE:CC