Efergy Errors

Hi All,

Running hass.io 0.116.4,

I have the efergy component and using it for a long long time with not many problems.

Now since upgrading to 0.116, i notice my log is filled with thousands of lines of efergy errors:

homeassistant.log

2020-10-20 15:23:35 WARNING (SyncWorker_42) [homeassistant.components.efergy.sensor] Could not update status for Energy Usage
2020-10-20 15:23:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.efergy_731383 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 154, in update
    if self.sid == sensor["sid"]:
TypeError: string indices must be integers
2020-10-20 15:23:43 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.efergy_784577 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 154, in update
    if self.sid == sensor["sid"]:
TypeError: string indices must be integers
2020-10-20 15:23:44 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.per_device_usage fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 154, in update
    if self.sid == sensor["sid"]:
TypeError: string indices must be integers

Eventually it becomes too much for Hass.io and it crashes and reboots itself, sometimes this can take 2 days or a few hours.

Has anyone else got the efergy component installed and has same issue or is it just me ?

i think it could be because of the python 3.8 update, but not sure.

Hey

I am getting similar errors.
I am running HA in docker image (0.116.4) on the alpine machine with python 3.7.7 … Experiencing similar problems as mentioned above. This is from my log:

2020-10-21 07:31:06 WARNING (SyncWorker_12) [homeassistant.components.efergy.sensor] Could not update status for Energy Usage
2020-10-21 07:31:09 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.efergy_832365 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 154, in update
    if self.sid == sensor["sid"]:
TypeError: string indices must be integers
2020-10-21 07:31:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.efergy_818500 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 154, in update
    if self.sid == sensor["sid"]:
TypeError: string indices must be integers
2020-10-21 07:31:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.per_device_usage fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 154, in update
    if self.sid == sensor["sid"]:
TypeError: string indices must be integers

Open for ideas?

Same here.

Home Assistant 0.116.4 (Hassio)

Logger: homeassistant.components.sensor
Source: components/efergy/sensor.py:69
Integration: Sensor (documentation, issues)
First occurred: October 20, 2020, 7:21:25 PM (1 occurrences)
Last logged: October 20, 2020, 7:21:25 PM

Error while setting up efergy platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/efergy/sensor.py", line 69, in setup_platform
    sid = sensor["sid"]
TypeError: string indices must be integers

There’s an open issue on GitHub but not much in the way of a fix :disappointed_relieved:

I have the same problem. “Error while setting up efergy platform for sensor” has a solution been found to fix the error?

there apparently is an error in the sensor.py file:

this is the error message:

Logger: homeassistant.helpers.entity
Source: components/efergy/sensor.py:157
First occurred: 16:32:18 (10 occurrences)
Last logged: 16:34:18

Update for sensor.efergy_733914 fails
Update for sensor.per_device_usage fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 350, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 558, in async_device_update
raise exc
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/components/efergy/sensor.py”, line 157, in update
if self.sid == sensor[“sid”]:
TypeError: string indices must be integers