Create sample YAMLs that use the external component and update README.

This commit is contained in:
Victor Chang
2024-06-09 15:36:17 -07:00
parent fc6676e197
commit 678a56ab03
3 changed files with 310 additions and 3 deletions

View File

@@ -4,8 +4,19 @@ This is an unauthorized and unoffical firmware for the Emporia View Utility Conn
## Disclaimer
This software is of generally poor quality and should not be used by anyone. When you install the software on your device, it
will no longer report data to Emporia. You should backup the original Emporia firmware before installing this.
There is no guarantee of quality. When you install the software on your device, it will no longer report data to Emporia. You should backup the original Emporia firmware before installing this.
## Backup the original firmware
Determine which COM device your USB to serial adapter is and use it in the below command(s). Typically a single digit number. (e.g. `COM3`)
Backup:
`.\esptool --port COM# --chip esp32 -b 115200 read_flash 0x0 0x400000 .\vueUtilityConnect_stock.bin`
Restore:
`.\esptool --port COM# --chip esp32 -b 115200 write_flash --flash_freq 80m 0x0 .\vueUtilityConnect_stock.bin`
## Installation
@@ -26,7 +37,7 @@ a portable USB battery pack works well for this.
Instead of connecting IO0 and EN, you can simply short IO0 to ground while connecting power to get the device into bootloader mode.
Download `emporia_vue_utility.h` and either `vue-utility.yaml` or `vue-utility-solar.yaml`. Edit the YAML and modify to your liking.
Use either YAML file in the `example_yaml` directory and modify it to your liking.
Execute `esphome run vue-utility.yaml` or `esphome run vue-utility-solar.yaml` to build and install.
@@ -36,3 +47,7 @@ There are three LEDs on the device, which have "power", "wifi" and "link" icons
* **Power** = An ESPHome status led. Slowly flashing means warning, quickly flashing means error, solid on means OK. See [status_led](https://esphome.io/components/status_led.html) docs.
* **Wifi** = Normally solid on, will briefly flash each time a meter rejoin is attempted which indicates poor signal from the meter.
* **Link** = Flashes off briefly about once every 5 seconds. More specifically, the LED turns off when a reading from the meter is requested and turns back on when a response is received. If no response is received then the LED will remain off. If this LED is never turning on then no readings are being returned by the meter.
## More Details
Check out the `docs` directory for technical details!

View File

@@ -0,0 +1,195 @@
##################################################
# Config for homes with solar or wind production #
##################################################
esphome:
name: vue-utility
platform: ESP32
board: esp-wrover-kit
includes:
- emporia_vue_utility.h
# Add your own wifi credentials
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
logger:
logs:
# Change to DEBUG / INFO / WARN / ERROR as desired
Vue: DEBUG
api:
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
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);
# 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;
# Global value for above button
globals:
- id: fast_reporting
type: bool
restore_value: no
initial_value: "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

View File

@@ -0,0 +1,97 @@
####################################################
# config for homes without solar / wind production #
####################################################
esphome:
name: vue-utility
platform: ESP32
board: esp-wrover-kit
external_components:
source:
type: git
url: https://github.com/nekorevend/esphome-emporia-vue-utility
# Add your own wifi credentials
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
logger:
logs:
# Change to DEBUG / INFO / WARN / ERROR as desired
Vue: DEBUG
api:
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
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 {};
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;
# 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;
# Global value for above button
globals:
- id: fast_reporting
type: bool
restore_value: no
initial_value: "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