Emporia Vue Utility Connect

hey, just wanted to say thanks!

I’m looking for a little direction on the flashing portion of this process. Right now I’ve managed to connect to the Vue connect via an RPI but I’m not sure what to flash.
The steps as I understand them are:

  1. Download the esphome-emporia-vue-utility file from github.
  2. Create a entity in Homeassistant ESPHome addon
  3. Copy the YAML text from the github download and modify as needed (mainly the name)
  4. download/create file to manually flash or send directly to ESP device if plugged into HA instance
  5. Done
    I’m stuck with the firmware creation part in step 3. I pasted the yaml into the ESPHome entity but when i click install->manual->modern the download screen pops up but nothing happens until i get the button that says retry or logs at the bottom. It seems to be failing to build the firmware to download. I know the yaml includes emporia_vue_utility.h file but i have no idea where to place that file so that it can be read when building the firmware. any help would be appreciated.

Seems to be an ingress problem with opening the addon via HA. Once i log in via the web browser ESPHome starts compiling the .bin file. SMH.
If others run into this issue add a port to ESPHome configuration then use your HA IP address with that port number to access ESPHome.
i.i 192.168.1.XX:YYYY where XX is your local IP address and YYYY is the port number you assigned.

Hi @jrouvier I just got solar today and flashed my device from the normal yaml to the solar yaml. Now I am confused how to use the new entities in HA.

What is sensor.kWh, sensor.kWh_produced and sensor.kWh_returned and how do they relate to each other?

sensor.kWh was always around 116000 and increased steadily with each kWh. Starting from the solar install, it seems stuck:

sensor.kWh_produced and sensor.kWh_returned appeared once I flashed the Vue. However, kWh_returned is zero (even though I am sure there was energy pushed back to the grid because sensor.watts was negative the whole day) and sensor.kWh_consumed looks like it started from zero:

(as you can see, it started to increase around sun set).

sensor.kwh_returned being always zero is a bug. It should be fixed in v1.2.2. Sorry about that, I don’t have solar so it’s rather impossible to test that bit of code…

As far as sensor.kWh flat lining, that’s strange as in the the code it’s kWh_net. Are you sure you are using recent code? In any event, check your yaml file and make sure that state_class: total_increasing only appears in the kwh_consumed and kwh_returned sections. If that’s already the case, you could try adding state_class: total to the sensor, but I vaguely remember ESPHome lagging a bit behind HA and not supporting that yet.

Awesome, thank you very much – built and uploaded v1.2.2. Will check tomorrow when the sun shines again if it’s nonzero.

I see. I think I mixed it up. Here is what happened: I initially used vue-utility.yaml This file exposes the sensor.kwh. Today I switched to vue-utility-solar.yaml. And I think this file does not expose sensor.kwh any more. So the “flat lined” sensor is probably from the old firmware. But it still shows up like this:

With MQTTExplorer I just see that these entries are “Retained”. Can I just delete these entries via MQTT Explorer?

And with respect to the entities: Is there a mathematical relationship between sensor.kwh, sensor.kwh_net, sensor.kwh_consumed, sensor.kwh_returned (and possibly sensor.watts)? (From source code, the raw data from the meter seems to be both “watt_hours” (consumption) and “watts” (instantaneous power).

Ah, yes, you can delete the entries from MQTT.

On every new value of kwh_net, the code checks if the new value is greater than the previous value. If so, the difference is added to kwh_consumed. If the new value is less than the previous value, then the difference is added to subtracted from (since it’s a negative number) kwh_returned instead. Basically:

// Get the difference from previously reported value
wh_diff = watt_hours - prev_wh;

if (wh_diff > 0) { // Energy consumed from grid
    kwh_consumed += wh_diff;
}
if (wh_diff < 0) { // Energy sent to grid
    kwh_returned -= wh_diff;  
}

sensor.watts is just exactly what the meter reports, it’s not used to calculate kWh.

1 Like

hi @rouvier
Thanks for the integration, it works great. Totally matches my physical meter readings total kWh.

5310

Hi @jrouvier thanks again and for the explanation!

Sadly the returned kWh is still zero even though I’m pushing out kWh for hours (see negative watts):

How can I most easily debug this?

@dydx, is kWh Net going down? If not, do the console logs from esphome show the reported watt-hours changing or remaining constant?

You mean whether it’s a monotonic function? Yes, curve looks monotonic: Always increases but never decreases. Are you saying kwh_net should go down when energy pushed back into the grid?

If so, maybe the meter has to be set properly by the utility which is not done yet. I don’t see the usage at utility website either yet. I’ll wait for a couple of days and see if that happens. I hope the setup is just not complete yet from utility perspective. Thanks again!

Yeah, kwh_net should go down. However, the meter may be reporting a separate counter for kwh_returned. I’d check the logs (esphome logs ...yaml) for lines starting with Meter Response Bytes and compare it to what I’ve learned so far on this page.

Hi
I just flashed my Vue Utility ans wanted to share my Home Assistant setup. So far it’s been reporting successfully but I’ll know more by the end of the week.

- platform: integration
    source: sensor.watts
    name: utility_energy_spent
    unit_prefix: k
    round: 3 

- platform: template
    sensors:
      utility_energy:
        value_template: '{{ (states.sensor.utility_energy_spent.state | float) | round(3) }}'
        friendly_name: '5310 Utility'
        unit_of_measurement: 'kWh'
      utility_energy_hourly:
        value_template: '{{ (states.sensor.utility_hourly_energy_peak.state | float) | round(3) }}'
        friendly_name: '5310 Utility Hourly '
        unit_of_measurement: 'kWh'
      utility_energy_daily:
        value_template: '{{ (states.sensor.utility_daily_energy_peak.state | float)  | round(3) }}'
        friendly_name: '5310 Utility Daily'
        unit_of_measurement: 'kWh'
      utility_energy_weekly:
        value_template: '{{ (states.sensor.utility_weekly_energy_peak.state | float) | round(3) }}'
        friendly_name: '5310 Utility Weekly'
        unit_of_measurement: 'kWh'
      utility_energy_monthly:
        value_template: '{{ (states.sensor.utility_monthly_energy_peak.state | float) | round(3) }}'
        friendly_name: '5310 Utility Monthly'
        unit_of_measurement: 'kWh'
      utility_energy_quarterly:
        value_template: '{{ (states.sensor.utility_quarterly_energy_peak.state | float) | round(3) }}'
        friendly_name: '5310 Utility Quarterly'
        unit_of_measurement: 'kWh'
      utility_energy_yearly:
        value_template: '{{ (states.sensor.utility_yearly_energy_peak.state | float) | round(3) }}'
        friendly_name: '5310 Utility Yearly '
        unit_of_measurement: 'kWh'            
		
- platform: utility_meter:
    utility_hourly_energy:
      source: sensor.utility_energy_spent
      cycle: hourly
      tariffs:
        - peak   
      offset:
        days: 0
        hours: 0
        minutes: 0
      
    utility_daily_energy:
      source: sensor.utility_energy_spent
      cycle: daily
      tariffs:
        - peak
      offset:
        days: 0
        hours: 0
        minutes: 0

    utility_weekly_energy:
      source: sensor.utility_energy_spent
      cycle: weekly
      tariffs:
        - peak
      offset:
        days: 0
        hours: 0
        minutes: 0
      
    utility_monthly_energy:
      source: sensor.utility_energy_spent
      cycle: monthly
      tariffs:
        - peak
      offset:
        days: 0
        hours: 0
        minutes: 0
      
    utility_billing_energy:
      source: sensor.utility_energy_spent
      cycle: yearly
      tariffs:
        - peak
      offset:
        days: 15
        hours: 0
        minutes: 0
      
    utility_quarterly_energy:
      source: sensor.utility_energy_spent
      cycle: quarterly
      tariffs:
        - peak
      offset:
        days: 0
        hours: 0
        minutes: 0
      
    utility_yearly_energy:
      source: sensor.utility_energy_spent
      cycle: yearly
      tariffs:
        - peak
      offset:
        days: 0
        hours: 0
        minutes: 0

Hope it helps someone.
5310

Can someone explain a bit more on the difference between the two files from github.
vue-utility.yaml / vue-solar-utility.yaml
Vs.
emporia_vue_utility.h

Where does each get loaded into HA or esphome?

Put everything in Esphome folder. Use the one with solar in the name of you only if you have solar panels installed.

The h file is just the firmware implementation. Nothing to configure there. It’s used as part of the esphome framework to create the firmware image

The yaml files are the config files. The first one is for normal utility (meter always increases kWh and watts never go negative) and for solar (with net energy metering; watts can be negative m)

Gotcha, Needed to know the .h file had to be dropped in the esphome folder for the “include” line to work properly. The yaml file was copied and pasted into the esphome device yaml file.

Hi There, @jrouvier thanks so much for this firmware, its exactly what I have been looking for!!

I am having a little issue though, I have installed esphome onto the esp32 via serial, however I dont seem to be getting any response from the zigbee chip, this is the log output I am getting:

[21:58:12][D][Vue:524]: Sending firmware version request
[21:58:17][D][Vue:524]: Sending firmware version request
[21:58:22][D][Vue:524]: Sending firmware version request
[21:58:27][D][Vue:524]: Sending firmware version request
[21:58:32][D][Vue:524]: Sending firmware version request
[21:58:37][I][Vue:494]: MGM Firmware Version: 0
[21:58:37][I][Vue:495]: MGM Mac Address:  
[21:58:37][I][Vue:496]: MGM Install Code:  (secret)
[21:58:37][I][Vue:497]: Trying to re-join the meter.  If you continue to see this message
[21:58:37][I][Vue:498]: you may need to move the device closer to your power meter or
[21:58:37][I][Vue:499]: contact your utililty and ask them to reprovision the device.
[21:58:37][I][Vue:500]: Also confirm that the above mac address & install code match
[21:58:37][I][Vue:501]: what is printed on your device.
[21:58:37][E][Vue:502]: You can also file a bug at
[21:58:37][E][Vue:503]:   https://forms.gle/duMdU2i7wWHdbK5TA

Any ideas of what I should do?!

I have tried upping my log level to VERY_VERBOSE but I havent seen any further helpful logging.

EDIT: I added logging on the UART component but dont seem to be receiving any incoming messages:

22:25:39][D][Vue:524]: Sending firmware version request
[22:25:39][D][uart_debug:114]: >>> 24:66:0D
[22:25:44][D][Vue:524]: Sending firmware version request
[22:25:44][D][uart_debug:114]: >>> 24:66:0D
[22:25:45][VV][api.service:470]: on_ping_request: PingRequest {}
[22:25:45][VV][api.service:043]: send_ping_response: PingResponse {}
[22:25:49][D][Vue:524]: Sending firmware version request
[22:25:49][D][uart_debug:114]: >>> 24:66:0D
[22:25:54][D][Vue:524]: Sending firmware version request
[22:25:54][D][uart_debug:114]: >>> 24:66:0D
[22:25:59][D][Vue:524]: Sending firmware version request
[22:25:59][D][uart_debug:114]: >>> 24:66:0D
[22:26:00][VV][api.service:470]: on_ping_request: PingRequest {}
[22:26:00][VV][api.service:043]: send_ping_response: PingResponse {}
[22:26:04][I][Vue:494]: MGM Firmware Version: 0
[22:26:04][I][Vue:495]: MGM Mac Address:  
[22:26:04][I][Vue:496]: MGM Install Code:  (secret)
[22:26:04][I][Vue:497]: Trying to re-join the meter.  If you continue to see this message
[22:26:04][I][Vue:498]: you may need to move the device closer to your power meter or
[22:26:04][I][Vue:499]: contact your utililty and ask them to reprovision the device.
[22:26:04][I][Vue:500]: Also confirm that the above mac address & install code match
[22:26:04][I][Vue:501]: what is printed on your device.
[22:26:04][E][Vue:502]: You can also file a bug at
[22:26:04][E][Vue:503]:   https://forms.gle/duMdU2i7wWHdbK5TA
[22:26:04][V][component:200]: Component <unknown> took a long time for an operation (0.08 s).
[22:26:04][V][component:201]: Components should block for at most 20-30ms.
[22:26:04][D][uart_debug:114]: >>> 24:6A:0D
[22:26:09][D][Vue:487]: Sending request for meter reading
[22:26:09][D][uart_debug:114]: >>> 24:72:0D

Hi
Was your Vue ever connected to the Utility meter before you flashed it? Assuming you have a Smart meter, you need to contract the Utility Co and they will provide the setup for your meter to get it working. This is not a Vue issue.

Mine works great. Many thanks to the developer.

5310

yeah I had connected it to the utility in the past at another house, same utility same meter