Pigotka / ha-cc-jablotron-cloud

HACS custom component for jablotron cloud integration
GNU General Public License v3.0
11 stars 1 forks source link

Entities do not show up with multiple connected homes #3

Closed zoezoevp closed 11 months ago

zoezoevp commented 1 year ago

Hi, I tried your custom integration and everything seems to be fine but I don't have any entities being created. I do have 2 homes connected in my account. When I log into the Jablotron portal, I need to select a home first before accessing the panels and sections. Could this be related?

lordzid commented 1 year ago

I have the same situation

Pigotka commented 1 year ago

Integration should create separate Devices per each home. But I never teste this scenario localy as I don't have two homes. Can you try to enable debug loggin on the integration and check for the errors in the log please?

michalrentka commented 1 year ago

@Pigotka I'm not seeing any entities as well and I only have 1 home in my account. My logs show:

2023-03-24 20:52:40.194 ERROR (MainThread) [custom_components.jablotron_cloud.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/jablotron_cloud/config_flow.py", line 59, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/jablotron_cloud/config_flow.py", line 34, in validate_input
    await hass.async_add_executor_job(hub.get_session_id)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  ... lot of recursion ...
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 61, in _make_request
    self.set_cookies()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 36, in set_cookies
    session_id = self.get_session_id()
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 81, in get_session_id
    status, data = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/jablotronpy/jablotronpy.py", line 48, in _make_request
    r = requests.post(
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/local/lib/python3.10/http/client.py", line 337, in begin
    self.headers = self.msg = parse_headers(self.fp)
  File "/usr/local/lib/python3.10/http/client.py", line 236, in parse_headers
    return email.parser.Parser(_class=_class).parsestr(hstring)
  File "/usr/local/lib/python3.10/email/parser.py", line 67, in parsestr
    return self.parse(StringIO(text), headersonly=headersonly)
  File "/usr/local/lib/python3.10/email/parser.py", line 56, in parse
    feedparser.feed(data)
  File "/usr/local/lib/python3.10/email/feedparser.py", line 176, in feed
    self._call_parse()
  File "/usr/local/lib/python3.10/email/feedparser.py", line 180, in _call_parse
    self._parse()
  File "/usr/local/lib/python3.10/email/feedparser.py", line 256, in _parsegen
    if self._cur.get_content_type() == 'message/delivery-status':
  File "/usr/local/lib/python3.10/email/message.py", line 578, in get_content_type
    value = self.get('content-type', missing)
  File "/usr/local/lib/python3.10/email/message.py", line 471, in get
    return self.policy.header_fetch_parse(k, v)
  File "/usr/local/lib/python3.10/email/_policybase.py", line 316, in header_fetch_parse
    return self._sanitize_header(name, value)
  File "/usr/local/lib/python3.10/email/_policybase.py", line 287, in _sanitize_header
    if _has_surrogates(value):
  File "/usr/local/lib/python3.10/email/utils.py", line 57, in _has_surrogates
    s.encode()
RecursionError: maximum recursion depth exceeded while calling a Python object

Looks like it can't connect, but I'm 100% sure I provided correct login credentials.

Pigotka commented 1 year ago

@fdegier Can you take a look? It originates in your library.

fdegier commented 1 year ago

@michalrentka did you ever log in with this user and accept the terms and conditions?

@Pigotka it must be an edge case but I can not simulate it right now. I think its due to a user not accepting the terms as that was also happening with HomeBridge Jablotron.

michalrentka commented 1 year ago

@fdegier if you mean log in to https://www.jablonet.net, then I logged in before and I can also log in now and I don't get any terms & conditions prompt. I guess I accepted it when I logged in the first time (which is before I tried this integration), I don't remember that. I'm checking the website and I don't see anything else to accept there.

michalrentka commented 1 year ago

@fdegier, @Pigotka I updated Home Assistant, HACS and wanted to give this another try. I enabled debug logging and reloaded the integration, I'm now getting:

2023-04-09 11:02:41.135 DEBUG (MainThread) [custom_components.jablotron_cloud] Preparing Jablotron data update coordinator
2023-04-09 11:02:44.452 DEBUG (MainThread) [custom_components.jablotron_cloud] Finished fetching Jablotron data in 3.317 seconds (success: True)

But nothing shows up anyway.

Pigotka commented 1 year ago

@michalrentka Please update integration to latest version and restart. We've added several improvements for this situation and extended logs in case the fix won't work. Please share.

michalrentka commented 1 year ago

@Pigotka I updated and gave it a few tries. Unfortunately I still don't see any devices or entities. But this time logs seem good:

2023-04-12 18:19:49.509 DEBUG (MainThread) [custom_components.jablotron_cloud] Preparing Jablotron data update coordinator
2023-04-12 18:19:52.865 DEBUG (MainThread) [custom_components.jablotron_cloud] Finished fetching Jablotron data in 3.356 seconds (success: True)

So no idea what's wrong. I don't see anything else jablotron-related in logs.

JHurme84 commented 1 year ago

@Pigotka I updated and gave it a few tries. Unfortunately I still don't see any devices or entities. But this time logs seem good:

2023-04-12 18:19:49.509 DEBUG (MainThread) [custom_components.jablotron_cloud] Preparing Jablotron data update coordinator
2023-04-12 18:19:52.865 DEBUG (MainThread) [custom_components.jablotron_cloud] Finished fetching Jablotron data in 3.356 seconds (success: True)

So no idea what's wrong. I don't see anything else jablotron-related in logs.

I have the same issue. Fresh installation and no devices or entities showing up. Here are my only logs related:

2023-04-12 21:04:21.089 DEBUG (MainThread) [custom_components.jablotron_cloud] Preparing Jablotron data update coordinator 2023-04-12 21:04:25.499 DEBUG (MainThread) [custom_components.jablotron_cloud] Finished fetching Jablotron data in 4.409 seconds (success: True)

dartapt commented 1 year ago

Same problem. Do not show me any device

Nick75wien commented 11 months ago

same here !

Pigotka commented 11 months ago

Recommend trying new version 0.5. We had an issue with homes without gates that cased problem discovering entities.

zoezoevp commented 11 months ago

testing v0.5 now and it seems to work. I can see the two homes and their sections. thx!

Pigotka commented 11 months ago

Oh wow better then expected.