Emporia Vue Utility Connect

I’ve spent some time figuring out the Emporia Vue Utility Connect device and writing a little code for it. If anyone else has one of these you might find it useful: https://github.com/jrouvier/esphome-emporia-vue-utility

Note: The Emporia Vue In-Panel energy monitors are a completely different device. See this excellent gist by Flaviu Tamas for ESPHome support of the in-panel monitors.

3 Likes

I have one on the way! I found a HACS intragration, but was hoping for something like this since it has an esp32.

I’m excited to try this out. How has it worked with HA and energy monitoring? Do you have screenshots? Any issues?

I have it compiled and ready to go in ESP Home. I’ll flash the bin to it once I get it in!

Sorry for the late reply, yes, it works with HA Energy Monitoring. I haven’t had any issues at all. In home assistant it just gives you a device with a Watts entity (current wattage) and a kWh entity (cumulative energy consumed). There’s also a Fast Reporting button, which will make it report about every 10 seconds for a few minutes, otherwise it only updates home assistant every 5 minutes unless there is a significant change in power usage.

If you have any problems, send me a PM with the logs or open an issue on github and I’ll be happy to help you.

2 Likes

I had to remove the dash in “vue-utility” and replace it with an underscore, change 5m to 300s, and comment out the names of the LEDs in the output section of the config to get it to install without errors.

I get data from my meter in the ESPHome Logs but it complains about “Unreasonable watts value xxxxxxxx”. I am currently putting back ~1.5 kW to the grid.

I am using ESPhome 2022.1.3 on core-2022.2.5.

Here is the data…

[13:48:06][D][EmporiaVue:202]: Sending request for meter reading
[13:48:06][E][EmporiaVue:153]: Unreasonable watt-hours data
[13:48:06][D][esp-idf:000]: E (1322460) EmporiaVue: 0x3ffb91f8   02 16 8f 03                                       |....|

[13:48:06][E][EmporiaVue:155]: Full packet:
[13:48:06][D][esp-idf:000]: E (1322483) EmporiaVue: 0x3ffb91f0   24 01 72 98 00 00 00 00  02 16 8f 03 00 00 00 00  |$.r.............|

[13:48:06][D][esp-idf:000]: E (1322493) EmporiaVue: 0x3ffb9200   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322504) EmporiaVue: 0x3ffb9210   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322516) EmporiaVue: 0x3ffb9220   00 00 00 01 00 00 03 e8  fb fb 00 00 00 ff fa 83  |................|

[13:48:06][D][esp-idf:000]: E (1322528) EmporiaVue: 0x3ffb9230   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322542) EmporiaVue: 0x3ffb9240   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322551) EmporiaVue: 0x3ffb9250   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322563) EmporiaVue: 0x3ffb9260   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322578) EmporiaVue: 0x3ffb9270   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322589) EmporiaVue: 0x3ffb9280   00 00 00 00 00 00 00 00  e2 00 14 00 0d           |.............|

[13:48:06][E][EmporiaVue:168]: Unreasonable watts value 16775811
[13:48:06][D][esp-idf:000]: E (1322609) EmporiaVue: 0x3ffb922c   00 ff fa 83                                       |....|

[13:48:06][E][EmporiaVue:170]: Full packet:
[13:48:06][D][esp-idf:000]: E (1322629) EmporiaVue: 0x3ffb91f0   24 01 72 98 00 00 00 00  02 16 8f 03 00 00 00 00  |$.r.............|

[13:48:06][D][esp-idf:000]: E (1322639) EmporiaVue: 0x3ffb9200   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322651) EmporiaVue: 0x3ffb9210   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322662) EmporiaVue: 0x3ffb9220   00 00 00 01 00 00 03 e8  fb fb 00 00 00 ff fa 83  |................|

[13:48:06][D][esp-idf:000]: E (1322674) EmporiaVue: 0x3ffb9230   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322688) EmporiaVue: 0x3ffb9240   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322697) EmporiaVue: 0x3ffb9250   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322711) EmporiaVue: 0x3ffb9260   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322722) EmporiaVue: 0x3ffb9270   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[13:48:06][D][esp-idf:000]: E (1322733) EmporiaVue: 0x3ffb9280   00 00 00 00 00 00 00 00  e2 00 14 00 0d           |.............|

[13:48:06][D][EmporiaVue:178]: Seconds since meter watt-hour reset: 1310.946
[13:48:06][D][EmporiaVue:190]: Meter Response Bytes   4 to   7: 02 16 8f 03
[13:48:06][D][EmporiaVue:190]: Meter Response Bytes  44 to  47: 00 00 00 01
[13:48:06][D][EmporiaVue:190]: Meter Response Bytes  48 to  51: 00 00 03 e8
[13:48:06][D][EmporiaVue:190]: Meter Response Bytes  52 to  55: fb fb 00 00
[13:48:06][D][EmporiaVue:190]: Meter Response Bytes  56 to  59: 00 ff fa 83
[13:48:06][D][EmporiaVue:190]: Meter Response Bytes 148 to 151: e2 00 14 00

Well it appears your code doesn’t handle negative numbers because once the solar stopped feeding the grid, the data was accepted. Let me know if you want more data. Note in the attached graphs, the time scale is NOT the same because “watts” only started to be reported after they crossed the x-axis.

[17:17:10][D][EmporiaVue:202]: Sending request for meter reading
[17:17:11][E][EmporiaVue:153]: Unreasonable watt-hours data
[17:17:11][D][esp-idf:000]: E (10373912) EmporiaVue: 0x3ffb928c   02 16 90 2b                                       |...+|

[17:17:11][E][EmporiaVue:155]: Full packet:
[17:17:11][D][esp-idf:000]: E (10373925) EmporiaVue: 0x3ffb9284   24 01 72 98 00 00 00 00  02 16 90 2b 00 00 00 00  |$.r........+....|

[17:17:11][D][esp-idf:000]: E (10373933) EmporiaVue: 0x3ffb9294   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10373951) EmporiaVue: 0x3ffb92a4   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10373955) EmporiaVue: 0x3ffb92b4   00 00 00 01 00 00 03 e8  fb fb 00 00 00 00 01 5f  |..............._|

[17:17:11][D][esp-idf:000]: E (10373974) EmporiaVue: 0x3ffb92c4   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10373981) EmporiaVue: 0x3ffb92d4   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10373995) EmporiaVue: 0x3ffb92e4   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10374008) EmporiaVue: 0x3ffb92f4   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10374023) EmporiaVue: 0x3ffb9304   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

[17:17:11][D][esp-idf:000]: E (10374028) EmporiaVue: 0x3ffb9314   00 00 00 00 00 00 00 00  1e 02 d2 00 0d           |.............|

[17:17:11][I][Vue:081]: Watts = 351.000
[17:17:11][D][EmporiaVue:178]: Seconds since meter watt-hour reset: 13763.102
[17:17:11][D][EmporiaVue:190]: Meter Response Bytes   4 to   7: 02 16 90 2b
[17:17:11][D][EmporiaVue:190]: Meter Response Bytes  44 to  47: 00 00 00 01
[17:17:11][D][EmporiaVue:190]: Meter Response Bytes  48 to  51: 00 00 03 e8
[17:17:11][D][EmporiaVue:190]: Meter Response Bytes  52 to  55: fb fb 00 00
[17:17:11][D][EmporiaVue:190]: Meter Response Bytes  56 to  59: 00 00 01 5f
[17:17:11][D][EmporiaVue:190]: Meter Response Bytes 148 to 151: 1e 02 d2 00

Thanks for doing this. Will this work with the Gen1 version of Emporia Vue? thanks

I’ll get the negative number issue fixed for you shortly.

What’s the error it gave for the LED names?

I get “name is an invalid option for output.gpio” which makes sense because there is no argument for name here: GPIO Output — ESPHome

So I have a Rainforest Eagle setup with my smart meter the same time I am working with the Vue and the Eagle reports two total energy values: “From Grid” and “To Grid”.

I checked the readings I was getting and they are as follows:
Meter: 34,845 kWh (as read from the face of the meter)
Vue: 35,038.242 kWh
Eagle: 35,038.245 kWh (“From Grid”)

The difference between what the Eagle/Vue are reporting and what my meter reads is the total value of energy to the grid. In my case it is 193.036 kWh. I am pretty certain the meter is reporting these two numbers separately but have not been able to figure out where the value for “To Grid” is in the data packet.

Ran into all the same issues as @Han_Solo. Got it up and running.

Commented out the the unreasonable Watts check, as it goes unreasonable when I’m producing and pushing back to the grid (negative Watts).
In that case, negative Watts is input_value-16777216. So I have a check if input_value is > 8388608, if true I perform the negative watts calc and publish that, otherwise we’re positive and just publish input value.

As for energy, when I’m pushing back to the grid the kWh reported from the Emporia does not reduce. Apparently the reported value is only energy pulled FROM grid so if you’re pushing back, it just stays constant until you start pulling again when the sun goes down. According to Emporia, the meter isn’t spinning backwards, and there doesn’t appear to be a separate report for energy pushed to the grid. Somehow my meter is accounting for this as the digital display is a bit lower than the reported kWh from the Emporia but I guess it’s not transmitted wirelessly?

My workaround was to report energy pushed back to the grid based on calculation using the reported negative Watt and the time interval it was measured over. So I calculate this in the ESPHome code and publish it over MQTT and then pump it into a utility meter integration in HASS where I account for it on its own energy-TO-grid meter. I’ve got a separate meter for energy-FROM-grid using the reported kWh from Emporia. A sensor with template to calculate the difference will get you net. Separate meters for daily and monthly (or whatever other time interval you like), all taken care of by HASS. Set “delta_value” attribute to true for the energy-TO-grid meter as this needs to be accumulated, whereas the default delta_value of false is appropriate for the energy-FROM-grid meter which is just receiving absolute meter readings.

I’ve updated the code in the repo with the following changes:

  • It now internally derives kWh produced / consumed. There is a separate vue-utility-solar.yaml that outputs these individual sensor values.
  • No longer limits the kWh readings to within a fixed range but instead checks that the latest value seen is -/+ a reasonable range from the previous value. This is MAX_WH_CHANGE in emporia_vue_utility.h and the default of 2 kWh should be plenty for most homes (that would be 500A at 240V)
  • Handles negative Watts values
  • Moved the limits on reasonable Watts values to the top of emporia_vue_utility.h
  • Removed the invalid Name attribute on the LED outputs
  • Fixed the throttle: 5m, should have been throttle: 5min

Unfortunately the current version ESPHome doesn’t allow state_class: total, only state_class: total_increasing, which means that the old kWh value shouldn’t ever go down. Therefore kWh is now kWh_net for people without local energy production and a direct response from the meter. In the _solar.yaml the state_class: has been removed, which I think means HA won’t want to use it as an energy meter source. The new kWh_consumed and kWh_produced do have state_class: total_increasing so HA should be happy with it.

@something-is-wrong, no, I don’t think the meter is reporting distinct values for consumed / produced. The logged Meter Response Bytes has all the non-zero bytes in the response and what I’ve been able to reverse engineer is documented here. The meter very well may be tracking this separately and just not giving us this info though.

Thanks @Han_Solo and @something-is-wrong for your bug reports, please give the new version a shot.

Actually, kwh_returned is better terminology than kwh_produced. v0.1.1 has been updated to use that term.

Mind pointing out the HACS integration link - not seeing it

@jrouvier I’m up an running with the revisions I made and at a “I don’t want to mess with it anymore” point, so I don’t think I’ll have time to try out your code in the near term.

Agreed about terms “produced” and even “consumed” aren’t correct. Energy from grid and energy to grid should be the kWh terminology here or imported/exported to be concise.

Calculating net onboard the Emporia seems complicatedunnecessary. I conceded offloading that duty to HASS. Your method did make me think that I should be performing calculations for accumulation of exported energy onboard the Emporia instead of also loading HASS with that. I’d then be publishing the two energy values, imported and exported, simply as absolute meter readings vs. my current mismatched method which is absolute meter reading for imported, and relative to the last report for exported. Using that method I think I’ll still calculate net in HASS, but at least I won’t lose any bits of exported energy data during occasional HASS restarts that happen to execute while exporting energy to the grid.

Did you all connect it to your meter with the emporia software first or flash it and connect it? I’m not sure if my utility provider will need to reprovision the device once its flashed with esphome, or since the install code and MAC of the zigbee portion is stored on the zigbee device, flashing the esp32 won’t break that connection with the meter?

@Alej, you won’t need to reprovision, the MGM111 module handles all the communication with the meter and isn’t touched by flashing the esp32. However, you might want to connect it to the meter with the factory firmware first just to make sure the hardware works and supports your utility.

Great! It seems like the emporia Vue connect I got has an issue. It reports 371 watts all the time. Emporia said it may be defective and they can send another. I’m wondering what could have happened and if flashing esphome will fix the issue, or if the zigbee module can be reflashed? It did a firmware update on the zibgee module as soon as I connected it to Emporia’s app.

I’m so excited to get this flashed with esphome and have it directly in HA. Shipping was delayed and now it doesn’t seem to work. Hopefully the second one they send will work, although I’d prefer to get this one working.

I was able to flash the Vue Connect with ESP home. It must have some issue. It gives the same wattage reading every time it connects. This is the same thing it was doing with the empora firmware, but the wattage is different. With the Emporia firmware it always reported 371 watts. Now it is reporting to esphome 617 watts.

I’m not sure if there is a way to debug and see if it is a hardware issue, or something with the type of meter I have. Its connected to the meter, just doesn’t report the correct wattage.

<EDIT>
I should have read your earlier reply. Sounds like you already have a new one coming. I think we both have the same issue. Disappointing to know it wasn’t solved by flashing; I was hoping I might end up with 2 functioning units!
</EDIT>

I just received mine a few days ago, and was waiting to get it set up and working correctly before I flashed it with custom firmware. I also experienced the issue of a constant wattage being reported (mine happens to be 1704 watts). I contacted support and they said they would ship me another unit. They didn’t ask any clarifying questions, didn’t ask me to reboot it, etc. So I’m assuming this is a known issue with the hardware.

I used the chat feature through the app, but it was outside of working hours and they responded through [email protected]. So you can probably use either method.

I wouldn’t spend any more time debugging.

Does your new one work?

Nice video of how to load EspHome onto your Emporia Vue Emporia Vue Power Monitoring Review | HOW TO w/ ESPHome & Home Assistant - YouTube