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,134 +41,83 @@ 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 {};
# Reduce the rate of reporting the value to power_import:
# once every 5 minutes and/or when 0.1 kwh name: "Watts Consumed"
# have been consumed, unless the fast_reporting # Report every 5 minutes or when +/- 20 watts
# button has been pushed filters:
filters: - or:
- or: - throttle: 5min
- throttle: 5min - delta: 20 # <- watts
- delta: 0.1 # <- kWh - lambda: |-
- lambda: |- if (id(fast_reporting)) return(x);
if (id(fast_reporting)) return(x); return {};
return {}; power_export:
on_raw_value: name: "Watts Returned"
then: # Report every 5 minutes or when +/- 20 watts
lambda: |- filters:
ESP_LOGI("Vue", "kWh = %0.3f", x); - or:
- throttle: 5min
- name: "kWh Returned" - delta: 20 # <- watts
id: kWh_returned - lambda: |-
unit_of_measurement: "kWh" if (id(fast_reporting)) return(x);
accuracy_decimals: 3 return {};
state_class: total_increasing energy:
device_class: 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 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_import:
ESP_LOGI("Vue", "kWh = %0.3f", x); name: "Watt-hours Consumed"
# Reduce the rate of reporting the value to
- name: "Watts consumed" # once every 5 minutes and/or when 0.1 kwh
id: watts_consumed # have been consumed, unless the fast_reporting
unit_of_measurement: "W" # button has been pushed
accuracy_decimals: 0 filters:
state_class: measurement - or:
device_class: power - throttle: 5min
# Report every 5 minutes or when +/- 20 watts - delta: 100 # <- Wh
filters: - lambda: |-
- or: if (id(fast_reporting)) return(x);
- throttle: 5min return {};
- delta: 20 # <- watts # If you want kWh instead of Wh
- lambda: |- # - lambda: return x / 1000;
if (id(fast_reporting)) return(x); energy_export:
return {}; name: "Watt-hours Produced"
on_raw_value: # Reduce the rate of reporting the value to
then: # once every 5 minutes and/or when 0.1 kwh
lambda: |- # have been consumed, unless the fast_reporting
ESP_LOGI("Vue", "Watts consumed = %0.3f", x); # button has been pushed
filters:
- name: "Watts returned" - or:
id: watts_returned - throttle: 5min
unit_of_measurement: "W" - delta: 100 # <- Wh
accuracy_decimals: 0 - lambda: |-
state_class: measurement if (id(fast_reporting)) return(x);
device_class: power return {};
# Report every 5 minutes or when +/- 20 watts # If you want kWh instead of Wh
filters: # - lambda: return x / 1000;
- 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
# once every 5 minutes and/or when 0.1 kwh
# have been consumed or returned, unless the fast_reporting
# button has been pushed
filters:
- or:
- throttle: 5min
- delta: 0.1 # <- kWh
- lambda: |-
if (id(fast_reporting)) return(x);
return {};
on_raw_value:
then:
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