intents
intents copied to clipboard
Switch Domain not Working
It looks like I just can't interact with entities of the switch domain. That should work already, shouldn't it? Other domains are working just fine.
Whenever I try to enable or disable a switch, Assist responds with
An unexpected error occurred while handling the intent
Furthermore, the log reveals the following:
2023-07-21 17:46:22.345 ERROR (MainThread) [homeassistant.components.conversation.default_agent] Intent handling error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/conversation/default_agent.py", line 216, in async_process
intent_response = await intent.async_handle(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 106, in async_handle
result = await handler.async_handle(intent)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 423, in async_handle
raise IntentHandleError(
homeassistant.helpers.intent.IntentHandleError: No entities matched for: name=Nachtsound, area=None, domains=None, device_classes=None
Tested English and German.
Of course, I also double checked that there is an entity called Nachtsound
.
If I try the same sentence with an actually unknown entity name, Assist instead responds with:
Sorry, I couldn't understand that
Thus, it actually seems to find the entity, although the log suggests something else.
If I use the new Assist Developer Tool, I get this:
intent:
name: HassTurnOn
entities:
name:
name: name
value: Nachtsound
text: nachtsound
targets: {}
What sentence are you using?
In English, for instance Turn on the Nachtsound.
.
Similar sentences fail the same way, too.
Is it only for this particular light? Does the problem persist with other lights as well?
Is the switch exposed to Assist?
Tested again with multiple entities.
Is it only for this particular light? Does the problem persist with other lights as well?
I found one integration for which the switches work correctly. The switches of at least two other integrations consistently produce the error though.
Is the switch exposed to Assist?
Yes, all of them were exposed. I guess that part is working fine. If I disable the exposure, the error message changes to
Sorry, I couldn't understand that
Error still occurs on the latest HA version.
Same here. Switches do not work with the same error messages as stated by OP. I am on the latest HA version.
@pako-github could you please paste the log message?
Sure (they are similar to that of OP). It is a switched to turn on/off my wifi through the Fritz!Box integration. It is exposed to the Assistant with alias "Internet". And the switch is working, if I used it on a dashboard.
2023-12-04 12:58:27.181 ERROR (MainThread) [homeassistant.components.conversation.default_agent] Intent handling error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/conversation/default_agent.py", line 225, in async_process intent_response = await intent.async_handle( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 107, in async_handle result = await handler.async_handle(intent) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 424, in async_handle raise IntentHandleError( homeassistant.helpers.intent.IntentHandleError: No entities matched for: name=Internet, area=None, domains=None, device_classes=None
Can you post a screenshot of the entity settings popup and another one of all the aliases of this entity?
Hope that is what you asked for:
That's exactly what I wanted to see, but I see nothing wrong with your setup, which doesn't help with troubleshooting.
Are all your switch
es behaving the same?
No, other switch
are working (although not as intended, but this is probably a bug in the respective integration). It is strange, that the wifi switch is working without problems if I use it with a card on a dashboard.
OK, after a little testing, it seems like "slow" switches (i.e. switches that are slow to change state because they have to forward a request upstream) manifest this behavior.
@Johnson145 can you tell us what Nachtsound
was? What device/service was behind that switch?
@tetele You could be right. At least in my case, Nachtsound
is also "slow" in that means. It's toggling the night sound mode of a Sonos speaker. I.e. it probably needs to wait for a (HTTP?) request sent by the Sonos integration. From a user perspective, toggling the entity in Home Assistant does result in an "almost immediate reaction" on the Sonos speaker, but of course it's not a synchronous programming action.
@synesthesiam do you have any ideas here?
Root cause: https://github.com/home-assistant/architecture/discussions/740
Is there any work around maybe?
No, unfortunately