HA now can't find intents

I had Rhasspy Base and 2 Satellites working, then moved the HA server and a satellite to demonstrate … now the intents are not actioned :frowning:

The satellite and Rhasspy on the base station seem to be working correctly (Home page on base station Rhasspy is showing the correct intent and JSON).
Screenshot from 2021-12-04 09-06-33

The satellite’s console includes:

[DEBUG:2021-12-06 16:49:53,739] rhasspyhomeassistant_hermes: <- NluIntent(input='turn on study light', intent=Intent(intent_name='LightState', confidence_score=1.0), site_id='sat-2', id=None, slots=[Slot(entity='state', value={'kind': 'Unknown', 'value': 'on'}, slot_name='state', raw_value='on', confidence=1.0, range=SlotRange(start=5, end=7, raw_start=5, raw_end=7)), Slot(entity='name', value={'kind': 'Unknown', 'value': 'study light'}, slot_name='name', raw_value='study light', confidence=1.0, range=SlotRange(start=8, end=19, raw_start=8, raw_end=19))], session_id='sat-2-porcupine_raspberry-pi-44b9366a-3c31-4ade-9689-51549472e015', custom_data='porcupine_raspberry-pi', asr_tokens=[[AsrToken(value='turn', confidence=1.0, range_start=0, range_end=4, time=None), AsrToken(value='on', confidence=1.0, range_start=5, range_end=7, time=None), AsrToken(value='study', confidence=1.0, range_start=8, range_end=13, time=None), AsrToken(value='light', confidence=1.0, range_start=14, range_end=19, time=None)]], asr_confidence=0.753947, raw_input='turn on study light', wakeword_id='porcupine_raspberry-pi', lang=None)
[DEBUG:2021-12-06 16:49:53,744] rhasspyserver_hermes: Sent 858 char(s) to websocket
[DEBUG:2021-12-06 16:49:53,757] rhasspyhomeassistant_hermes: http://192.168.1.98:8123/api/intent/handle
[ERROR:2021-12-06 16:49:53,806] rhasspyhomeassistant_hermes: handle_home_assistant_intent
Traceback (most recent call last):
  File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 173, in handle_home_assistant_intent
    response.raise_for_status()
  File "/usr/lib/rhasspy/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    headers=self.headers,
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('http://192.168.1.98:8123/api/intent/handle')
[ERROR:2021-12-06 16:49:53,807] rhasspyhomeassistant_hermes: handle_intent
Traceback (most recent call last):
  File "/usr/lib/rhasspy/rhasspy-homeassistant-hermes/rhasspyhomeassistant_hermes/__init__.py", line 88, in handle_intent
    assert response_dict, f"No response from {self.url}"
AssertionError: No response from http://192.168.1.98:8123/
[DEBUG:2021-12-06 16:50:18,128] rhasspymicrophone_cli_hermes: <- AsrStopListening(site_id='sat-2', session_id='sat-2-porcupine_raspberry-pi-44b9366a-3c31-4ade-9689-51549472e015')
[DEBUG:2021-12-06 16:50:18,128] rhasspywake_porcupine_hermes: <- HotwordToggleOn(site_id='sat-2', reason=<HotwordToggleReason.DIALOGUE_SESSION: 'dialogueSession'>)
[DEBUG:2021-12-06 16:50:18,129] rhasspywake_porcupine_hermes: Enabled

indicating that HA is not processing the intent. To aid debugging, in my configuration.yaml I commented out the larger intents.yaml and instead inserted directly into HA’s configuration.yaml:

#intent: !include intents.yaml
intent:
    LightState:
      speech:
        text: Turning {{ name }} {{state }}
      action:
        - service: light.turn_{{ state }}
          target:
            entity_id: light.{{ name | replace(" ","_") }}

In HA’s Log Viewer:

File "/usr/src/homeassistant/homeassistant/components/intent/__init__.py", line 69, in post
intent_result = await intent.async_handle(
File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 62, in async_handle
raise UnknownIntent(f"Unknown intent {intent_type}")
homeassistant.helpers.intent.UnknownIntent: Unknown intent LightState

In HA’s Configuration > Logs there is an “Error handling request” (also Supervisor > System > Core log) :

Logger: aiohttp.server
Source: helpers/intent.py:62 
First occurred: 4:49:53 PM (1 occurrences) 
Last logged: 4:49:53 PM 
Error handling request 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/intent/__init__.py", line 69, in post
    intent_result = await intent.async_handle(
  File "/usr/src/homeassistant/homeassistant/helpers/intent.py", line 62, in async_handle
    raise UnknownIntent(f"Unknown intent {intent_type}")
homeassistant.helpers.intent.UnknownIntent: Unknown intent LightState

I don’t see any obvious change or error.
Is there anything else can I try before taking a new card and installing HA again from scratch ??

FWIW, the problem was that I had somehow lost the “intent_scripts:” line. Don’t ask me how :frowning:

In the section of configuration.yaml quoted in my original post (after i had done some troubleshooting), it should have read

#intent: !include intents.yaml
intent:
intent_script: 
    LightState:
      speech:
        text: Turning {{ name }} {{state }}

My configuration.yaml now reads

intent: 
intent_script: !include intents.yaml

Thanks for the help. Does this indicate that no-one uses intents ? If so, can we get rid of them and point users to Node-Red instead ?

1 Like

FWIW, this also happened after I migrated all my intents to node-RED and removed most of my intents from the intents.yaml file.
The intents which I had deleted from the intents.yaml file now produce “Unknown Intent” errors in the core log file when the system is rebooted.

Commenting out the intent: lines in configuration.yaml has stopped the error messages on boot.

#intent: 
#intent_script: !include intents.yaml