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

Error but everything seems ok in config #52

Open
pbox opened this issue Sep 27, 2024 · 5 comments
Open

Error but everything seems ok in config #52

pbox opened this issue Sep 27, 2024 · 5 comments

Comments

@pbox
Copy link

pbox commented Sep 27, 2024

Hello,

I'm getting this error :

This error originated from a custom integration.

Logger: pygazpar.datasource
Source: custom_components/gazpar/sensor.py:138
integration: GrDF Gazpar (documentation, issues)
First occurred: 11:10:11 (1 occurrences)
Last logged: 11:10:11

An error occurred while loading data. Retry in 3 seconds.

followed by this one :

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/gazpar/util.py:44
integration: GrDF Gazpar (documentation, issues)
First occurred: 11:10:16 (1 occurrences)
Last logged: 11:10:16

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/gazpar/sensor.py", line 218, in state
    return Util.toState(self._dataByFrequency)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gazpar/util.py", line 44, in toState
    volumeEndIndex = float(dailyData[currentIndex][PropertyName.END_INDEX.value])
                           ~~~~~~~~~^^^^^^^^^^^^^^
IndexError: list index out of range

Setup seems ok :

sensor:
  - platform: 'gazpar'
    name: 'indexgaz'
    username: '[email protected]'
    password: 'xxxxx'
    pce_identifier: '0xxxxxxxxx9'
    tmpdir: '/tmp'
    scan_interval: '08:00:00'

Please advise. Thanks in advance !

@ssenart
Copy link
Owner

ssenart commented Sep 27, 2024

Hello, is it possible there is no data ? Could you check that on GrDF site by downloading the corresponding Excel file ?

@pbox
Copy link
Author

pbox commented Sep 28, 2024

Hello,

Excel file is populated up until sept 25.

Screenshot_2024-09-28-14-38-21-622_com google android apps docs editors sheets

Yet it does not work.

I've had a password with special characters in it, changed it to a simpler one,but it does not help either.

Thanks for the help!

@ssenart
Copy link
Owner

ssenart commented Sep 28, 2024

Ok, I understand now viewing your data and the message you have.

There is a bug in the code happening when there is no consumption on the last period.

I will fix it in the next days

@ssenart
Copy link
Owner

ssenart commented Sep 28, 2024

I have just pushed a fix in version 1.3.6.

Could you try it and tell me ?

@pbox
Copy link
Author

pbox commented Sep 28, 2024

Yepa, it works again! Thanks!

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

No branches or pull requests

2 participants