Actually save the file.

This commit is contained in:
Victor Chang
2024-06-09 15:38:41 -07:00
parent 678a56ab03
commit 2e098f3f65

View File

@@ -6,8 +6,11 @@ esphome:
name: vue-utility name: vue-utility
platform: ESP32 platform: ESP32
board: esp-wrover-kit board: esp-wrover-kit
includes:
- emporia_vue_utility.h external_components:
source:
type: git
url: https://github.com/nekorevend/esphome-emporia-vue-utility
# Add your own wifi credentials # Add your own wifi credentials
wifi: wifi:
@@ -38,18 +41,40 @@ uart:
baud_rate: 115200 baud_rate: 115200
sensor: sensor:
- platform: custom - platform: emporia_vue_utility
lambda: |- uart_id: emporia_uart
auto vue = new EmporiaVueUtility(id(emporia_uart)); power:
App.register_component(vue); name: "Watts"
return {vue->kWh_consumed, vue->kWh_returned, vue->W_consumed, vue->W_returned, vue->W, vue->kWh_net}; # Report every 5 minutes or when +/- 20 watts
sensors: filters:
- name: "kWh Consumed" - or:
id: kWh_consumed - throttle: 5min
unit_of_measurement: "kWh" - delta: 20 # <- watts
accuracy_decimals: 3 - lambda: |-
state_class: total_increasing if (id(fast_reporting)) return(x);
device_class: energy 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 # Reduce the rate of reporting the value to
# once every 5 minutes and/or when 0.1 kwh # once every 5 minutes and/or when 0.1 kwh
# have been consumed, unless the fast_reporting # have been consumed, unless the fast_reporting
@@ -57,115 +82,42 @@ sensor:
filters: filters:
- or: - or:
- throttle: 5min - throttle: 5min
- delta: 0.1 # <- kWh - delta: 100 # <- Wh
- lambda: |- - lambda: |-
if (id(fast_reporting)) return(x); if (id(fast_reporting)) return(x);
return {}; return {};
on_raw_value: # If you want kWh instead of Wh
then: # - lambda: return x / 1000;
lambda: |- energy_import:
ESP_LOGI("Vue", "kWh = %0.3f", x); name: "Watt-hours Consumed"
- name: "kWh Returned"
id: kWh_returned
unit_of_measurement: "kWh"
accuracy_decimals: 3
state_class: total_increasing
device_class: energy
# Reduce the rate of reporting the value to # Reduce the rate of reporting the value to
# once every 5 minutes and/or when 0.1 kwh # once every 5 minutes and/or when 0.1 kwh
# have been returned, unless the fast_reporting # have been consumed, unless the fast_reporting
# button has been pushed # button has been pushed
filters: filters:
- or: - or:
- throttle: 5min - throttle: 5min
- delta: 0.1 # <- kWh - delta: 100 # <- Wh
- lambda: |- - lambda: |-
if (id(fast_reporting)) return(x); if (id(fast_reporting)) return(x);
return {}; return {};
on_raw_value: # If you want kWh instead of Wh
then: # - lambda: return x / 1000;
lambda: |- energy_export:
ESP_LOGI("Vue", "kWh = %0.3f", x); name: "Watt-hours Produced"
- name: "Watts consumed"
id: watts_consumed
unit_of_measurement: "W"
accuracy_decimals: 0
state_class: measurement
device_class: power
# Report every 5 minutes or when +/- 20 watts
filters:
- or:
- throttle: 5min
- delta: 20 # <- watts
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
on_raw_value:
then:
lambda: |-
ESP_LOGI("Vue", "Watts consumed = %0.3f", x);
- name: "Watts returned"
id: watts_returned
unit_of_measurement: "W"
accuracy_decimals: 0
state_class: measurement
device_class: power
# Report every 5 minutes or when +/- 20 watts
filters:
- or:
- throttle: 5min
- delta: 20 # <- watts
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
on_raw_value:
then:
lambda: |-
ESP_LOGI("Vue", "Watts returned = %0.3f", x);
- name: "Watts"
id: watts
unit_of_measurement: "W"
accuracy_decimals: 0
state_class: measurement
device_class: power
# Report every 5 minutes or when +/- 20 watts
filters:
- or:
- throttle: 5min
- delta: 20 # <- watts
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
on_raw_value:
then:
lambda: |-
ESP_LOGI("Vue", "Watts = %0.3f", x);
- name: "kWh Net"
id: kWh_net
unit_of_measurement: "kWh"
accuracy_decimals: 3
device_class: energy
# Reduce the rate of reporting the value to # Reduce the rate of reporting the value to
# once every 5 minutes and/or when 0.1 kwh # once every 5 minutes and/or when 0.1 kwh
# have been consumed or returned, unless the fast_reporting # have been consumed, unless the fast_reporting
# button has been pushed # button has been pushed
filters: filters:
- or: - or:
- throttle: 5min - throttle: 5min
- delta: 0.1 # <- kWh - delta: 100 # <- Wh
- lambda: |- - lambda: |-
if (id(fast_reporting)) return(x); if (id(fast_reporting)) return(x);
return {}; return {};
on_raw_value: # If you want kWh instead of Wh
then: # - lambda: return x / 1000;
lambda: |-
ESP_LOGI("Vue", "kWh = %0.3f", x);
# This gives you a button that temporarily causes results to be # This gives you a button that temporarily causes results to be
# reported every few seconds instead of on significant change # reported every few seconds instead of on significant change