diff --git a/example_yaml/vue-utility-solar.yaml b/example_yaml/vue-utility-solar.yaml index c594ec4..25d25f8 100644 --- a/example_yaml/vue-utility-solar.yaml +++ b/example_yaml/vue-utility-solar.yaml @@ -6,8 +6,11 @@ esphome: name: vue-utility platform: ESP32 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 wifi: @@ -38,134 +41,83 @@ uart: baud_rate: 115200 sensor: - - platform: custom - lambda: |- - auto vue = new EmporiaVueUtility(id(emporia_uart)); - App.register_component(vue); - return {vue->kWh_consumed, vue->kWh_returned, vue->W_consumed, vue->W_returned, vue->W, vue->kWh_net}; - sensors: - - name: "kWh Consumed" - id: kWh_consumed - unit_of_measurement: "kWh" - accuracy_decimals: 3 - state_class: total_increasing - device_class: energy - # 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: 0.1 # <- kWh - - lambda: |- - if (id(fast_reporting)) return(x); - return {}; - on_raw_value: - then: - lambda: |- - ESP_LOGI("Vue", "kWh = %0.3f", x); - - - 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 - # once every 5 minutes and/or when 0.1 kwh - # have been 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); - - - 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 - # 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); - + - 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