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

Thinkingcleaner not working because of unresponsive cloud discovery #12822

Closed
Martinvdm opened this issue Mar 1, 2018 · 9 comments
Closed

Thinkingcleaner not working because of unresponsive cloud discovery #12822

Martinvdm opened this issue Mar 1, 2018 · 9 comments

Comments

@Martinvdm
Copy link

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.64.1

Python release (python3 --version):
3.6.4

Component/platform:
Thinkingcleaner

Description of problem:
Errors in log:

[homeassistant.components.sensor] Error while setting up platform thinkingcleaner
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/sensor/thinkingcleaner.py", line 59, in setup_platform
    devices = discovery.discover()
  File "/srv/homeassistant/lib/python3.6/site-packages/pythinkingcleaner/discovery.py", line 12, in discover
    data = response.json()
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Expected:
No errors

Problem-relevant configuration.yaml entries and steps to reproduce:

sensors:
  - platform: thinkingcleaner

Additional info:
Wasn't before upgrade

@Martinvdm
Copy link
Author

It seems te be that the issue is not returned any more,

@Martinvdm Martinvdm reopened this Mar 9, 2018
@Martinvdm
Copy link
Author

Martinvdm commented Mar 9, 2018

issue is returned. version is now 0.65.

2018-03-09 22:05:59 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform thinkingcleaner
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/sensor/thinkingcleaner.py", line 59, in setup_platform
    devices = discovery.discover()
  File "/srv/homeassistant/lib/python3.6/site-packages/pythinkingcleaner/discovery.py", line 12, in discover
    data = response.json()
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@sfiorini
Copy link

sfiorini commented Apr 1, 2018

Updated to 0.66.1 and I am now having the same error.

@Martinvdm
Copy link
Author

Martinvdm commented Apr 2, 2018

Seems to be that there has to be some code added for the Slow Setup or something has changed the way this component is waiting for the device.

SLOW_SETUP_MAX_WAIT

perhaps @fabaff does know this?

@sfiorini
Copy link

sfiorini commented Apr 2, 2018

The real issue is that the discovery URL is gone "https://thinkingsync.com/api/v1/discover/devices".
PyThinkingCleaner should be modified to take the local IP as a paramenter as the online URL has been decommissioned (apparently).
As a temp workaround I modified "discovery.py" on the pythinkingcleaner as follow:
def discover():

    devices = []
    devices.append(ThinkingCleaner('<THINKINGCLEANER LOCAL IP>', '<ABC123 ANY STRING WOULD WORK>'))

    return devices

@Martinvdm
Copy link
Author

Martinvdm commented Apr 28, 2018

This is still an issue. The online url has not working for a while and the error is filling the log.
created the same workarround as @sfiorini made it working for me.

@Martinvdm Martinvdm changed the title Thinkingcleaner issue after upgrade Thinkingcleaner not working because of unresponsive cloud discovery Apr 28, 2018
@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@Martinvdm
Copy link
Author

This is still an issue. Althought the online Cloud Discovery seems to work better, the fix @sfiorini has Made works but it is not a definite solution

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants