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 setting up entry" after full power down #146

Closed
IsaacInsoll opened this issue Oct 30, 2023 · 3 comments
Closed

"Error setting up entry" after full power down #146

IsaacInsoll opened this issue Oct 30, 2023 · 3 comments

Comments

@IsaacInsoll
Copy link

I installed ECHONETLite a few weeks ago and everything has been working perfectly.

I'm just getting some solar panels installed so the whole house has had power cut temporarily so the Air Condiitioner lost power, and I gracefully shut down the Home Assistant docker.

Now the power is back on and Home Assistant is alive and well with everything working except EchonetLite.

Heres the log file:

2023-10-30 13:37:33.983 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Living Room Air Con for echonetlite
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/echonetlite/__init__.py", line 241, in async_setup_entry
    await echonetlite.async_update()
  File "/config/custom_components/echonetlite/__init__.py", line 434, in async_update
    return await self.async_update_data(kwargs=kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/echonetlite/__init__.py", line 441, in async_update_data
    batch_data = await self._instance.update(flags, no_request)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pychonet/EchonetInstance.py", line 122, in update
    response = await self._api.echonetMessage(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 168, in echonetMessage
    await asyncio.sleep(0.1)
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 639, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost
2023-10-30 13:38:41.236 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Living Room Air Con for echonetlite
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/echonetlite/__init__.py", line 241, in async_setup_entry
    await echonetlite.async_update()
  File "/config/custom_components/echonetlite/__init__.py", line 434, in async_update
    return await self.async_update_data(kwargs=kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/echonetlite/__init__.py", line 441, in async_update_data
    batch_data = await self._instance.update(flags, no_request)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pychonet/EchonetInstance.py", line 122, in update
    response = await self._api.echonetMessage(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 202, in echonetMessage
    await asyncio.sleep(0.1)
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 639, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost

Everything else is working in Home Assistant, and the crappy Mitsubishi cloud app is still able to control the aircon (I know this is a different protocol, but just confirming that the aircon has network connectivity)

What are the troubleshooting steps from here?

Thanks

@IsaacInsoll
Copy link
Author

Heres additional logs that might help

2023-10-30 12:18:31.775 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform echonetlite
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 593, in state
    numerical_value = float(value)  # type:ignore[arg-type]
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 595, in state
    raise ValueError(
ValueError: Sensor sensor.living_room_air_con_measured_outdoor_air_temperature has device class 'temperature', state class 'measurement' unit '°C' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'unavailable' (<class 'str'>)
2023-10-30 12:18:31.801 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up echonetlite platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 593, in state
    numerical_value = float(value)  # type:ignore[arg-type]
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)

@nao-pon
Copy link
Collaborator

nao-pon commented Oct 30, 2023

This issue appears to be related to #144. It has been fixed in the master branch, so it may resolve this issue as well. You can get the master branch using HACS, so could you try it out?

If the IP address has changed, you should be able to migrate to the new IP address by turning the power on/off on the target device.

@nao-pon
Copy link
Collaborator

nao-pon commented Dec 14, 2023

This issue may have been fixed in Version 3.7.7, so I'm closing this. If the problem continues, you can reopen it.

@nao-pon nao-pon closed this as completed Dec 14, 2023
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