lewei50 / ha_iammeter

IAMMETER custom component for Home Assistant
Apache License 2.0
4 stars 1 forks source link

Errors on restart after upgrade to v1.0.12 #4

Closed sabbrowne closed 1 year ago

sabbrowne commented 1 year ago

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/iammeter_http/init.py:52 Integration: Iammeter_http First occurred: 15:28:47 (1 occurrences) Last logged: 15:28:47

Error setting up entry iammeter for iammeter_http Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/iammeter_http/init.py", line 22, in async_setup_entry coordinator = IammeterData(hass, entry) File "/config/custom_components/iammeter_http/init.py", line 52, in init self.port = entry.data[CONF_PORT] KeyError: 'port'

Error occurs on restart after upgrading from v1.0.9 to v1.0.12 I have restored back to v1.0.9 til this issue can be resolved

Running HA: Home Assistant 2023.3.5 Supervisor 2023.03.2 Operating System 9.5 Frontend 20230309.1 - latest

Iammeter Information:

Firmware Ver.: ATVi.75.98.1@MX1290 Running Cloud Mode Model: WEM3080T

iWladi commented 1 year ago

I have the same problem, I still can't upgrade from version 1.0.9

miwyf commented 1 year ago

From your error message, it may be caused by adding a custom port in v1.0.11. After upgrading to v1.0.12, you can try to delete it in Devices&Services and add it again.

sabbrowne commented 1 year ago

Hi, I have never installed any version newer than v1.0.9. As all version after this have failed to load, with the same custom port error. If I delete current version 1.0.9 will I lose all my energy history in HA?

miwyf commented 1 year ago

image image

I deleted iammeter from Devices&Services, then re-added iammeter with the same name, the historical data is still there, the database used by my homeassistant is MariaDB

miwyf commented 1 year ago

If you are not sure, you can backup your database first

sabbrowne commented 1 year ago

Thanks miwyf Ill give that a try and report back

sabbrowne commented 1 year ago

Hi miwyf, I followed you instructions and now get the following error after install of v1.0.12 and restart:

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/iammeter_http/config_flow.py:24 Integration: Iammeter_http First occurred: 20:35:49 (1 occurrences) Last logged: 20:35:49

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 95, in _async_start await gather_withconcurrency( File "/usr/src/homeassistant/homeassistant/util/async.py", line 178, in gather_withconcurrency return await gather( File "/usr/src/homeassistant/homeassistant/util/async.py", line 176, in sem_task return await task File "/usr/src/homeassistant/homeassistant/config_entries.py", line 831, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/config_entries.py", line 859, in _async_init result = await self._async_handle_step(flow, flow.init_step, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/iammeter_http/config_flow.py", line 118, in async_step_ssdp if self._host_in_configuration_exists(friendly_name): File "/config/custom_components/iammeter_http/config_flow.py", line 40, in _host_in_configuration_exists if name in iammeter_entries(self.hass): File "/config/custom_components/iammeter_http/config_flow.py", line 23, in iammeter_entries return { File "/config/custom_components/iammeter_http/config_flow.py", line 24, in entry.data[CONF_NAME] KeyError: 'name'

miwyf commented 1 year ago

Have you deleted all iammeter devices in Devices&Services?

miwyf commented 1 year ago

1.deleted all iammeter devices in Devices&Services? 2.upgrading to v1.0.12 from HACS 3.restart homeassistant 4.add iammeter devices in Devices&Services?

sabbrowne commented 1 year ago

Yes I deleted the iammeter install... using the method yoou outlined above... the iammeter_http card disappeared Then upgraded to from HACS to v1.0.12 I then restarted then got he above error I restored back to a back up I had and running okay for now

miwyf commented 1 year ago

Is the problem solved now, or is there still a problem

sabbrowne commented 1 year ago

Sorry for the confusion.. No the issue is not solved. My comment two days ago was just stating what I did to try and solve the issue. I just followed your instructions earlier.

This is what didnt work: Yes I deleted the iammeter install... using the method yoou outlined above... the iammeter_http card disappeared Then upgraded to from HACS to v1.0.12 I then restarted then got he above error I restored back to a back up I had and running okay for now

sabbrowne commented 1 year ago

This is the error I get when installing v1.0.12

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/iammeter_http/config_flow.py:24 Integration: Iammeter_http First occurred: 20:35:49 (1 occurrences) Last logged: 20:35:49

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 95, in async_start await gather_with_concurrency( File "/usr/src/homeassistant/homeassistant/util/async.py", line 178, in gather_withconcurrency return await gather( File "/usr/src/homeassistant/homeassistant/util/async.py", line 176, in sem_task return await task File "/usr/src/homeassistant/homeassistant/config_entries.py", line 831, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/config_entries.py", line 859, in _async_init result = await self._async_handle_step(flow, flow.init_step, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/iammeter_http/config_flow.py", line 118, in async_step_ssdp if self._host_in_configuration_exists(friendly_name): File "/config/custom_components/iammeter_http/config_flow.py", line 40, in _host_in_configuration_exists if name in iammeter_entries(self.hass): File "/config/custom_components/iammeter_http/config_flow.py", line 23, in iammeter_entries return { File "/config/custom_components/iammeter_http/config_flow.py", line 24, in entry.data[CONF_NAME] KeyError: 'name'

yangbo1979 commented 1 year ago

try install fresh hassos and add "iammeter_http" 1.0.12 may solve this problem. but this may cause you lost all your data. (there is no key 'name' in source code before v1.0.9,this may cause error if you upgrade to v1.0.12 directly.)

sabbrowne commented 1 year ago

Sorry A fresh install is not an acceptable solution... as there will be data loss. I have been running the modbus version for several weeks now as weel as v1.0.9... and it seems to working okay. Only trouble is I will have to change all my utility meters to the modbus version... Of course this will mean data loss to... Any other solutions? I feel I am being left high and dry!!... as in no other solution to take