-
Notifications
You must be signed in to change notification settings - Fork 10
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
Not updating #8
Comments
I'm seeing (not seeing?) the same - no updates coming through, but can't see any errors... |
Seeing the following
|
I am seeing similar:
|
My instance still hasn't pulled data in 2 weeks so I'm not sure if this integration works anymore. |
I don't believe this plugin refreshes the login token after first run. So restarting the server might fix this for a time. It will die eventually. I modified the code locally to just login each time. |
@alistair how specifically ? |
In ipython console can auth but not get any info.. Ideas ? n [4]: import api In [6]: ce.login() In [7]: ce.refresh_session() In [8]: ce.get_accounts() In [15]: ce.get_usage('2024','3','15') In [16]: ce.get_usage('2024','4','10') In [17]: ce.get_usage('2024','4','20') |
my understanding is the only place refresh_session is called is within login. If the api_token is persisted across calls of this plugin then login is only called once. |
Testing confirmed that calling .refresh_session() did not update _api_token BUT calling login() again did update the _api_key variable. Although calling get_usage still doesn't get anything. In [19]: ce.get_usage('2024','4','20') |
You are referring to logger.py, I'm going direct to the api to confirm it's operation. FYI the api.ContactEnergyApi class has the following methods. I can manually use the code from the get_accounts() and confirm it retrieves our account details. So login & get_accounts works perfectly. :-) n [56]: result = requests.get(ce._url_base + "/customer/v2?fetchAccounts=true", headers=headers) |
Wonder if the api changed ? In [76]: headers = {"x-api-key": ce._api_key, "session": ce._api_session} In [78]: result.status_code In [79]: result.text |
Ok figured it out, api is fine. result = requests.get(ce._url_base + "/customer/v2?fetchAccounts=true", headers=headers) Fix will be to loop through the contracts list and on;y record the contract id for the active contract. |
|
works from manually calling the api but oddly enough not for HA |
Fingers crossed that you get it working @hydrocloricacid |
It's my first time using this package and it wasn't working. I updated the hardcoded api key with the one I see my browser is using and with that was enough to get data. Something interesting I found is that is just retrieving data until 4 days earlier than the current date only, so looking at the state of the sensor will always show 0.0 as there is no data for current date |
System Health details
System Information
Home Assistant Community Store
Home Assistant Cloud
Home Assistant Supervisor
Dashboards
Recorder
Spotify
Checklist
Describe the issue
I was just wondering if this sensor still works, it's showing 0.00 for me but the contact app shows 280kwh
Reproduction steps
Debug logs
Diagnostics dump
No response
The text was updated successfully, but these errors were encountered: