bgbraga / homeassistant-apsystems

An APsystems Sensor for Home Assistant
Apache License 2.0
21 stars 13 forks source link

No Update of counts #3

Closed synack666 closed 2 years ago

synack666 commented 3 years ago

After installation i get one measured value for each sensor, but no more, no update. Have tried 3 times, same for each try.

krizzziz commented 3 years ago

Same here, only on restarting HA the sensors receive update.

86hakan commented 3 years ago

Same here. Only new values when i restart

Codingroller commented 3 years ago

First of all, thanks for taking the time to write this integration.

I have the same problem

image

Error in log:

Logger: homeassistant.helpers.entity
Source: custom_components/apsystems/sensor.py:156
Integration: apsystems (documentation)
First occurred: 6 August 2021, 6:08:42 (183 occurrences)
Last logged: 11:13:42

Update for sensor.apsystems_energy_latest fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in async_device_update
    raise exc
  File "/config/custom_components/apsystems/sensor.py", line 156, in async_update
    value = value[-1]
IndexError: list index out of range
Codingroller commented 3 years ago

I'm not familiar with Python or Home assistant development. I'm interested however what the following line of code does (starts at line 153 in sensor.py).

index = self._metadata[0]
        value = ap_data[index]

 if isinstance(value, list):
            value = value[-1]

What does value[-1] do here? Go one back in the list?

Christophe69480 commented 3 years ago

Same here, only on restarting HA the sensors receive update.

synack666 commented 2 years ago

Seems like it's dead, very very sad!

krizzziz commented 2 years ago

So actually for a while this integration is working. Only thing is that I have two updates on 1 day concerning information from solar panels to home assistant. Around 13.10 and 18.10 every day. Anyone knows where I can change some code to spread it out a little bit more over the day or to add maybe some more updates. Or is this limited?

wtrdk commented 2 years ago

Same problem here, I'm trying to figure out why it doesn't update frequently, but no result yet...

synack666 commented 2 years ago

fixed in fork https://github.com/skelgaard/homeassistant-apsystems