vk2him / Enphase-Envoy-mqtt-json

Takes real time stream from Enphase Envoy and publishes to mqtt broker
MIT License
55 stars 23 forks source link

Max retries exceeded #32

Closed leah-potato closed 4 months ago

leah-potato commented 4 months ago

Hello!

Thanks so much for setting all this up. When it's working it's amazing to have live readings, but running into an issue with intermittent connectivity:

Exception fetching stream data: HTTPSConnectionPool(host='envoy.local', port=443): Max retries exceeded with url: /ivp/meters/readings (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffff99cb78d0>: Failed to establish a new connection: [Errno -5] Name has no usable address'))

s6-rc: info: service legacy-services successfully started Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/socket.py", line 962, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno -5] Name has no usable address

Enphase-Envoy-mqtt-json config: image What does USE_FREEDS do? Currently turned off.

Mosquitto broker config:

image

When it does work, I can see the values correctly in MQTT explorer. My enphase gateway is connected via wifi, but the connection is pretty rock solid with https://envoy.local/home always available.

Appreciate any tips on how to troubleshoot. Thanks!

vk2him commented 4 months ago

Hi Leah,

I suspect it's a local DNS issue, try changing envoy.local to the actual envoys ip in the configuration then restart it. Coincidentally another user had a similar issue 2 weeks ago and reported it under issue https://github.com/vk2him/Enphase-Envoy-mqtt-json/issues/31

leah-potato commented 4 months ago

Yep, that was it! I wonder how I can get local dns working correctly. I suspect that is the issue for some devices on my network with moving ip addresses.

Anyway thanks a bunch. So cool having real time data! I've turned into my dad going around turning off light switches and watching the gauge go down instantly. You've created a monster.

vk2him commented 4 months ago

Glad you got it working, local dns can be a bit of a pita.

I'm using a card I found to display the data, it's the Power Distribution card image

'''

type: custom:power-distribution-card title: Power entities:

leah-potato commented 4 months ago

Pretty cool! I've been playing around with that power flow plus card but it doesn't support combining 3 phases. I'm really only just getting started with the dashboard and the first piece was getting real time data (thanks to you!) - means the we're not wasting a whole bunch of money exporting to the grid. Today was the first day where I've finally got it dialed in that we are only over/under ~100w... at least during the day. I can see a battery in our future soon.

HA is very addictive I've come to realise.

image
vk2him commented 4 months ago

What you've done is impressive. You should be able to create a sensor that sums each phase's power and use that in the Power flow plus card? I'll close this off now. Thanks