Sounds good, and I saw the link. I just wanted to verify that was the correct file. Thanks!
Tried it out and it didnāt work. Went to version 0b4 and it works, but 0b6 does not. Log below, but Iām not sure if the debug is included in the regular HA logs, but Iāll gladly supply anything needed so let me know.
2019-03-29 11:05:41 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.1 seconds.
2019-03-29 11:05:41 DEBUG (SyncWorker_3) [pyeconet.api] {'access_token': 'xxxxxxxxxxxxxxxx', 'token_type': 'bearer', 'expires_in': 31535999, 'refresh_token': 'xxxxxxxxxxxxxxxxx', 'user_type': 'User'}
2019-03-29 11:05:41 INFO (SyncWorker_3) [pyeconet.api] Authentication was successful, token set.
2019-03-29 11:05:43 ERROR (MainThread) [custom_components.water_heater] Error while setting up platform econet
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/water_heater/econet.py", line 75, in setup_platform
water_heaters = econet.get_water_heaters()
File "/config/deps/lib/python3.7/site-packages/pyeconet/api.py", line 232, in get_water_heaters
self.api_interface))
File "/config/deps/lib/python3.7/site-packages/pyeconet/equipment/water_heater.py", line 29, in __init__
self.id = device_as_json.get('id')
AttributeError: can't set attribute
2019-03-29 11:05:43 INFO (MainThread) [homeassistant.setup] Setup of domain water_heater took 9.6 seconds.
2019-03-29 11:05:43 INFO (MainThread) [homeassistant.loader] Loaded smartthings.cover from homeassistant.components.smartthings.cover
Hmmm thatās strange, Iāll take a look when I get home.
Just pushed 0b7
can you give that a shot?
Great, thanks! Iāll get the debugging enabled when I get home this evening and will get those logs to you. I updated with the latest
I just loaded 0.b7 and received the following error while starting HA. Thanks for sticking with it and helping to resolve this code! Iām in the process of adding the logging which might help you in the long-run.
2019-03-29 20:41:47 ERROR (MainThread) [custom_components.water_heater] Error while setting up platform econet
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/water_heater/econet.py", line 75, in setup_platform
water_heaters = econet.get_water_heaters()
File "/config/deps/lib/python3.7/site-packages/pyeconet/api.py", line 232, in get_water_heaters
self.api_interface))
File "/config/deps/lib/python3.7/site-packages/pyeconet/equipment/water_heater.py", line 29, in __init__
self.id = device_as_json.get('id')
AttributeError: can't set attribute
Can you confirm that 0b7
downloaded? I manually downloaded it just now and line 29 isnāt self.id = device_as_json.get('id')
like your log shows. I think that might have been 0b6
check your file and make sure it is up-to-date?
Just got home and updated, so I have 0b7 loaded and working for me. Iāll keep you posted if it crashes again, and if there are any specific logs you would like, please let me know.
And to echo what diode said, thank you for your work on this. It is very much appreciated.
FWIW
I was having a lot of these same issues. As part of my debug I created a new home and device with Econet creating an entirely new entity. It solved my problems and am now running fine on 90.1.
The only thing I get is an occasional:
2019-03-30 17:02:54 WARNING (MainThread) [homeassistant.helpers.entity] Update of water_heater.hw is taking over 10 seconds`
Thatās interesting that just creating a new instance fixed your issues. I never did go down that route, but maybe Iāll try and give it a shot tomorrow when I get a chance.
Here are some additional logs. This evening I was able to enable debugging which will hopefully yield additional info at the next go-around?
2019-03-30 03:30:52 ERROR (MainThread) [homeassistant.helpers.entity] Update for water_heater.heat_pump_water_heater_gen_4 fails
Traceback (most recent call last):
File "/config/deps/lib/python3.7/site-packages/pyeconet/api.py", line 88, in get_usage
return arequest.json()
File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 379, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/water_heater/econet.py", line 210, in update
self.water_heater.update_state()
File "/config/deps/lib/python3.7/site-packages/pyeconet/equipment/water_heater.py", line 117, in update_state
usage = self.api_interface.get_usage(self.id)
File "/config/deps/lib/python3.7/site-packages/pyeconet/api.py", line 91, in get_usage
_LOGGER.debug(str(response))
NameError: name 'response' is not defined
2019-03-30 03:33:09 WARNING (Thread-3) [pychromecast.socket_client] [Living Room Chromecast:8009] Heartbeat timeout, resetting connection
2019-03-30 03:45:25 WARNING (Thread-8) [pychromecast.socket_client] [Living Room:8009] Heartbeat timeout, resetting connection
2019-03-30 03:45:25 ERROR (Thread-8) [pychromecast.socket_client] [Living Room:8009] Failed to connect to service Chromecast-ca07ee5a9fe738ca40567f863a7c457e._googlecast._tcp.local., retrying in 5.0s
2019-03-30 03:46:54 ERROR (MainThread) [homeassistant.helpers.entity] Update for water_heater.heat_pump_water_heater_gen_4 fails
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 57, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/local/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 301, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x6ed2dbb0>: Failed to establish a new connection: [Errno -3] Try again
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='econet-api.rheemcert.com', port=443): Max retries exceeded with url: /equipment/None (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6ed2dbb0>: Failed to establish a new connection: [Errno -3] Try again'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 379, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/water_heater/econet.py", line 210, in update
self.water_heater.update_state()
File "/config/deps/lib/python3.7/site-packages/pyeconet/equipment/water_heater.py", line 112, in update_state
device_state = self.api_interface.get_device(self.id)
File "/config/deps/lib/python3.7/site-packages/pyeconet/api.py", line 100, in get_device
arequest = requests.get(url, headers=HEADERS)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
Hmm not seeing any debug info there, that all looks like just errors. What I really need is the response that the API is sending back when this error happens. Want I still doesnāt understand is, it looks like itās trying to make a call to equipment/None (None should be your heaters ID) I donāt know how thatās getting set to None.
@diode it doesnāt look like you are running the 0b7
version. Your log shows an error on line 91 _LOGGER.debug(str(response))
I made the mistake of using the variable response when it is actually called arequest I think that was an issue in 0b5
? Can you make sure you are running the newest version?
Mine has been up for around 36 hours now, so Iām hoping things are OK.
With that said, I still donāt know where these debug logs will be if I do have issues. Are they in the same HA logs on the dev-info page? Just wanting to help out if I can.
Yes, they will be in the same log as the HA log. By default the logging level is set to info I think, which means debug would be filtered out. Enabling debug just means include everything from debug up. debug, info, warning, errorā¦
I must not have restarted HA after enabling the logging. I restarted it this morning and will provide you any future logs. My apologies for any confusion there.
No problem, just let me know how it goes.
Is this anything more of what youāre looking for?
So far it has remained connected even through the instances where it indicates that itās taking over 10 seconds to update which is how it was working several weeks ago. So, with that, weāre gaining!
2019-03-31 18:16:34 ERROR (MainThread) [homeassistant.helpers.entity] Update for water_heater.heat_pump_water_heater_gen_4 fails
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 379, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/water_heater/econet.py", line 210, in update
self.water_heater.update_state()
File "/config/deps/lib/python3.7/site-packages/pyeconet/equipment/water_heater.py", line 129, in update_state
for equipment in vacation.get("participatingEquipment"):
AttributeError: 'str' object has no attribute 'get'
Is there any output above that error that is a DEBUG logging not an ERROR? Seems like the service sent back a string when it should have sent back a list which isnāt something I am expecting. Might need to enable some more debugging here.
I just uploaded version 0b8
which logs out a debug message of the response from every service call even if it didnāt fail. Prior to that I was only logging on an error and I guess it is possible the service is just sending back something I wasnāt expecting, which isnāt an error.
Sounds good. Iāll update with the latest when I get home this evening and provide any additional logs.
In regards to the DEBUG, the only line that starts with that included the response below:
2019-03-31 22:01:01 DEBUG (SyncWorker_15) [pyeconet.api] <Response [504]>
That helps somewhat, might need to adjust the logging still. I believe that 504 is the response code which is an error coming from the server.