core: Smart Meter Texas Integration Failed to Connect

The problem

I am attempting to setup the Smart Meter Texas integration, but upon trying to login I get “Failed To Connect”

Environment

  • Home Assistant Core release with the issue: 0.115.2
  • Last working Home Assistant Core release (if known):
  • Operating environment (OS/Container/Supervised/Core): Supervised
  • Integration causing this issue: Smart Meter Texas
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/smart_meter_texas/

Problem-relevant configuration.yaml


Traceback/Error logs


Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 45 (22 by maintainers)

Commits related to this issue

Most upvoted comments

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.

https://github.com/grahamwetzler/smart-meter-texas

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.

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: I should add that I changed my logs setting look like below and I am not seeing anything when I get the error.

logger: default: info logs: custom_components.hacs: debug hacs: debug queueman: debug AIOGitHubAPI: debug

I have submitted a PR for the library. 🤞

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?

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.

@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: source: sensor.smt_current_reading cycle: 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.

sensor.electric_meter_xxxxxx
  state_class: total_increasing

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.

Screenshot_20210908-083503.png

I was able to add our account with no issue but the entity is not showing up in any of the energy dropdown selectors

@elmigbot I just tested it locally and removed the www. from the BASE_URL constant… and sure enough, it worked. 😮

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!

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?