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

Component Not Starting - Errorcode 500 on Data Pull #2

Open
jimmyray78 opened this issue Jun 6, 2021 · 2 comments
Open

Component Not Starting - Errorcode 500 on Data Pull #2

jimmyray78 opened this issue Jun 6, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jimmyray78
Copy link

Hi there,

During the init of HomeAssistant there seems to be an error thrown (HTTP 500).

2021-06-06 10:02:40 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.apsystems
2021-06-06 10:02:41 DEBUG (MainThread) [custom_components.apsystems.sensor] Sensor is running. Start/Stop time: 2021-06-06 05:14:31.516857-07:00, 2021-06-06 21:23:23.045027-07:00
2021-06-06 10:02:41 DEBUG (MainThread) [custom_components.apsystems.sensor] Sensor is running. Start/Stop time: 2021-06-06 05:14:31.516857-07:00, 2021-06-06 21:23:23.045027-07:00
2021-06-06 10:02:41 DEBUG (MainThread) [custom_components.apsystems.sensor] Sensor is running. Start/Stop time: 2021-06-06 05:14:31.516857-07:00, 2021-06-06 21:23:23.045027-07:00
2021-06-06 10:02:41 DEBUG (MainThread) [custom_components.apsystems.sensor] Sensor is running. Start/Stop time: 2021-06-06 05:14:31.516857-07:00, 2021-06-06 21:23:23.045027-07:00
2021-06-06 10:02:41 DEBUG (MainThread) [custom_components.apsystems.sensor] Sensor is running. Start/Stop time: 2021-06-06 05:14:31.516857-07:00, 2021-06-06 21:23:23.045027-07:00
2021-06-06 10:02:42 DEBUG (MainThread) [custom_components.apsystems.sensor] status code login: 200
2021-06-06 10:02:42 DEBUG (MainThread) [custom_components.apsystems.sensor] post_data:
2021-06-06 10:02:42 DEBUG (MainThread) [custom_components.apsystems.sensor] {'queryDate': '20210606', 'selectedValue': 'XXXX', 'systemId': 'XXXXX'}
2021-06-06 10:02:42 DEBUG (MainThread) [custom_components.apsystems.sensor] starting: 2021-06-06 10:02:42
2021-06-06 10:02:42 DEBUG (MainThread) [custom_components.apsystems.sensor] status code data: 500
2021-06-06 10:02:42 DEBUG (MainThread) [custom_components.apsystems.sensor] <Response [500]>
2021-06-06 10:02:42 ERROR (MainThread) [homeassistant.components.sensor] apsystems: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 432, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_device_update
await task
File "/config/custom_components/apsystems/sensor.py", line 143, in async_update
ap_data = await self._fetcher.data()
File "/config/custom_components/apsystems/sensor.py", line 249, in data
await self.run()
File "/config/custom_components/apsystems/sensor.py", line 238, in run
self.cache = result_data.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/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)
@bgbraga bgbraga added the bug Something isn't working label Jun 7, 2021
@bgbraga bgbraga self-assigned this Jun 7, 2021
@bgbraga
Copy link
Owner

bgbraga commented Jun 7, 2021

@jimmyray78 thanks...

Yeah today I tested the yesterday version and see the APSystems changed the cookie logic from his portal. To have a better component handling it now I'm using a browser logic instead of request API. It will handle cookies in a better way. Available at 1.0.3.

@bgbraga
Copy link
Owner

bgbraga commented Jun 13, 2021

@jimmyray78 the version 1.0.3 solves your problem?

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

2 participants