PiotrMachowski / Home-Assistant-custom-components-Tauron-AMIplus

This sensor uses unofficial API to get energy usage and generation data from https://elicznik.tauron-dystrybucja.pl.
MIT License
139 stars 34 forks source link

Error while setting up tauron_amiplus platform for sensor #7

Closed dzikus closed 3 years ago

dzikus commented 3 years ago

Since last update 2020.12.1 this issue ocured:


2020-12-17 15:53:17 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up tauron_amiplus platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/tauron_amiplus/sensor.py", line 61, in setup_platform
    dev.append(TauronAmiplusSensor(name, username, password, meter_id, generation, variable))
  File "/config/custom_components/tauron_amiplus/sensor.py", line 123, in __init__
    configuration = calculate_configuration(username, password, meter_id)
  File "/config/custom_components/tauron_amiplus/sensor.py", line 86, in calculate_configuration
    json_data = response.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)
PiotrMachowski commented 3 years ago

Was it working before?

dzikus commented 3 years ago

Yes, this is my graph of storehouse in Tauron till yesterday. E1123E7A-DD1C-4643-999C-A63DD7F6AE57

dzikus commented 3 years ago

From what I noticed in ios app eLicznik, they asked to log in again today. Maybe it's just a coincidence with new release.

PiotrMachowski commented 3 years ago

Can you try to login using website?

dzikus commented 3 years ago

Without any problem.

Zrzut ekranu 2020-12-17 o 22 18 27
maymaymay commented 3 years ago

I have a problem too, i think its since 0_118_4 --> 0_118_5, but i'm not sure. I can log to WWW without any problem, but: obraz Above its on the top of the eLicznik site. Maybe that's the problem, maybe they are digging and that's why it's not working. obraz obraz

PiotrMachowski commented 3 years ago

It still works for me, but I haven't updated to 2020.12 yet, I will check it out after an upgrade

maymaymay commented 3 years ago

I think that if its tauron fault, restart HA is enough to break it.

darth-aragoth commented 3 years ago

Hello, I confirm, after updating to 2020.12 all entities related to amiplus are gone.

McKenzi84 commented 3 years ago

Same here. After update everything is gone.

karolhad commented 3 years ago

I wasn't able to configure the integration but looks like a small fix solves the issue: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Tauron-AMIplus/pull/8

PiotrMachowski commented 3 years ago

I have added additional fixes for G12 tariff.