-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Smart Meter Texas Integration Failed to Connect #40348
Comments
Please post log messages if there are any. |
@bdraco Do I need to enable a specific level of logging? I don't see anything on the logs page on home assistant? |
You'll probably have to modify the code to get the full stack
|
The only thing I see so far is |
Do I need to enable some sort of API for it to work? It isn't described in the docs, but I remember a while back there was a way of integrating smart meter texas but you had to email them to get api access. |
You shouldn't need to enable anything as it uses the site api. They do have some strict rate limits on number of logins so you might be hitting that. |
Hey there @grahamwetzler, mind taking a look at this issue as its been labeled with an integration ( |
If its a ratelimit issue, I sent in a PR to detect these |
I just pushed out version 0.4.2 of smart_meter_texas with the new exception @bdraco. I have noticed this log message a few times that I don't think I ever saw when I was running this in development. A JSON API shouldn't return
|
I don't think it's a rate limit. I upgraded to 0.115 today for the first time and am getting the same problem when first adding the integration in HA. Token request via curl works:
BTW, thanks for the integration @grahamwetzler - I've been hoping someone would create one for the past six or so months! |
It stopped working for me as well, even after the changes. It seems like something else is going on here. |
Fixed in grahamwetzler/smart-meter-texas#39 |
Well it was working with the changes and now it's stopped. If I use requests instead of aiohttp, it's working. Will do some more investigation later in the week, unfortunately I'm out of time tonight and have a busy mon/tue/wed so it will likely be a while until I get back to this |
At the risk of putting my ignorance on display, could it be related to the certificate chain? EDIT: oh, probably not - I see where you say on the PR where it worked 50 times. |
I seem to have the same issue. It initially worked and does every now and then, but mostly it gives invalid sensor. Thanks for building this component. Looking forward to it once the bugs are worked out. |
I'm fairly confident the issue is the user agent we're sending. I'm trying to come up with a good way to rotate the user agent but it's not clear to me the best way to handle it. |
I had some (possibly) related issues with the user agent on a different project I worked on with the SmartMeterTexas API. The only way I could get it working consistently in the end was to use a browser user agent. Please take a look at cmulk/python_smartmetertx and see if that helps you any. |
This on has me stumped as I can see the response coming back down over the wire with strace, but aiohttp never processes it and hangs forever |
It looks like the traffic is explicitly being blocked https://community.akamai.com/customers/s/article/Why-is-Akamai-blocking-me?language=en_US |
Well, I originally wrote here that this wasn't working, but I happened to try again immediately after a reboot, and it added... so either I just got lucky, or maybe it's working? |
@mrand It still does not work for me so I assume you were lucky. |
It actually isn't reliable. Sometimes I'm able to get readings, but most of the time there are problems. So, here's what I had originally written in my previous comment: As much as it pains me to suggest it, I'm wondering if a PR should be made to the documentation page so that people don't waste their time? If so, I suppose the documentation should be hidden/removed altogether ("not currently working" warning banner seems strange to me). |
I'm fine with that. I wasn't able to figure out why the requests are being detected and blocked. This feels like it should be fixable but it's a bit beyond me. I'll approve any PR on the library if someone wants to try. |
Just tried adding this integration and got the Failed to Connect error message. I assume nothing has changed from the thread above? |
Correct, although @grahamwetzler, is there any way to redo the accesses inside the integration to simulate/emulate cURL? Unless you're afraid it will trigger some threshold stuff on their side, my examples at https://github.com/mrand/smart_meter_texas/tree/master/unofficial_api have been working for me. |
It should be possible but I couldn't get it to work when I tried. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Still not working as of HA Core 2021.5.4 |
Still not working as of core-2021.7.2. Unable to log in |
Just tried now and it's not working in core-2021.8.0. Could this be related to the addition of a Security question which has to be answered when logging in from a new browser/user agent? |
Unfortunately the library needs some work in order to get it working again. If anyone is able to fix it I will approve the PR. |
I tried a node-red implementation that is working. I noticed the base URL doesn't include the www subdomain, while this one does. I tried adding the www to node-red and it breaks (no response). Could that be the issue? |
@elmigbot I just tested it locally and removed the I was looking at my developer traces in the browser, and those calls had the www in the API calls without any issues... Weird, but it works! |
Good news! Just a PR now? |
I have submitted a PR for the library. 🤞 |
Potential fix for home-assistant#40348
Just tried adding this integration (after putting it off for months, the new energy features piqued my interest) and ran into the issue where it can’t connect 😢. Excited to find that a PR with a resolution is already in the works - please let me know if I can do anything to help! |
@excalbian It was the same energy updates that reignited my interest in this as well. 😅 It currently looks like I may need to refactor some things to handle the SSL problems in a way that will work best with HA's storage. This would involve patching both the library to take in a SSL context variable and updating the HA plugin to create and manage the SSL context. You can refer to this for more details: #54493 (comment) My current patches are a rough short-term solution at best, and it would be better to patch it so that it's more robust with these SSL validation issues. I'm not sure how soon I'll have time to sit down and get some work done on it, as I'm patching in my free time. It might be later this week or the weekend if my schedule works out. If you know python and want to help, please feel free to jump in and contribute as well! 😎 |
I tried to add it for the first time thought the integrations UI and I'm still getting "Failed to connect." Is there something I should be doing manually? Edit: logger: |
I was able to add our account with no issue but the entity is not showing up in any of the energy dropdown selectors |
This fix is in beta, slated to be released in 2021.9 |
@meyerrj Thanks for putting this through. Good news is that with release of 2021.9, I can now log in and get data. As @jes1417 noted, it doesn't show up as an option to select in the Energy dashboard config. However, I suspect that the solution may be to add the same thing I have in the Node-Red SMT solution I've used for the past year the utility meter integration: utility_meter: smt_energy_hourly: In the meantime, I had seen something odd in that all the sudden the energy dashboard was showing a huge spike every day at midnight. I had left that running and set up in Energy. In looking at a four day graph of the reading from this integration, what I noticed is that I get readings every hour for about half the day and then it flatlines and then spikes at midnight. It dawned on me that what must be happening is that since I have this and the Node-Red solution running, I'm hitting SMT API too often and getting blocked until the next day, at which point the reading "catches up". I've disabled this integration until this evening when I can test adding utility_meter. If that works, I'll shut down the Node-Red flow for SMT. Just thought I would share this for anyone else who had been using other solutions while waiting for this one to work again. If the utility_meter approach makes this integration's sensor visible for energy dashboard, I'll report that, too. |
I ended up getting it to work in the energy dashboard, the utility_meter integration was not needed as that resets monthly and the energy integration wants a total value for statistics, all I had to do was add a customize to the smart Texas integration.
That got it to work in the dashboard but I am also seeing the large spike at midnight and was trying to figure out why. What you said makes sense it must be catching up after being limited. |
Thanks for all the hard work. It's working for me now! I also tried to add to the Energy tab and it doesn't show up. I'll try modifying the device as shown above. HA does have a link asking to notify the developer if it doesn't show in the list. https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics. |
To enhance Smart Meter Texas to show in the Energy tab grid consumption dropdown, I have an open PR #55665 – it's in-progress on being reviewed and tested for a future HA release. |
The total is an increasing value, so unless you add additional energy tracking sensors to break down the totals hourly it will simply show you the current meter reading. https://www.home-assistant.io/integrations/utility_meter/#configuration It's also important to remember that the data comes from a third party that collects the data from the meters, and there could easily be delays with the service provider. There are times where I've noticed a few hours where the meter reading value didn't change and then it suddenly jumps up hours later. Unfortunately there's really not a lot that can really be done about this right now. |
The problem
I am attempting to setup the Smart Meter Texas integration, but upon trying to login I get "Failed To Connect"
Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information
The text was updated successfully, but these errors were encountered: