vincentwolsink / home_assistant_enphase_envoy_installer

This is a HACS custom integration for Enphase Envoys with firmware version 7 and up.
Apache License 2.0
54 stars 10 forks source link

[BUG] Failed setup, will retry #47

Closed BVGorp closed 11 months ago

BVGorp commented 11 months ago

Describe the bug Just installed this version of the integration comming from DEV. Installed v 0.2.4 and tried 0.3 beta 2 both give about the same issue. The integration shows as "Failed setup, will retry" on integrations page.

Account type

Envoy

Home Assistant

Additional context

2023-07-19 13:20:50.650 ERROR (MainThread) [custom_components.enphase_envoy] Unexpected error fetching envoy Envoy 122111010631 data: maximum recursion depth exceeded while calling a Python object
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 242, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/__init__.py", line 91, in async_update_data
data[description.key] = await envoy_reader.relay_status()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 617, in get_data
return self.data.get(name)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 336, in __getattr__
result = getattr(self, name)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 336, in __getattr__
result = getattr(self, name)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 336, in __getattr__
result = getattr(self, name)
^^^^^^^^^^^^^^^^^^^
[Previous line repeated 962 more times]
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 434, in relay_status
status = self._path_to_dict(
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 317, in _path_to_dict
for d in self._resolve_path(path, default=[]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/enphase_envoy/envoy_reader.py", line 301, in _resolve_path
result = jsonpath(self.data, path)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 316, in jsonpath
trace(cleaned_expr, obj, '$')
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 167, in trace
trace(x, obj[loc], s(path, loc))
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 167, in trace
trace(x, obj[loc], s(path, loc))
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 194, in trace
walk(loc, x, obj, path, f05)
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 245, in walk
funct(i, loc, expr, obj, path)
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 189, in f05
eval_result = evalx(loc, obj[int(key)])
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 284, in evalx
loc = re.sub(r'(?<!\\)(@\.[a-zA-Z@_.0-9]+)', varmatch, loc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/re/__init__.py", line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 282, in varmatch
return brackets(elts[1:])
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 273, in brackets
if isint(e):
^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/jsonpath.py", line 112, in isint
return x.isdigit()
^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object
vincentwolsink commented 11 months ago

Hi! Can you please supply the output of your https://envoy.local/ivp/peb/devstatus

BVGorp commented 11 months ago
{ "counters": {"pcu": {"expected": 18,"discovered": 18,"ctrlsTotal": 18,"ctrlsGone": 0,"ctrlsCommunicating": 18,"chansTotal": 18,"chansRecent": 18,"chansProducing": 18}, "acb": {"expected": 0,"discovered": 0,"ctrlsTotal": 0,"ctrlsGone": 0,"ctrlsCommunicating": 0,"chansTotal": 0,"chansRecent": 0,"chansProducing": 0}, "nsrb": {"expected": 1,"discovered": 1,"ctrlsTotal": 1,"ctrlsGone": 0,"ctrlsCommunicating": 1,"chansTotal": 1,"chansRecent": 1,"chansProducing": 0}, "pld": {"expected": 19,"discovered": 19,"ctrlsTotal": 19,"ctrlsGone": 0,"ctrlsCommunicating": 19,"chansTotal": 19,"chansRecent": 19,"chansProducing": 18}, "esub": {"expected": 0,"discovered": 0,"ctrlsTotal": 0,"ctrlsGone": 0,"ctrlsCommunicating": 0,"chansTotal": 0,"chansRecent": 0,"chansProducing": 0}}, "pcu": {"fields": ["serialNumber", "devType", "communicating", "recent", "producing", "reportDate", "temperature", "dcVoltageINmV", "dcCurrentINmA", "acVoltageINmV", "acPowerINmW"], "values": [["SN", 1, true, true, true, 1689793862, 22, 28686, 144, 225288, 3974], ["SN", 1, true, true, true, 1689793865, 21, 28952, 145, 225768, 4078], ["SN", 1, true, true, true, 1689793893, 21, 28679, 136, 225520, 3762], ["SN", 1, true, true, true, 1689793924, 22, 28514, 144, 225296, 3643], ["SN", 1, true, true, true, 1689793924, 22, 28720, 139, 225632, 3792], ["SN", 1, true, true, true, 1689793953, 22, 28122, 119, 225640, 3420], ["SN", 1, true, true, true, 1689794224, 22, 28306, 106, 225408, 1492], ["SN", 1, true, true, true, 1689794225, 22, 27970, 96, 225216, 1283], ["SN", 1, true, true, true, 1689794225, 22, 28003, 88, 224816, 1302], ["SN", 1, true, true, true, 1689794226, 23, 28022, 94, 225040, 1278], ["SN", 1, true, true, true, 1689794227, 23, 28044, 102, 223720, 1232], ["SN", 1, true, true, true, 1689794228, 23, 28200, 91, 223928, 1355], ["SN", 1, true, true, true, 1689794228, 23, 27717, 86, 223552, 1141], ["SN", 1, true, true, true, 1689794229, 23, 27724, 84, 223776, 1194], ["SN", 1, true, true, true, 1689794230, 23, 28051, 85, 223760, 1250], ["SN", 1, true, true, true, 1689794230, 22, 28287, 110, 224488, 1074], ["SN", 1, true, true, true, 1689794231, 23, 28147, 87, 223920, 1110], ["SN", 1, true, true, true, 1689794232, 23, 28128, 83, 223864, 1174], ["SN", 12, true, true, false, 1689794203, 0, 0, 0, 0, 0]]}, "acb": {"fields": ["serialNumber", "SOC", "minCellTemp", "maxCellTemp", "capacity", "totVoltage", "sleepEnabled", "sleepMinSoc", "sleepMaxSoc" ], "values": []}, "nsrb": {"fields": ["serialNumber", "relay", "forced", "reason_code", "reason", "line-count", "line1-connected", "line2-connected", "line3-connected"], "values": [["SN", "closed", false, -1, "ok", 1, true, false, false]]}}
BVGorp commented 11 months ago

removed the serial numbers

vincentwolsink commented 11 months ago

Can you please share the error output from version 0.2.4? (The one in additional context seems to be from beta 0.3.0)

mnederlof commented 11 months ago

with the beta version, there seems to be a bug, when you only have 1 relay installed 😅 The PR for this bug will follow soon..

(PS: as for the stable release, i did not test what went wrong there..)

BVGorp commented 11 months ago

beta 3 works thanks