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

Unknown error following update to v4+ (currently on v4.2) #116

Closed
Wright55 opened this issue Mar 6, 2024 · 5 comments
Closed

Unknown error following update to v4+ (currently on v4.2) #116

Wright55 opened this issue Mar 6, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Wright55
Copy link

Wright55 commented Mar 6, 2024

Have several automations using the start/stop service. Works regularly but since update failed.
Tested using Developer Tools comes up unknown error.

The service dev tool allows you to call any available service in Home Assistant.

Service
Presence Simulation: Presence simulation start
Start the presence simulation

The list of entities to use by the presence simulation to override the list configured in the component
Service data
1

Failed to call service presence_simulation.start. Unknown error

Enabled Debug logging

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/presence_simulation/init.py:111
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:14:07 (4 occurrences)
Last logged: 10:22:50

[140223109604160] Error handling message: Unknown error (unknown_error) Graham from 192.168.2.117 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0)
[140221880514240] Error handling message: Unknown error (unknown_error) Graham from 192.168.2.116 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2024.2 (io.robbie.HomeAssistant; build:2024.561; iPadOS 17.4.0) Mobile/HomeAssistant, like Safari)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 795, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1600, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 435, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 487, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 512, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/presence_simulation/init.py", line 111, in handle_presence_simulation
entity = hass.data[DOMAIN][SWITCH_PLATFORM][switch_id]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: None

Last worked prior to v4.0

@slashback100
Copy link
Owner

The service call takes now a mandatory parameter which is switch_id, that must contain the entity id of the presence simulation switch (switch.presence_simulation by default).
Could you try and let me know please? I will update de Readme accordingly to make it more clear.

@Wright55
Copy link
Author

Wright55 commented Mar 6, 2024 via email

@slashback100
Copy link
Owner

slashback100 commented Mar 6, 2024

You should not create a list under the switch_id but a single value (the example is wrong, it is fixed in future release). Example:

service: presence_simulation.start
data:
  switch_id: switch.presence_simulation
  entity_id:
    - light.l_bar

[EDIT] entity_id seems to be mandatory, I will work on that

@slashback100 slashback100 added the bug Something isn't working label Mar 7, 2024
@slashback100 slashback100 self-assigned this Mar 7, 2024
slashback100 added a commit that referenced this issue Mar 7, 2024
@slashback100
Copy link
Owner

@Wright55
Copy link
Author

Wright55 commented Mar 7, 2024

Thank you, all okay now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants