skelgaard / homeassistant-apsystems

An APsystems Sensor for Home Assistant
Apache License 2.0
25 stars 9 forks source link

Did the integration stopped working? #15

Closed andrebbruno closed 1 year ago

andrebbruno commented 1 year ago

Tried rebooting the ECU, Home Assistant etc and nothing seems to be working since yesterday.

Are you guys seeing this as well?

Shadyville08 commented 1 year ago

Yes, stopped working over here as well.

skelgaard commented 1 year ago

i can't do much, when https://apsystemsema.com/ema/ isn't working..... it should work again, when the website is up, but until then, we just have to wait or mail them and ask when it will be back

sjakief commented 1 year ago

i can't do much, when https://apsystemsema.com/ema/ isn't working..... it should work again, when the website is up, but until then, we just have to wait or mail them and ask when it will be back

for some reason, your link goes to https://apsystemsema.com/ema/ema, when I go to https://apsystemsema.com/ema/index.action from a browser it works fine

skelgaard commented 1 year ago

i will look into it tomorrow :)

sjakief commented 1 year ago

thx

devano1701 commented 1 year ago

I have got almost the same problem here. I did not get any sensor readings since installing the program. All five sensors are “Niet beschikbaar”. I live in an apartment and have no direct access to the ECU-R, but I can read my PV panels through apsystemsema on the web and in the app. It seems to me that there is no data coming from apsystemsema. I get the following error messages in the log. Deze fout is ontstaan door een aangepaste integratie.

Logger: homeassistant.helpers.entity Source: custom_components/apsystems/sensor.py:227 Integration: apsystems (documentation) First occurred: 30 oktober 2022 om 07:33:08 (825 occurrences) Last logged: 11:28:12

Update for sensor.apsystems_energy_day fails Update for sensor.apsystems_energy_latest fails Update for sensor.apsystems_power_max_day fails Update for sensor.apsystems_power_latest fails Update for sensor.apsystems_date fails Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.10/site-packages/simplejson/init.py", line 525, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.10/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/src/homeassistant/homeassistant/helpers/entity.py", line 515, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 710, in async_device_update raise exc File "/config/custom_components/apsystems/sensor.py", line 142, in async_update ap_data = await self._fetcher.data() File "/config/custom_components/apsystems/sensor.py", line 238, in data await self.run() File "/config/custom_components/apsystems/sensor.py", line 227, in run self.cache = result_data.json() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

In the code (sensor.py) is a _LOGGER function, but I cannot find any logs from this code. Can you help me?

daniel1204xx commented 1 year ago

same issue for me .... .is there any chance to get it fixed and working again ? I can not find where I need to replace the URL :-( Can someone help ? Thanks :)

skelgaard commented 1 year ago

i have connection to their system again in my test, but gets an error on home assistant.... i'm working on which part of the request it is missing to make it work.... I hope to soon have it working again, but python is not my specialty but i'm working though it :)

krizzziz commented 1 year ago

i have connection to their system again in my test, but gets an error on home assistant.... i'm working on which part of the request it is missing to make it work.... I hope to soon have it working again, but python is not my specialty but i'm working though it :)

Any luck yet?

ironboy84 commented 1 year ago

I also lost connection to AP System 👎 Any solutions? :-)

devano1701 commented 1 year ago

I get a 403 Forbidden response from the login in line 198.
 Probably AP systems has changes their web interface. I am not experienced enough to tackle this further.

MORITZ0405 commented 1 year ago

Is it working ?

skelgaard commented 1 year ago

i have connection in phpstorm again, but i can't get it to work in python... i'm still trying though

MORITZ0405 commented 1 year ago

What did you enter in php storm I could help you there

MORITZ0405 commented 1 year ago

I think this is the problem ? https://apsystemsema.com/ema/ajax/getReportApiAjax/getPowerOnCurrentDayAjax

skelgaard commented 1 year ago

its something todo with python, cause there is nothing special in the queries

Login

GET https://www.apsystemsema.com/ema/intoDemoUser.action?id=KEY

Get Data

POST https://www.apsystemsema.com/ema/ajax/getReportApiAjax/getPowerOnCurrentDayAjax

queryDate=20221118&selectedValue=ECUID&systemId=SYSTEMID

skelgaard commented 1 year ago

hmm just saw, there is www.... wonder if its the whole problem... let me test

MORITZ0405 commented 1 year ago

noooo No

MORITZ0405 commented 1 year ago

Maybe python can't connect to https url

skelgaard commented 1 year ago

it has done before without problems

skelgaard commented 1 year ago

well i found out part of the problem...

2022-11-21 19:15:22.947 DEBUG (MainThread) [custom_components.apsystems.sensor] Sending login: https://www.apsystemsema.com/ema/intoDemoUser.action?id=XXXXXXX 2022-11-21 19:15:23.035 DEBUG (MainThread) [custom_components.apsystems.sensor] Login result:403

so its the login... working on it...

devano1701 commented 1 year ago

I got the same results here. When I run de request directly in python with the requests.py library I again get a 403. But if I run the request from VS Code I get a 200. It seems that the python library request.py contains the problem. Or APSystems changed something on their website.

MORITZ0405 commented 1 year ago

IDK

MORITZ0405 commented 1 year ago

I think i Fixed it

MORITZ0405 commented 1 year ago

I get a 200 directly in python

skelgaard commented 1 year ago

lets hear, or do a PR and i will merge :)

MORITZ0405 commented 1 year ago

I changed something in my pycharm and now I get a 200

MORITZ0405 commented 1 year ago

dwdhzgft

MORITZ0405 commented 1 year ago

xD

MORITZ0405 commented 1 year ago

pyyyyyyyyyyyyy

MORITZ0405 commented 1 year ago

It doesn't work in HACS

skelgaard commented 1 year ago

i have connection in home assistent.... just want to see the data, then i will push a new version

skelgaard commented 1 year ago

new release is out... give it a test

MORITZ0405 commented 1 year ago

THX