Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to FoxEss Cloud stopped working after upgrading HA to 2023.4.0 and later... #152

Closed
ebesuman opened this issue Apr 12, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@ebesuman
Copy link

Connection to FoxEss Cloud stopped working after upgrading HA to 2023.4.0 and later, until then it was working perfectly...
I connect to the FoxEss website without problems with my credentials:

2023-04-12 20:13:13.053 DEBUG (MainThread) [custom_components.foxess.sensor] Updating data from https://www.foxesscloud.com/
2023-04-12 20:13:13.053 DEBUG (MainThread) [custom_components.foxess.sensor] Token is empty, authenticating for the firts time
2023-04-12 20:13:38.195 ERROR (MainThread) [homeassistant.components.nut] Timeout fetching NUT resource status data
2023-04-12 20:13:38.214 ERROR (MainThread) [homeassistant.components.rest.data] Timeout while fetching data: https://www.foxesscloud.com/c/v0/user/login
2023-04-12 20:13:38.217 ERROR (MainThread) [custom_components.foxess.sensor] Unable to login to FoxESS Cloud - No data recived
2023-04-12 20:13:38.219 ERROR (MainThread) [custom_components.foxess.sensor] Unexpected error fetching FoxESS data: 'bool' object has no attribute 'encode'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 206, in _async_update_data
return await self.update_method()
File "/config/custom_components/foxess/sensor.py", line 141, in async_update_data
await getAddresbook(hass, headersData, allData, deviceID, username, hashedPassword,0)
File "/config/custom_components/foxess/sensor.py", line 269, in getAddresbook
await restAddressBook.async_update()
File "/usr/src/homeassistant/homeassistant/components/rest/data.py", line 65, in async_update
response = await self._async_client.request(
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1520, in request
request = self.build_request(
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 349, in build_request
headers = self._merge_headers(headers)
File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 416, in _merge_headers
merged_headers.update(headers)
File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 200, in update
headers = Headers(headers)
File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 71, in init
self._list = [
File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 75, in
normalize_header_value(v, encoding),
File "/usr/local/lib/python3.10/site-packages/httpx/_utils.py", line 55, in normalize_header_value
return value.encode(encoding or "ascii")
AttributeError: 'bool' object has no attribute 'encode'
2023-04-12 20:13:38.224 DEBUG (MainThread) [custom_components.foxess.sensor] Finished fetching FoxESS data in 25.172 seconds (success: False)

HA version:
2023.4.2

foxess-ha version:
v0.24

@ebesuman ebesuman added the bug Something isn't working label Apr 12, 2023
@FozzieUK
Copy link
Collaborator

Can you check your version, this was corrected in v0.24 (and later)

@zxldz
Copy link

zxldz commented Apr 13, 2023

I have Home Assistant 2023.4.3 and FoxESS integration v0.25. Connection to FoxEss Cloud stopped working.

@fpacardoso
Copy link

I think that Foxess cloud say that inverter has offline and the integration don't pull the data.

@fpacardoso
Copy link

fpacardoso commented Apr 13, 2023

Workaround:
Replace the line 144 on file "sensor.py"
if int(allData["addressbook"]["result"]["status"]) == 1 or int(allData["addressbook"]["result"]["status"]) == 2 or int(allData["addressbook"]["result"]["status"]) == 3:

@fpacardoso
Copy link

btw, the cloud return to normal now.

@FozzieUK
Copy link
Collaborator

Workaround:
Replace the line 144 on file "sensor.py"
if int(allData["addressbook"]["result"]["status"]) == 1 or int(allData["addressbook"]["result"]["status"]) == 2 or int(allData["addressbook"]["result"]["status"]) == 3:

That looks as if your inverter was reporting as off-line, i’m not sure whether that was a local issue or a problem with the Fox cloud? - my test system here in the uk has been running ok all afternoon (on-line)

@FozzieUK
Copy link
Collaborator

It might be a good idea to catch the additional state being returned by the cloud, log it if not 1, and report the status in the sensor.foxess_inverter as ‘on-line’, ‘in-error’, ‘off-line’. ?

@fpacardoso
Copy link

I detect that from 10:29 to 11:24 and from 14:12 to 16:45 the foxesscloud have devive status offline but continues receiving data from inverter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants