Closed Tuxrug closed 3 years ago
I just found the following more verbose information in the docker container's logs that wasn't in the Home Assistant logs page:
2021-09-08 00:00:01 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/openei/init.py", line 98, in _async_refresh_data self._data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, self.kwargs) File "/config/custom_components/openei/init.py", line 116, in get_sensors _sensor[sensor] = getattr(rate, sensor) File "/usr/local/lib/python3.9/site-packages/openeihttp/init.py", line 166, in distributed_generation return self._data["dgrules"] KeyError: 'dgrules' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/openei/init.py", line 102, in _async_refresh_data raise UpdateFailed() from exception homeassistant.helpers.update_coordinator.UpdateFailed 2021-09-08 00:00:02 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/openei/init.py", line 98, in _async_refresh_data self._data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, *self.kwargs) File "/config/custom_components/openei/init.py", line 116, in get_sensors _sensor[sensor] = getattr(rate, sensor) File "/usr/local/lib/python3.9/site-packages/openeihttp/init.py", line 166, in distributed_generation return self._data["dgrules"] KeyError: 'dgrules' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/openei/init.py", line 102, in _async_refresh_data raise UpdateFailed() from exception homeassistant.helpers.update_coordinator.UpdateFailed 2021-09-08 00:00:02 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/openei/init.py", line 98, in _async_refresh_data self._data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, self.kwargs) File "/config/custom_components/openei/init.py", line 116, in get_sensors _sensor[sensor] = getattr(rate, sensor) File "/usr/local/lib/python3.9/site-packages/openeihttp/init.py", line 166, in distributed_generation return self._data["dgrules"] KeyError: 'dgrules' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/openei/init.py", line 102, in _async_refresh_data raise UpdateFailed() from exception homeassistant.helpers.update_coordinator.UpdateFailed 2021-09-08 00:01:09 ERROR (MainThread) [custom_components.openei] Error fetching openei data: 2021-09-08 00:02:29 ERROR (MainThread) [custom_components.openei] Error fetching openei data:
This seems to match the error I posted on the most recent comment in #7.
Give 0.0.9 a go.
When adding the integration in the UI, I was getting the "Retrying setup: None" error after selecting the Rate Plan (step 3). With 0.0.9, the integration is added successfully - no errors. Thanks!
I am now able to select a rate plan and complete setup.
I am also now able to complete setup and all but the distributed generation sensor entities have values. Now I have to figure out why the rate is totally wrong (the rate changes once I personally cross a threshold of used energy in a month so this might be a lost cause). Thanks for fixing this.
@coleya if you go to https://openei.org/wiki/Utility_Rate_Database and pull up the plan page, could you link it, I'll see what data it provides.
Okay I think this is it. I was able to find it in the list at the very end of the selection menu and at the very top of the database link you sent me when I put in PG&E which makes me think it's the newest entry but doesn't explain why it's completely by itself or why there are multiple identically named rates called E-1 -Residential Service Baseline Region T. The ID I sent you initially was almost definitely wrong as it doesn't specify residential but when I select the rate at the very bottom of the selection menu (ID: 60e4c63a5457a3a91679e0f2) and click submit nothing changes and when I go back to set it up again the old ID that I sent you is back in the box.
Ok I'll double check that. Looks like you're on a tiered energy plan, I'll have to see if I can dump that data for testing.
Okay I reinstalled from HACS and resetup the integration and it now gives the (I think correct) tier one rate as the current rate and the all rates sensor just has that rate listed twice like [.25,.25] but with more digits of precision instead of having all three tiers. It would be nice to be able to switch the current rate sensor to each of the three tiers since I already have a sensor that measures the total energy consumed in the current month.
I'm working on a library update to work with a tiered plan right now.
The "Retrying setup: None" error is back after reinstalling from HACS because of the #26 update I've turned debug mode back on and I will post again at the top of the hour with the special traceback message.
Did you already try reconfiguring the integration as well?
I tried reconfiguring it after the update and adding the monthly energy usage sensor but after the rate didn't change at all I decided to delete the integration and reinstall from the HACS UI and when I set it up again I got this error.
Strange, let me know what error shows up in the log then. Thanks!
Here is the error:
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/openei/__init__.py:112
Integration: OpenEI Utility Rates (documentation, issues)
First occurred: 1:00:00 PM (24 occurrences)
Last logged: 1:00:01 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/openei/__init__.py", line 108, in _async_refresh_data
self._data = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/openei/__init__.py", line 128, in get_sensors
_sensor[sensor] = getattr(rate, sensor)
File "/usr/local/lib/python3.9/site-packages/openeihttp/__init__.py", line 116, in current_rate
value = float(self._reading)
ValueError: could not convert string to float: 'sensor.power_myaddress_123_1mon'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/openei/__init__.py", line 112, in _async_refresh_data
raise UpdateFailed() from exception
homeassistant.helpers.update_coordinator.UpdateFailed
can you tell me the state
of that sensor? Is it numeric?
the state is 111.333
and the attributes of the sensor are:
state_class: total_increasing
last_reset: '2021-09-08T19:31:56+00:00'
unit_of_measurement: kWh
friendly_name: myaddress 1,2,3 1MON
device_class: energy
Ah I see my error, lemmie drop a beta for you to test with.
0.1.2-b2 should have this sorted.
The error still seems to occur even after reinstalling I'll tell you at 2pm PDT if the traceback is any different.
If you add this to your configuration.yaml you can see the errors on startup:
logger:
default: error
logs:
custom_components.openei: debug
I have that except for the default: error part in my config already. For whatever reason this error is only logged when that is in the config and it is at the top of the hour.
Weird, ok.
Here is the newest error:
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/openei/__init__.py:112
Integration: OpenEI Utility Rates (documentation, issues)
First occurred: 2:00:00 PM (35 occurrences)
Last logged: 2:00:00 PM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/openei/__init__.py", line 108, in _async_refresh_data
self._data = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/openei/__init__.py", line 125, in get_sensors
readings = meter.state
AttributeError: 'str' object has no attribute 'state'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/openei/__init__.py", line 112, in _async_refresh_data
raise UpdateFailed() from exception
homeassistant.helpers.update_coordinator.UpdateFailed
Ok think I have it properly fixed now in beta 4
I updated and now the rate is at the highest tier even though I'm just realizing I think it ought to be on tier 1 right now with the value of the 1 month energy sensor (6.8 kWh /day * 30 = 204) I'm at 113 kWh so I'm below the baseline right now so in 92 kWh it should switch to tier 2 then once it reaches 400% of that baseline value it should go to tier 3.
I created a new issue for that. Since the setup issue is fixed now.
Hello I am getting this error now but only on my Rate 22 rates from my provider. I have removed and added it back but it gets stuck on the Retrying Setup: None https://apps.openei.org/USURDB/rate/view/5b4f66025457a3e322c6d674
The normal residental rate I can remove and setup over and over without a issue https://apps.openei.org/USURDB/rate/view/5b4f64115457a3297ac6d674
This error originated from a custom integration.
Logger: custom_components.openei
Source: helpers/update_coordinator.py:182
Integration: OpenEI Utility Rates (documentation, issues)
First occurred: 11:44:31 AM (25 occurrences)
Last logged: 12:27:47 PM
Error fetching openei data:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/openei/__init__.py", line 117, in _async_refresh_data
self._data = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/openei/__init__.py", line 153, in get_sensors
value = getattr(rate, SENSOR_TYPES[sensor].key)
File "/usr/local/lib/python3.10/site-packages/openeihttp/__init__.py", line 197, in current_adjustment
adj = self._data["energyratestructure"][rate_structure][0]["adj"]
KeyError: 'adj'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/openei/__init__.py", line 121, in _async_refresh_data
raise UpdateFailed() from exception
homeassistant.helpers.update_coordinator.UpdateFailed
I am running Home Assistant 2021.9.4 in Docker with HACS 1.15.2.
I have 0.0.8 installed via HACS, but I also tried other versions back to 0.0.4, and tried selecting other providers, but I keep getting "Retrying setup: None" in the Integrations page of Home Assistant.
The only error that appears in the logs for custom_components.openei is this repeating a few times
I verified my API key is working by manually requesting a rateplan with it and it successfully returned a .json with rateplan information. Since the correct utility wasn't showing in the list, I tried manually editing my Home Assistant core.config_entries to replace the utility and rateplan ID and that did not change the error or log behavior. I have also tried removing the integration, uninstalling OpenEI from HACS, restarting Home Assistant's entire Docker container, re-installing OpenEI, and then restarting the Docker container again.
Here are the logs from Home Assistant for a few minutes after startup:
Below are my Home Assistant and HACS environment details. I just found this integration and already purged old Docker images, so I do not know if this could be a breaking change in a recent build of the Home Assistant docker image.
System Health
Home Assistant Community Store
GitHub API | ok -- | -- Github API Calls Remaining | 4202 Installed Version | 1.15.2 Stage | running Available Repositories | 945 Installed Repositories | 17AccuWeather
can_reach_server | ok -- | -- remaining_requests | 18Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okLovelace
dashboards | 3 -- | -- resources | 7 views | 10 mode | storage