-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
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
PSOklahoma Opower Virtual "Name does not resolve" #106989
Comments
Hey there @tronikos, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) opower documentation |
I was just coming to report the same issue. Exact same issue and errors that @chrishas35 received trying to implement Public Service Company of Oklahoma (psoklahoma). |
Unclear if it matters as it doesn't appear to be reaching Opower yet(?), but when inspecting network activity when logged into PSOklahoma.com, I'm seeing traffic going to pso.opower.com. |
FWIW I'm getting something similar for ConEd
|
At discord another user reported a similar issue: @joewashear007 added support for AEP Ohio and I generalized it for all AEP utilities after a user gave me their account credentials. @joewashear007 does it still work for you? I don't have access to an AEP account. My suggestion is to try running demo.py in https://github.com/tronikos/opower from your typical laptop/desktop and running it again from your Home Assistant environment. Hopefully that could help you debug what's going on. |
I have AEP Ohio and when I try to log it it just says “Unknown error occurred.” |
Well, I am going to have to wait for someone smarter to figure this out as I have zero experience with Python. Maybe @tronikos would be willing to use my credentials to get into PSOklahoma? If so, let me know what I need to do to get it to you. Scott |
response from demo.py when trying to access AEP ohio: Exception has occurred: ClientConnectorCertificateError The above exception was the direct cause of the following exception: File "/Downloads/opower-main/src/opower/utilities/aepbase.py", line 119, in async_login |
I have the [Name does not resolve] issue too. I'm running latest HA release on docker and spent some time looking at DNS. Randomly I was able to get the integration to work once but then it started failing again. Using demo.py I found that it will work every once and a while. Demo.py via aiohttp does an A and AAAA query for the dns name. My HA container uses a local dns resolver on pfsense (unbound) and 1.1.1.1. I found that when demo.py would work, it was getting a NO ERORR response from my local resolver for the fim. name quad A query before a NXDOMAIN is returned from 1.1.1.1. When demo.py fails, the AAAA queries get an NXDOMAIN from both DNS servers These quad A NXDOMAIN responses are before the A responses with the IP. So perhaps the aiohttp library or however it handles DNS resolution fails on the NXDOMAIN regardless of a successful NO ERROR response from a different query type later on. Why my local resolver on pfsesnse sometimes gives a no error response I have no idea, I'll check into that , but I think the issue here is the AAAA query and the NXDOMAIN response and how the client resolver handles that response - or - these providers have their AAAA dns responses misconfigured. I've not gone that route yet. |
After running "/Python 3.12/Install Certificates.command" demo.py runs successfully. Current bill forecast: Forecast(account=Account(customer=Customer(uuid='REDACTED'), uuid='REDACTED', utility_account_id='REDACTED', meter_type=<MeterType.ELEC: 'ELEC'>, read_resolution=None), start_date=datetime.date(2023, 12, 15), end_date=datetime.date(2024, 1, 13), current_date=datetime.date(2024, 1, 4), unit_of_measure=<UnitOfMeasure.KWH: 'KWH'>, usage_to_date=388.0, cost_to_date=0.0, forecasted_usage=602.0, forecasted_cost=0.0, typical_usage=756.0, typical_cost=0.0) Getting historical data: account= Account(customer=Customer(uuid='REDACTED'), uuid='REDACTED', utility_account_id='REDACTED', meter_type=<MeterType.ELEC: 'ELEC'>, read_resolution=<ReadResolution.QUARTER_HOUR: 'QUARTER_HOUR'>) aggregate_type= day start_date= 2023-12-28 10:54:05.884751 end_date= 2024-01-04 10:54:05.884790 |
Hi All So I see issue like this in my local home assistant install. I am not sure why we are getting cannot connect to host errors. When I run the opower script on it own, it works fine. But when running Home Assistant it has these errors. I just moved last week so I am still unpacking, but I will be trying to figure out what is going on. Sometimes when trying to add the integration it says “Unknown error occurred.” (like @tmcb82 mention). Waiting a few seconds and trying sometimes works - but it is not ideal. I am curious if adding a retry to the HTTP requests would improve things thought it hard to test when it unreliable fails. |
As i can get demo.py to run successfully (after running the "install Certificates.command"), I believe it has something to do with Python Certificates in HA Referencing my previous comments...when trying to add the aepohio integration (unknown error occured) this is the log output. Logger: aiohttp.server Error handling request The above exception was the direct cause of the following exception: Traceback (most recent call last): |
based on some names above I did a focused test with the getaddrinfo method. v6 fails, v4 works.
it looks like aiohttp connector.py defaults to 0 (AF_UNSPEC i think) for the family which will do both A and AAAA (I'm learning as I go here so I could be going to a dead end). It may be random but so far I see the A asked first but the AAAA response is faster and returns first in my environment. |
I think I've reached the end of my research. This feels like an aep dns issue. They should not return an NXDOMAIN for AAAAs that have no entry. It could be coded around I suppose by only doing A record queries. but I can't say I'm a fan of that. My work around (which I also don't like) was to create a host override in my pfsense dns resolver to answer the query with the IP. This results in the A working and AAAA getting a NO ERROR (proper behavior). This will get me up and running for now. demo.py is reliable now so we'll see how the integration behaves, I expect it to be solid as well. |
AEP Ohio seems to be working to me now, so I don’t know if it was an issue on their end. |
I am curious about trying to edit this line: core/homeassistant/components/opower/coordinator.py Lines 54 to 55 in afb5f3c
aiohttp_client.async_get_clientsession(hass, family=2), # socket.AF_INET == 2 |
If IPv4 works but IPv6 doesn't we could do a workaround similar to what forecast solar does, see: and: I'm running HAOS. Using Advanced SSH & Web Terminal I run:
I got 302. But running the command inside the Home Assistant docker after I run:
I got |
I opened home-assistant/supervisor#4798 |
@joewashear007 that would be a much easier workaround. Can you try modifying the file locally and report back whether it fixes the issue? |
seems to work here in HA. It doesn't look like demo.py was affected, it is still failing. Is that expected? |
I have just made this change on my instance. It seems to have loaded the data without an issue. I will check again tomorrow to see if it continuous to work. |
The DNS for this domain seems rather broken, which may explain the inconsistent results? https://dnschecker.org/#A/fim.psoklahoma.com Currently I'm getting about half resolved and half not. |
https://dnschecker.org/#AAAA/fim.psoklahoma.com shows that IPv6 is broken for all servers |
I interpreted that as no AAAA response with IPv6 info regardless of correct or incorrect (NO ERROR vs NXDOMAIN). Even a site with a correctly configured AAAA response that has no v6 addresses gives an X. e.g. www.bestbuy.com. |
I see the August integration had similar issues with IPv6. I'm fixing it similarly in #107203 |
Thanks for the fix! This is now working for me in 2024.1.1. |
The problem
When configuring Opower for Public Service Company of Oklahoma (PSO), a "Name does not resolve" error is returned.
What version of Home Assistant Core has the issue?
core-2024.1.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
psoklahoma
Link to integration documentation on our website
https://home-assistant.io/integrations/psoklahoma
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: