H801 connection failure with EspHome

Hello everyone,
I have an H801 module to control led strips, with the EspHome firmware.
It always worked good until recently, when the Home Assistant stopped being able to control it, always giving the error “Failed to call the service light/turn_on. Connection not done for h801-sala-estar @ 192.168.1.44” with the Log I indicate below.
However, via the EspHome webpage the module is fully functional, in the EspHome manager it always appears as available. All other EspHome Modules keep working without any errors.

I have already removed the device and added it again, changed its fixed IP, “flashed” several times and nothing! Sometimes when restarting the module it works in HA for a few seconds, then it returns to the same error. Every X minutes the module restarts by itself, I don’t know if it’s because of the lack of connection to the HA…
Searching on Google I can’t find anything similar.

Any tips?

Error in Log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/esphome/light.py:252
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 22:25:05 (2 occurrences)
Last logged: 22:25:08
[2803389632] Connection not done for h801-sala-estar @ 192.168.1.44!

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 570, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/esphome/light.py", line 252, in async_turn_on
    await self._client.light_command(**data)
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 820, in light_command
    self._check_authenticated()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 276, in _check_authenticated
    self._check_connected()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 273, in _check_connected
    raise APIConnectionError(f"Connection not done for {self._log_name}!")
aioesphomeapi.core.APIConnectionError: Connection not done for h801-sala-estar @ 192.168.1.44!

imagem

First things first: Update your esphome to the latest and greatest version then try and report again :page_with_curl:

Home Assistant Addon Repo

This is a repeat from the 2022.2 release notes.

The ESPHome Home Assistant addon repository is added by default to new Home Assistant installations. Because of this, we have decided that we would deprecate the ESPHome addon inside the Community Addons and everyone should move to the ESPHome repo. It is safe to delete the Community ESPHome addon as your configuration YAML files are stored in the Home Assistant configuration folder.

You can add the ESPHome addon here:

Open your Home Assistant instance and show the dashboard of the ESPHome add-on.

As written on: ESPHome 2022.4.0 - 20th April 2022 — ESPHome

Thanks for the tip, I hadn’t even noticed that the EspHome repository had disappeared and it stopped updating…

However, I’ve already updated all (addaon and nodes) and the error persists.

Any help?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/esphome/light.py:252
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:57:45 (15 occurrences)
Last logged: 10:21:21

    [2644261880] Connection not done for h801-sala-estar @ 192.168.1.44!
    [2644027928] Connection not done for h801-sala-estar @ 192.168.1.44!
    [2644934368] Connection not done for h801-sala-estar @ 192.168.1.44!

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 570, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/esphome/light.py", line 252, in async_turn_on
    await self._client.light_command(**data)
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 820, in light_command
    self._check_authenticated()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 276, in _check_authenticated
    self._check_connected()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 273, in _check_connected
    raise APIConnectionError(f"Connection not done for {self._log_name}!")
aioesphomeapi.core.APIConnectionError: Connection not done for h801-sala-estar @ 192.168.1.44!

Mode details:
Make a new test and remove password fro api. The api connected and work for a while, then the error come back…

Log:

[11:58:40][I][ota:113]: Boot seems successful, resetting boot loop counter.
[11:58:43][D][api:102]: Accepted 192.168.1.200
[11:58:43][VV][api.service:434]: on_hello_request: HelloRequest {
  client_info: 'aioesphomeapi'
  api_version_major: 1
  api_version_minor: 7
}
[11:58:43][V][api.connection:898]: Hello from client: 'aioesphomeapi (192.168.1.200)' | API Version 1.7
[11:58:43][VV][api.service:013]: send_hello_response: HelloResponse {
  api_version_major: 1
  api_version_minor: 7
  server_info: 'h801-sala-estar (esphome v2022.11.1)'
  name: 'h801-sala-estar'
}
[11:58:43][VV][api.service:488]: on_device_info_request: DeviceInfoRequest {}
[11:58:43][VV][api.service:049]: send_device_info_response: DeviceInfoResponse {
  uses_password: NO
  name: 'h801-sala-estar'
  mac_address: '84:F3:EB:E0:D8:3E'
  esphome_version: '2022.11.1'
  compilation_time: 'Nov 21 2022, 11:51:54'
  model: 'esp01_1m'
  has_deep_sleep: NO
  project_name: ''
  project_version: ''
  webserver_port: 80
  bluetooth_proxy_version: 0
  manufacturer: 'Espressif'
}
[11:58:43][VV][api.socket:810]: aioesphomeapi (192.168.1.200): Connection closed
[11:58:43][W][api.connection:083]: aioesphomeapi (192.168.1.200): Connection closed
[11:58:43][D][api:102]: Accepted 192.168.1.200
[11:58:43][V][api:114]: Removing connection to aioesphomeapi (192.168.1.200)
[11:58:43][VV][api.service:434]: on_hello_request: HelloRequest {
  client_info: 'Home Assistant 2022.11.4'
  api_version_major: 1
  api_version_minor: 7
}
[11:58:43][V][api.connection:898]: Hello from client: 'Home Assistant 2022.11.4 (192.168.1.200)' | API Version 1.7
[11:58:43][VV][api.service:013]: send_hello_response: HelloResponse {
  api_version_major: 1
  api_version_minor: 7
  server_info: 'h801-sala-estar (esphome v2022.11.1)'
  name: 'h801-sala-estar'
}
[11:58:43][VV][api.service:443]: on_connect_request: ConnectRequest {
  password: ''
}
[11:58:43][D][api.connection:917]: Home Assistant 2022.11.4 (192.168.1.200): Connected successfully


Then, the connection  error occurred:

[11:59:22][VV][api.service:470]: on_ping_request: PingRequest {}
[11:59:22][VV][api.service:043]: send_ping_response: PingResponse {}
[11:59:23][VV][api.socket:810]: Home Assistant 2022.11.4 (192.168.1.200): Connection closed
[11:59:23][W][api.connection:083]: Home Assistant 2022.11.4 (192.168.1.200): Connection closed
[11:59:23][V][api:114]: Removing connection to Home Assistant 2022.11.4 (192.168.1.200)
[11:59:25][VV][scheduler:195]: Running interval ‘’ with interval=10000 last_execution=334893 (now=344893)
[11:59:35][VV][scheduler:195]: Running interval ‘’ with interval=10000 last_execution=344893 (now=354893)
[11:59:37][VV][api.service:470]: on_ping_request: PingRequest {}
[11:59:37][VV][api.service:043]: send_ping_response: PingResponse {}


Without any advance or help, I flash Tasmota and all are working now…

I prefer EspHome, but…

I have the same problem over here, cant turn on or off the light service.

I revert back to home assistant 2022.10.5 and i can turn on and off the ledstrip connected to the h801 through esphome.

Hope someone has a fix for this problem

Interesting. Wonder if there were regressions introduced on the HA side regarding esphome in newer versions?

Would some one mind to open a issue over at the esphome issue github? Hopefully the devs can reproduce the issue and find the root cause!

I opened an issue at the at the esphome hithub
Hope they can help☺️

1 Like

Same problem for me. HA 2022 11 5 and esp home 2022 11 3.
One command van be send for example ledstrip on or off or change brightness.
After this command is loses connection. No function anymore.
I’ m still able to ping the IP of the H801 so wifi is still connected.

[1553517800] Connection not done for ledstrip @ 192.168.178.85!
3:32:54 PM – (ERROR) Home Assistant WebSocket API - message first occurred at 3:32:18

Hi, got the same problem. Waited for an update before posting to see if the issue got solved.
Just updated EspHome to the new release today 2022.11.5 but still getting the same error.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/esphome/switch.py", line 54, in async_turn_on
    await self._client.switch_command(self._static_info.key, True)
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 866, in switch_command
    self._check_authenticated()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 276, in _check_authenticated
    self._check_connected()
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 273, in _check_connected
    raise APIConnectionError(f"Connection not done for {self._log_name}!")
aioesphomeapi.core.APIConnectionError: Connection not done for neoplug02 @ 192.168.1.224!