Files
esphome-emporia-vue-utility/example_yaml/vue-utility-throttled-solar.yaml
2025-12-27 14:12:36 -08:00

159 lines
4.2 KiB
YAML

##################################################
# Config for homes with solar or wind production #
##################################################
esphome:
name: vue-utility
esp32:
board: esp-wrover-kit
framework:
type: esp-idf
external_components:
source:
type: git
url: https://github.com/nekorevend/esphome-emporia-vue-utility
# Enable Home Assistant API
api:
# Encrypt the API communication with the given key. Must be a 32-byte base64-encoded string. See FAQ.
encryption:
key: "eU79n2aex33uRofF9yvNIP5gwEFCi5GsVi2Rr3OydjY="
# Secures OTA Updates.
ota:
platform: esphome
# Any password will work. See FAQ.
password: "some_password"
# Add your own wifi credentials
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
logger:
logs:
# Change to DEBUG / INFO / WARN / ERROR as desired
Vue: DEBUG
mqtt:
broker: !secret mqtt_broker
id: vue_utility
username: !secret mqtt_username
password: !secret mqtt_password
discovery: False # Only if you use the HA API usually
# This uart connects to the MGM111
uart:
id: emporia_uart
rx_pin: GPIO21
tx_pin: GPIO22
baud_rate: 115200
# Global value for the fast reporting button
globals:
- id: fast_reporting
type: bool
restore_value: no
initial_value: "false"
sensor:
- platform: emporia_vue_utility
uart_id: emporia_uart
power:
name: "Watts"
# Report every 5 minutes or when +/- 20 watts
filters:
- or:
- throttle: 5min
- delta: 20 # <- watts
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
power_import:
name: "Watts Consumed"
# Report every 5 minutes or when +/- 20 watts
filters:
- or:
- throttle: 5min
- delta: 20 # <- watts
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
power_export:
name: "Watts Returned"
# Report every 5 minutes or when +/- 20 watts
filters:
- or:
- throttle: 5min
- delta: 20 # <- watts
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
energy:
name: "Watt-hours"
# Reduce the rate of reporting the value to
# once every 5 minutes and/or when 0.1 kwh
# have been consumed, unless the fast_reporting
# button has been pushed
filters:
- or:
- throttle: 5min
- delta: 100 # <- Wh
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
# If you want kWh instead of Wh
# - lambda: return x / 1000;
energy_import:
name: "Watt-hours Consumed"
# Reduce the rate of reporting the value to
# once every 5 minutes and/or when 0.1 kwh
# have been consumed, unless the fast_reporting
# button has been pushed
filters:
- or:
- throttle: 5min
- delta: 100 # <- Wh
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
# If you want kWh instead of Wh
# - lambda: return x / 1000;
energy_export:
name: "Watt-hours Produced"
# Reduce the rate of reporting the value to
# once every 5 minutes and/or when 0.1 kwh
# have been consumed, unless the fast_reporting
# button has been pushed
filters:
- or:
- throttle: 5min
- delta: 100 # <- Wh
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
# If you want kWh instead of Wh
# - lambda: return x / 1000;
# This gives you a button that temporarily causes results to be
# reported every few seconds instead of on significant change
# and/or every 5 minutes
button:
- platform: template
name: "Fast Reporting"
id: fast_reporting_button
on_press:
- lambda: id(fast_reporting) = true;
- delay: 5min
- lambda: id(fast_reporting) = false;
# This LED is marked D3 on the pcb and is the power led on the case
status_led:
pin:
number: GPIO25
# It *is* inverted, but being normally on looks better
inverted: false