Witam serdecznie, chciałem się skomunikować poprzez ESPhome z modułem energii, aby śledzić zużycie energii w mieszkaniu. Niestety moduł energii nie pokazuje pasujących statystyk. Przedstawiam kod:
# Substitutions
substitutions:
# Device Names
device_name: "ESP32"
friendly_name: "ESP32 - pomiar"
esphome:
name: "pomiar"
platform: ESP32
board: nodemcu-32s
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
ota:
password: "xxxxxx"
wifi:
ssid: "xxxxxx"
password: "xxxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Pomiar Fallback Hotspot"
password: "xxxx"
time:
- platform: homeassistant
id: homeassistant_time
# captive_portal:
web_server:
port: 80
sensor:
- platform: ct_clamp
sensor: adc_sensor
name: "Aktualne zużycie"
state_class: total_increasing #długotrwałe statystyki
id: cur_amp
update_interval: 10s
filters:
- calibrate_linear:
- 0.00428 -> 0
- 0.01200 -> 0
- 0.08184 -> 4.136
- 0.15991 -> 8.0
- platform: adc
pin: GPIO34
id: adc_sensor
update_interval: 6s
attenuation: 11db
- platform: ct_clamp
sensor: adc_sensor
name: "raw values"
update_interval: 10s
unit_of_measurement: mA
accuracy_decimals: 5
- platform: template
name: "Aktualnie Watt" # This sensor converts the Amps to Watts (this is assuming that your voltage is 230, if not change the 230 accordingly)
id: esp_watts
lambda: |-
return id(cur_amp).state * id(esp_volt).state;
accuracy_decimals: 2
update_interval: 10s
device_class: power
unit_of_measurement: W
- platform: template
name: "Aktualnie Volt" # This sensor converts the Amps to Watts (this is assuming that your voltage is 230, if not change the 230 accordingly)
id: esp_volt
lambda: |-
return 230;
accuracy_decimals: 2
device_class: energy
unit_of_measurement: V
# WiFi Signal sensor.
- platform: wifi_signal
name: ${friendly_name} WiFi Signal
id: "_wifi_signal"
update_interval: 60s
Proszę o pomoc w dodaniu statystyk.
Mój czujnik natężenia prądu to SCT-013-030