Skip to content
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

FlickElectric integration about to stop working #132211

Closed
gdpelican opened this issue Dec 3, 2024 · 17 comments · Fixed by #133475
Closed

FlickElectric integration about to stop working #132211

gdpelican opened this issue Dec 3, 2024 · 17 comments · Fixed by #133475

Comments

@gdpelican
Copy link

The problem

Hello, James from FlickElectric (https://www.flickelectric.co.nz/) here. We've noticed there is quite a bit of traffic on some of our old deprecated APIs with a useragent of HomeAssistant/2024.10.4 aiohttp/3.10.8 Python/3.12, which I presume is coming from this project. We've had deprecation notices on them for some time, and they're now going to be deleted imminently.

Please reach out to james.kiesel@flickelectric.co.nz if you're still actively using this integration, and we can discuss migrating to our more modern versioned APIs

Thanks!

What version of Home Assistant Core has the issue?

N/A

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

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Dec 3, 2024

Hey there @ZephireNZ, mind taking a look at this issue as it has been labeled with an integration (flick_electric) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of flick_electric can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign flick_electric Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


flick_electric documentation
flick_electric source
(message by IssueLinks)

@joostlek
Copy link
Member

joostlek commented Dec 3, 2024

@ZephireNZ If you are sending a mail, please feel free to add me in the CC with joost.lekkerkerker@nabucasa.com

@ZephireNZ
Copy link
Contributor

Have emailed and CC'd in Joost 😊

@BambamNZ
Copy link

BambamNZ commented Jan 4, 2025

Hi

Stumbled across this issues, while looking into why the Flick Integration showed " Setup Failed" after a HA reboot earlier today.
Based on the emails and comments, it seems that Flick was going to turn off some older API's but the time line was before the end of the year. Has that happened maybe as the integration is currently sort of broken?

Why I say sort of broken, removing and re-adding the integration, it show my address for my account but shows a failed to setup

Logger: homeassistant.components.flick_electric.coordinator
Source: helpers/update_coordinator.py:379
integration: Flick Electric (documentation, issues)
First occurred: 1:25:07 PM (36 occurrences)
Last logged: 1:52:02 PM

Unexpected error fetching Flick Electric data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/flick_electric/coordinator.py", line 43, in _async_update_data
    return await self._api.getPricing(self.supply_node_ref)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyflick/__init__.py", line 43, in getPricing
    period: RatingRatedPeriod = await self.__getJsonDoc("GET", "rating/v1/rated_periods", params={
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
    })
    ^^
  File "/usr/local/lib/python3.13/site-packages/pyflick/__init__.py", line 15, in __getJsonDoc
    response = await self._auth.request(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyflick/authentication.py", line 41, in request
    access_token = await self.async_get_access_token()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/flick_electric/__init__.py", line 149, in async_get_access_token
    token = await self._get_entry_token()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/flick_electric/__init__.py", line 111, in _get_entry_token
    await self._update_token()
  File "/usr/src/homeassistant/homeassistant/components/flick_electric/__init__.py", line 122, in _update_token
    token = await self.get_new_token(
                  ^^^^^^^^^^^^^^^^^^
AttributeError: 'HassFlickAuth' object has no attribute 'get_new_token'. Did you mean: '_get_entry_token'?

@ZephireNZ
Copy link
Contributor

@BambamNZ Hmmm looks like this is something broken with the changes introduced in #133973

@BambamNZ
Copy link

BambamNZ commented Jan 4, 2025

@BambamNZ Hmmm looks like this is something broken with the changes introduced in #133973

Don't quite follow the referenced issue is for Tapo devices.
I do have Tapo devices coincidentally, although not the model mentioned in the reference, can't see how that would be related.

@ZephireNZ
Copy link
Contributor

Whoops - I meant #133475, typo 😅

@BambamNZ
Copy link

BambamNZ commented Jan 4, 2025

Indeed related to the update
I didn't notice it has updated, I recreated my Docker container due to other issues is was looking into.
Went checking now and I'm running version 2025.1
Rolled back to version 2024.12, disabled flick integration and re-added the auth details (as it showed "migration failed" error) and it is back working as expected.

@ZephireNZ
Copy link
Contributor

Cheers for confirming that.

I have got a fix up for this now, hopefully can get added in the first fix release for 2025.1. Sorry for the hassle!

#134611

@BambamNZ
Copy link

BambamNZ commented Jan 4, 2025

Cheers for confirming that.

I have got a fix up for this now, hopefully can get added in the first fix release for 2025.1. Sorry for the hassle!

#134611

No worries, thank you for helping with the maintenance of the integration.

@2fst4u
Copy link

2fst4u commented Jan 7, 2025

Hi I'm seeing the same issue but I'm on 2025.1. Should this be working and I'm doing something wrong or is it yet to be resolved?

@BambamNZ
Copy link

BambamNZ commented Jan 7, 2025

Hi I'm seeing the same issue but I'm on 2025.1. Should this be working and I'm doing something wrong or is it yet to be resolved?

You will need to downgrade to version 2014.12.5 or wait for 2025.1.1 which is on it's way any day now.

@2fst4u
Copy link

2fst4u commented Jan 7, 2025

Gotcha, I'm happy to wait I'll see how it goes in .1.

@Painkillernz
Copy link

Thank you for the work you have done and keeping this integration updated. I actually changed to flick because of the integration.

@BambamNZ
Copy link

BambamNZ commented Jan 8, 2025

Version 2025.1.1 was released overnight, unfortunately seems there is a different problem now.

The integration fails to setup

image

limited log entries, this single line in when downloading debug logs:

2025-01-08 14:23:42.061 DEBUG (MainThread) [homeassistant.components.flick_electric.coordinator] Finished fetching Flick Electric data in 0.112 seconds (success: False)
Deleted and re-added the account, with same results.

Edit: Additional observations....

In version 2024.12.5 it show my email address in the integration, while in version 2025.1 and beyond the integraiton shows my address as above.
Also additional testing, created a new HA container with only the Flick Integration and it fails in the same way as an upgrade to version 2025.1.1.
No log entries, only the single line in the debug logs.

@Painkillernz
Copy link

Same problem here

@ZephireNZ
Copy link
Contributor

Hmmm OK based on the logs, it looks like it is failing to fetch the pricing for the account but the logging isn't specific as to why.

I will look into this to try understand what is happening - the tricky part is that I do not have a flick account anymore, but I have got a contact in Flick so they should be able to help with that.

I have created issue #135128 to avoid bumping this issue which has already been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants