skelgaard / homeassistant-apsystems

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

APSystem device and sensors not visible #32

Closed schalkk closed 6 months ago

schalkk commented 11 months ago

I see the following in my log file:

2023-09-14 12:15:25.111 DEBUG (MainThread) [custom_components.apsystems.sensor] post_data:
2023-09-14 12:15:25.111 DEBUG (MainThread) [custom_components.apsystems.sensor] {'queryDate': '20230914', 'sele ctedValue': 'xxxxxxx', 'systemId': 'yyyyyyy'}
2023-09-14 12:15:25.111 DEBUG (MainThread) [custom_components.apsystems.sensor] starting: 2023-09-14 12:15:25
2023-09-14 12:15:25.260 DEBUG (MainThread) [custom_components.apsystems.sensor] status code data: 200
2023-09-14 12:15:25.260 ERROR (MainThread) [homeassistant.components.sensor] apsystems: Error on device update! File "/config/custom_components/apsystems/sensor.py", line 209, in async_update
File "/config/custom_components/apsystems/sensor.py", line 313, in data
File "/config/custom_components/apsystems/sensor.py", line 301, in run

Could you point me where to look?

skelgaard commented 11 months ago

can you login to the webinterface apsystemsema.com ?

schalkk commented 11 months ago

Yes!

schalkk commented 11 months ago

Which URL should I use with the curl command to see that my Docker can access?

skelgaard commented 11 months ago

Login

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

Get Data

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

queryDate=20230615&selectedValue=apsystemsema_ecu_id&systemId=apsystemsema_system_id

schalkk commented 11 months ago

Do I need to pass a sessionID or something from Login to GET DATA? (using PostMan to test with before trying curl on Unix.)

schalkk commented 11 months ago

SessionID is now passed via Cookies from Login. Get data states:

<div class="flex" style="height: 100%;">
        <div class="title-text">Note</div>
        <div class="info-text">We are so sorry, EMA has encountered an
            error.<br/>click [OK] to email us and we will deal with it within 48 hours. Please re-login your system.</div>

            <div>
skelgaard commented 11 months ago

so an EMA error... .. can't do much other than catch the error and give an error in debug about it instead,,,,

schalkk commented 11 months ago

Will this cause the device and sensors not to show up? Anybody else facing the same issue or is it specific to my account?

skelgaard commented 11 months ago

yes nothing works as it should when no data is gotten from EMA i have the same problem selves can i see

jocelioalmeidaset commented 10 months ago

Any solution?

skelgaard commented 10 months ago

mine works fine.... can you se data in their interface and can you fetch data by the manual functions ? if you can't fetch data by the manual function then your phone app shouldn't work either as its same way it fetches data on.