core: Vodafone Station Integration fails with station 6 from Germany and Portugal

The problem

I tried to setup this new integration with my Vodafone Station 6 but it fails with an unexpected error.

It seems that the login screen does not habe a csrf token field.

What version of Home Assistant Core has the issue?

core-2023.9.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Vodafone Station

Link to integration documentation on our website

https://www.home-assistant.io/integrations/vodafone_station

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

`Logger: homeassistant.components.vodafone_station
Source: components/vodafone_station/config_flow.py:41
Integration: Vodafone Station (documentation, issues)
First occurred: 22:48:19 (2 occurrences)
Last logged: 22:49:42

Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/vodafone_station/config_flow.py", line 70, in async_step_user
    info = await validate_input(self.hass, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/vodafone_station/config_flow.py", line 41, in validate_input
    await api.login()
  File "/usr/local/lib/python3.11/site-packages/aiovodafone/api.py", line 291, in login
    await self._get_csrf_token(html_page)
  File "/usr/local/lib/python3.11/site-packages/aiovodafone/api.py", line 95, in _get_csrf_token
    token = re.findall("(?<=csrf_token)|[^']+", script_tag.string)[1]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
`

Additional information

No response

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 4
  • Comments: 35 (11 by maintainers)

Most upvoted comments

I currently got the same issue, here’s the log. The password is correct. Vodafone station model: RHG3006 v1 - FW version: XF6_4.0.03.08

Please see #99814, issue is fixed in 2023.9.1

Simone

@chemelli74 I got you, thanks for pointing out that code indeed comes from @guerda.

@guerda I joined the discord server of home-assistant, when you have time please contact me, I have some questions how far you got with further integration of Technicolor API, my nickname vladislabv 😃

Any progress on the friend request or on this issue? 😃

just follow also the library repo on top of this repo to get fresh info.

Note that I just merged @guerda work for Technicolor Stations and released a new library version.

Sure, @chemelli74 , I sent you a friend request.

Vodafone Station Firmware: 19.3B70-1.2.49 Product name: CGA6444VF

I dabbled with a presence detection too and this was the code I got to work with my station: https://github.com/guerda/vodafone-station-device-tracker-home-assistant_old/blob/main/custom_components/vodafone_station/device_extractor.py

Maybe that helps as reference

@guerda , do you mind joining HomeAssistant on Discord and then contact me: chemelli74#2180 ? I would like to integrate the support for your station starting from your code.

Simone

I get the same error on my UK Power Station. Thing is for the Power Station there are (at least) 2 HW Vendors each of with uses completely different software to power the router, The THG3000 (Which I have in the UK) is manufactured by Technicolor and runs a heavily customised/locked down version of OpenWRT (Current Version: 19.4.0551), there is also the SHG3000 which is manufactured by Sercomm and runs their own proprietary system.

For an example of one differnce between the two aiovodafone tries to get the csrf token from login.html, however on the THG3000 the page is login.lp and the token is stored in a meta tag named CSRFtoken.

Thank you for your fast response!

I think yours is different from the “Italian” Vodafone Wi-Fi 6 Station.

I fear it is as the API looks totally different.

I would’ve been too nice to just use yours. Maybe there’s a way to support the other versions too. I shied away from the effort to setup a whole integration, tbh.

What I can try is to catch that error so that those “German” Stations get a more explicit error message. Would that be of your interest?