Skip to content

Instantly share code, notes, and snippets.

@flaviut
Last active August 22, 2024 18:14
Show Gist options
  • Save flaviut/93a1212c7b165c7674693a45ad52c512 to your computer and use it in GitHub Desktop.
Save flaviut/93a1212c7b165c7674693a45ad52c512 to your computer and use it in GitHub Desktop.
Setting up Emporia Vue 2 with ESPHome
@cosmicosmo4
Copy link

I haven't noticed the "Synchronizing..." message. How often is it supposed to synchronize? Also, I do have the correct time in the logs, so it must have synchronized at some point.

@Ofloo
Copy link

Ofloo commented Jul 4, 2022

oh that's inside the emporia config

I have

time:
  - platform: sntp
    id: my_time
    timezone: $name_timezone
    servers:
      - 10.13.35.1
    on_time_sync:
      then:
        - logger.log: "Synchronized system clock"

However keep in mind that I have setup ntp on my gateway don't like my iot clients going to the internet so ...

@stephenjamieson
Copy link

You could try syncing with homeassistant:

time:
  - platform: homeassistant
    id: homeassistant_time
    timezone: America/New_York

@Ofloo
Copy link

Ofloo commented Jul 4, 2022

for name_timezone I have name_timezone: 'CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00'

@flaviut
Copy link
Author

flaviut commented Jul 4, 2022

I'm out of ideas :)

I'd suggest asking the ESPHome community directly. Please let us know what you find out!

@cosmicosmo4
Copy link

cosmicosmo4 commented Jul 11, 2022

Well I solved the problem by specifying the IP addresses of some NTP servers. I have no idea why the emporia was either not finding my pihole or failing DNS lookup for some reason. Everything else on this VLAN works fine.

time:
  - platform: sntp
    id: my_time
    servers:
      - 69.130.244.141
      - 69.164.198.192
      - 185.216.231.116

Unfortunately I imagine this is more likely to break in the future if IP addresses change.

@cdavis289
Copy link

Just wanted to say thanks for all of your work! I set this up yesterday and everything went very smoothly. I wanted to add some additional info for others that install this. I was quite nervous when I did this and this info may help others.

  1. Instead of holding the wire from the IO0 pin to the shield I used a piece of masking tape. I'm not sure if that is risky, but it worked for me.
  2. On os x, if this command failed "esptool.py -b 921600 read_flash 0 0x800000" I had to unplug my USB to serial converter module before trying the other baud rate otherwise I would get "in use" errors.
  3. When I ran the command "esphome run vue2.yaml" I didn't receive any errors.

To do a quick test after the software is flashed, I disconnected the power (VCC) and the IO0 ground, then plugged the VCC pin back in. You can then see if the unit successfully connects to your wifi without having to assemble the entire unit.

@flaviut
Copy link
Author

flaviut commented Jul 13, 2022

  1. Instead of holding the wire from the IO0 pin to the shield I used a piece of masking tape. I'm not sure if that is risky, but it worked for me.

Good idea! I've made a note of that in the instructions

You're right, I've taken so much stuff apart that I don't feel this is at all risky. But people unfamiliar with electronics very likely feel differently.

For future calibration, the only risk here is connecting the positive power and ground backwards, and I think that might be OK too as long as you notice within a few seconds.

To do a quick test after the software is flashed, I disconnected the power (VCC) and the IO0 ground, then plugged the VCC pin back in

Yes, this works, but some adapters don't have enough power to do this, since WiFi draws a lot of power. There's no risk of harm, but it will just keep turning on and off. So rather than answer questions about that, I've omitted it. I've never heard of any trouble connecting to WiFi, so it seems to have worked out!

@PanicRide
Copy link

Instead of holding the wire from the IO0 pin to the shield I used a piece of masking tape.

If your TTL adapter happens to have both the DTR and RTS pins exposed, you can let it automatically reboot the board and put the chip into flash mode when necessary. IO0 connects to DTR, and EN connects to RTS.

Here's an example of an adapter where you can easily solder a PIN to RTS on the side of it. :)

@rjchu
Copy link

rjchu commented Jul 13, 2022

@plopes9000
Thank you for your reply and MQTT code/config example, I appreciate it! I finally had a chance to give this a try and while things compile just fine, when I try and upload I get the output below and all that the Emporia publishes to MQTT is the status as being online or offline - no actual telemetry is published. Any ideas?

I'm on ESPHome 2022.6.22

INFO Uploading /config/.esphome/build/vue-casita-mains/.pioenvs/vue-casita-mains/firmware.bin (881440 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/esphome/esphome/main.py", line 931, in main
return run_esphome(sys.argv)
File "/esphome/esphome/main.py", line 918, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
File "/esphome/esphome/main.py", line 397, in command_run
return show_logs(config, args, port)
File "/esphome/esphome/main.py", line 292, in show_logs
return mqtt.show_logs(
File "/esphome/esphome/mqtt.py", line 105, in show_logs
topic = config[CONF_MQTT][CONF_LOG_TOPIC][CONF_TOPIC]
TypeError: 'NoneType' object is not subscriptable

@flaviut
Copy link
Author

flaviut commented Jul 16, 2022

@rjchu If you're not using their manual timing of MQTT messages, you'll want to remove the internal: true fields from the config.

As far as the other issue, try clearing the ESPHome caches. I'm not sure how to do that on your particular setup, but it might help out.

@wbarber69
Copy link

not sure what to do. Ive followed the directions. Ive got esphome to install through the terminal on my pc. Ive double checked and my vue just inst coming online on my wifi. my credentials are correct. when i get to the logger portion of installing, nothing shows in the terminal, it just sits as if its waiting for data but nothing comes through. I cannot understand why the device wont join my network. am i supposed to hook it up to mains for wifi to start working? shouldnt the esp module work independantly of the rest of the board? Has something changed that isnt being reflected in the instructions?

@wbarber69
Copy link

okay so I guess its a combination of not having the antenna connected and the usb to serial not delivering enough power for wifi. its on wifi now, but in the logs i get nothing:

INFO Reading configuration /config/esphome/vue2.yaml... INFO Detected timezone 'America/Chicago' INFO Starting log output from 192.168.1.178 using esphome API

@wbarber69
Copy link

And to make matters worse i cannot do ota updates to try to fix anything because i keep getting the error:
Error: Could not find the package with 'platformio/toolchain-esp32ulp @ ~1.22851.0' requirements for your system 'linux_aarch64'

but I have no other way to use esphome. its either pi4 and HAOS or win10 over usb-serial.

@cdavis289
Copy link

And to make matters worse i cannot do ota updates to try to fix anything because i keep getting the error: Error: Could not find the package with 'platformio/toolchain-esp32ulp @ ~1.22851.0' requirements for your system 'linux_aarch64'

but I have no other way to use esphome. its either pi4 and HAOS or win10 over usb-serial.

The error you are getting sounds similar to the error when you try to compile the yaml on the rpi. I had to setup esphome on my Mac to compile and OTA the updated bin files.

Do you have the unit installed with the clamps in your panel and you are not seeing any output?

@wbarber69
Copy link

I know that. I got the device online, and figured id try to install from esphome off HAOS as ive been having so many problems doing it from cmd terminal. Its not that i get no output with or without clamps, the logs timeout over and over again when trying to read logs. they arent empty there is nothing being reported.

@wbarber69
Copy link

okay Im not sure whats going on. Now HAOS is reporting 37 devices and i can see the power consumption. I guess i just had to wait 3 hours... Only issue now is that i left the configuration as is from the instructions intending to go in and change the clamp IDs etc. so now its working, but now am going to have to pull it all the way apart to be able to change settings?

@cdavis289
Copy link

okay Im not sure whats going on. Now HAOS is reporting 37 devices and i can see the power consumption. I guess i just had to wait 3 hours... Only issue now is that i left the configuration as is from the instructions intending to go in and change the clamp IDs etc. so now its working, but now am going to have to pull it all the way apart to be able to change settings?

You don’t need to remove it from the panel or take it apart. You can setup esphome on windows and update the config OTA.

@wbarber69
Copy link

Still no log output though. the esphome integration is showing active details, but no logs are viewable from esphome, just keeps timing out!!! wth?

@wbarber69
Copy link

okay Im not sure whats going on. Now HAOS is reporting 37 devices and i can see the power consumption. I guess i just had to wait 3 hours... Only issue now is that i left the configuration as is from the instructions intending to go in and change the clamp IDs etc. so now its working, but now am going to have to pull it all the way apart to be able to change settings?

You don’t need to remove it from the panel or take it apart. You can setup esphome on windows and update the config OTA.

yeah i wouldnt be complaining if that was an option. it also times out trying to connect.

@flaviut
Copy link
Author

flaviut commented Jul 17, 2022

@wbarber69 is the antenna fully screwed on? Is it fully inserted into the pcb? Is the antenna sticking out a side of the panel box that has the fewest wires (nearby wires interfere)? What happens if you move an access point closer to your panel?

@wbarber69
Copy link

the antenna is fine. the device is relaying information to HAOS but i cannot initiate a log output from ephome. I cannot do an ota update either through haos or esphome on windows, as it simply times out.

@wbarber69
Copy link

nevermind..... it was a stupid typo

@wbarber69
Copy link

well thanks guys, even if it was my stupid mistake. Now onto cracking open and hacking esphome onto all my emporia plugs.....

@stratus-ss
Copy link

Does anyone know how to get Home Assistant's Grid Consumption to recognize total power coming in off the grid. I assume there is something I have to do with the Vue template. Currently total power is set like this (I believe this is from the example)

 - platform: template
    name: "Total Power"
    lambda: return id(phase_a_power).state + id(phase_b_power).state;
    update_interval: 1s
    id: total_power
    unit_of_measurement: "W"

Does this have to be Wh?

@flaviut
Copy link
Author

flaviut commented Jul 26, 2022

Power is in watts, energy is in watt-hours or joules. Take a look at and use total_daily_energy, the next entry down.

I can't remember how I configured homeassistant, but everything you need should be in there--I have the exact same config, with a few numbers and names switched around.

@cdavis289
Copy link

cdavis289 commented Jul 26, 2022

Here is my code. You need to first get total power and then you use the total daily energy platform.

- platform: template
    name: "${friendly_devicename}: Total Power"
    lambda: return id(${devicename_no_dashes}_phase_a_power).state + id(${devicename_no_dashes}_phase_b_power).state;
    update_interval: 1s
    id: "${devicename_no_dashes}_total_power"
    unit_of_measurement: "W"
  
  - platform: total_daily_energy
    name: "${friendly_devicename}: Total Daily Energy"
    power_id: "${devicename_no_dashes}_total_power"
    accuracy_decimals: 0

@stratus-ss
Copy link

thanks @cdavis289 and @flaviut I appreciate what you both do to help this project!

@hiveai
Copy link

hiveai commented Jul 28, 2022

What is the recommended config for an unused input on the emporia vue2? I have some unused inputs that are showing values that are jumping all around (e.g. 0W->8W->24W->0W). How can I configure these Emporia inputs as unused and zero them out?

@flaviut
Copy link
Author

flaviut commented Jul 28, 2022

@hiveai delete their lines in the config and remove the places they're referenced from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment