77 lines
1.6 KiB
YAML
77 lines
1.6 KiB
YAML
esphome:
|
|
name: powermeter
|
|
friendly_name: PowerMeter
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: !secret powermeter_encryption_key
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret powermeter_ota_password
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
manual_ip:
|
|
static_ip: 192.168.20.152
|
|
gateway: 192.168.20.1
|
|
subnet: 255.255.255.0
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "Powermeter Fallback Hotspot"
|
|
password: "kmSJk2j8Lpak"
|
|
|
|
captive_portal:
|
|
|
|
sensor:
|
|
- platform: pulse_meter
|
|
name: 'Power'
|
|
id: sensor_pulse_meter # Optional ID, necessary if you want to calculate the total daily energy
|
|
unit_of_measurement: 'W'
|
|
device_class: power
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
internal_filter: 100ms
|
|
pin:
|
|
number: 12
|
|
inverted: true
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
filters:
|
|
- multiply: 60
|
|
total:
|
|
name: "Electricity Total"
|
|
unit_of_measurement: "kWh"
|
|
device_class: energy
|
|
state_class: total_increasing
|
|
accuracy_decimals: 3
|
|
filters:
|
|
- multiply: 0.001
|
|
- platform: total_daily_energy
|
|
name: 'Total Daily Energy'
|
|
id: sensor_total_daily_energy
|
|
power_id: sensor_pulse_meter
|
|
unit_of_measurement: 'kWh'
|
|
state_class: total_increasing
|
|
device_class: energy
|
|
accuracy_decimals: 3
|
|
filters:
|
|
# Multiplication factor from W to kW is 0.001
|
|
- multiply: 0.001
|
|
|
|
time:
|
|
- platform: homeassistant
|
|
id: homeassistant_time |