mbillow/ha-redpocket

Entity data "unavailable"

Closed this issue · 4 comments

Describe the bug
The data for RedPocket entities is "Unavailable". I just started using the integration a week or so ago and it was working fine for several days. Yesterday the data showed "unavailable" and it has not recovered. I am able to successfully log into the redpocket.com site with the same credentials.

This is logged:

2022-01-13 10:58:34 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up redpocket platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/redpocket/sensor.py", line 39, in async_setup_entry
    rp = await hass.async_add_executor_job(RedPocket, username, password)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/redpocket/api.py", line 187, in __init__
    self._login()
  File "/usr/local/lib/python3.9/site-packages/redpocket/api.py", line 222, in _login
    raise RedPocketAuthError("Failed to authenticate to RedPocket!")
redpocket.exceptions.RedPocketAuthError: Failed to authenticate to RedPocket!

To Reproduce
Steps to reproduce the behavior:

  1. View RedPocket integration entities on lovelace dashboard.

Expected behavior
Entity data to always be showing.

Screenshots

image

Configuring integration yeilds:
image

Desktop (please complete the following information):

  • OS: linux
  • Browser: chrome
  • Version 97.0.4692.71 (Official Build) (64-bit)

Smartphone (please complete the following information):

  • n/a

Additional context
I logged into my account to view the data and I had to do a CAPTCHA. Not sure if this is related to the unavailable data through the HA integration.

Experiencing the same issue. Was working previously, now unavailable and when trying to configure getting invalid credentials. Have confirmed that credentials are correct.

It seems some part of their login flow has changed in the past few weeks. I’ll take a look at some point this weekend if no one beats me to debugging it.

Yah... it looks like we are out of luck. They not only added reCaptcha to login, but they also put their site behind an AWS WAF that also does captcha-esque verification at random if it thinks you aren't human. It also looks like the longest session cookie they will give you is valid for a month, so we can't get around logging in by having a user hand us their cookie either.

Thanks for providing this and debugging the issue. Maybe there will be an alternative in the future.