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

Errer With Flipr integration #105778

Closed
Percherie opened this issue Dec 15, 2023 · 13 comments · Fixed by #108130
Closed

Errer With Flipr integration #105778

Percherie opened this issue Dec 15, 2023 · 13 comments · Fixed by #108130

Comments

@Percherie
Copy link

The problem

Hi,

Since last update of HA, Flipr don't work
I have this in my log

Connexion on flipr application it's OK and I don't modify my account.
Information: support flipr have ticket for battery KO. Maybe api is limited during investigation

What version of Home Assistant Core has the issue?

core-2023.12.3

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

Flipr

Link to integration documentation on our website

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

Diagnostics information

Logger: homeassistant.components.flipr.coordinator
Source: helpers/update_coordinator.py:300
Integration: Flipr (documentation, issues)
First occurred: 04:45:24 (6 occurrences)
Last logged: 04:48:06

Unexpected error fetching Flipr data measure for C16BE5 data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/flipr/coordinator.py", line 39, in _async_update_data
data = await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flipr_api/client.py", line 115, in get_pool_measure_latest
"temperature": float(json_resp["Current"]["Temperature"]),
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

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

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

Code owner commands

Code owners of flipr 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 flipr 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)


flipr documentation
flipr source
(message by IssueLinks)

@cnico
Copy link
Contributor

cnico commented Dec 17, 2023

Hi @Percherie,
I updated home assistant to 2023.12.3 and the flipr integration works for me without the error you have.
I added a documentation page to help diagnose if it is a flipr API server side problem : https://github.com/cnico/flipr-api/blob/main/testing_api.rst
With this and postman, you can test directly if it is a problem from goflipr server side or from home assistant and flipr integration side.

@Percherie
Copy link
Author

I've just tested with postman and managed to load the data from the API

I took the opportunity to enable logging. I have other errors in the file but I don't know where to locate the cause of the error.

home-assistant_flipr_2024-01-09T15-32-28.623Z.log

@cnico
Copy link
Contributor

cnico commented Jan 9, 2024

Hi @Percherie,
The logs seems to indicate that you have an incomplete json response which is quite surprising for me.
To analyze it further, could you please attach the result of your postman test for the NewResume REST request ?

Another way to diagnose it would be that you send me your flipr account (login+ password) in a private message so that I can reproduce the problem. And then, you change your flipr password of course.

@ArBohe
Copy link

ArBohe commented Jan 10, 2024

Any news on these? Same issue as @Percherie !
image
That said... my flipr is in winter mode, hence not bringing new data since 2 months. Can it be that the integration EXPECTS very recent data and just fails cause the queries returns nothing? :)

@Percherie
Copy link
Author

It's no problem for me to give you my password, but once I've changed it, do I have to reconfigure the integration?

Where can I provide you with the identifiers?

@cnico
Copy link
Contributor

cnico commented Jan 10, 2024

It's no problem for me to give you my password, but once I've changed it, do I have to reconfigure the integration?

Where can I provide you with the identifiers?

You would have two options :
1- yes remove the flipr device and reconfigure it. It is not a problem for the dashboard you could have since created entities will have the same name
2- edit directly the password in the config folder of homeassistant by connecting to it via ssh.

For the identifiers, you can just send them by mail to me at : nicolas@cazottes.net

@Percherie
Copy link
Author

Great... before giving you the password, I'll test the modification in ssh

After modification, I'll send you the temporary password.

Which file do I need to modify?

@cnico
Copy link
Contributor

cnico commented Jan 10, 2024

Any news on these? Same issue as @Percherie ! image That said... my flipr is in winter mode, hence not bringing new data since 2 months. Can it be that the integration EXPECTS very recent data and just fails cause the queries returns nothing? :)

Sorry about that. I need more data to understand and reproduce the problem.
Actually, when my flipr does not send data to the cloud, like for what you call the winter mode, I do not have such errors in the logs. I have simply the entity marked as not available in homeassistant in the same way as when you disconnect a shelly or sonoff device from the network.

@cnico
Copy link
Contributor

cnico commented Jan 10, 2024

Great... before giving you the password, I'll test the modification in ssh

After modification, I'll send you the temporary password.

Which file do I need to modify?

In config/.storage/core.config_entries : it is a big json file and if you search flipr, you will find your password to change under the key data / password .
You have to restart homeassistant core after this file is changed and I do not advice to change anything else directly in this file as it is normaly only managed by homeassistant.

@ArBohe
Copy link

ArBohe commented Jan 10, 2024

So, for me, the error occurs just when installing the add-on: I register on flipr website, all is well and then it just stops with the message as in the picture above. Here is the log extract

2024-01-09 23:04:29.514 ERROR (MainThread) [homeassistant.components.flipr.coordinator] Unexpected error fetching Flipr data measure for 1A1605 data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/flipr/coordinator.py", line 39, in _async_update_data
    data = await self.hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flipr_api/client.py", line 115, in get_pool_measure_latest
    "temperature": float(json_resp["Current"]["Temperature"]),
                         ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

the exact same error as @Percherie

@Percherie
Copy link
Author

Changing the password works perfectly with ssh, I'll do what's necessary to send you the info by email.

FYI, as long as the password is not updated in config/.storage/core.config_entries I don't get any errors in the logs.
This tends to indicate that there's a problem with the data received by HA

@cnico
Copy link
Contributor

cnico commented Jan 15, 2024

This issue is now corrected : see the linked pull request.
@Percherie , thanks for the details information on how to reproduce the problem.
@ArBohe , this correction will correct also your situation of a Flipr in winter mode that do not send any new data.

I hope, it will merged to the dev branch of homeassistant soon by a core reviewer so that this correction becomes available to every body in next version of homeassistant.

joostlek pushed a commit that referenced this issue Jan 16, 2024
Flipr-api version update for resolution of issue #105778
Bre77 pushed a commit to Bre77/core that referenced this issue Jan 19, 2024
Flipr-api version update for resolution of issue home-assistant#105778
frenck pushed a commit that referenced this issue Jan 19, 2024
Flipr-api version update for resolution of issue #105778
catsmanac pushed a commit to catsmanac/ha-core-dev that referenced this issue Jan 23, 2024
Flipr-api version update for resolution of issue home-assistant#105778
chemelli74 pushed a commit to chemelli74/core that referenced this issue Jan 29, 2024
Flipr-api version update for resolution of issue home-assistant#105778
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants