extended_openai_conversation icon indicating copy to clipboard operation
extended_openai_conversation copied to clipboard

randomly dont find (all) entities

Open bsakab opened this issue 1 year ago • 5 comments

image

Very often an entity cannot be found in for my living room Fehler: "Something went wrong: Unable to find entity ['light.livingroom_couch']"

If I ask the assistant to show me all known entities for this room the list varies randomly

any idea

--- version 1.0 and version 1.0.1 beta1 (update) only version 1.0.1 beta1, messed up downgrade

Traceback (most recent call last): File "/config/custom_components/extended_openai_conversation/init.py", line 173, in async_process response = await self.query(user_input, messages, exposed_entities, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/extended_openai_conversation/init.py", line 299, in query message = await self.execute_function_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/extended_openai_conversation/init.py", line 344, in execute_function result = await function_executor.execute( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/extended_openai_conversation/helpers.py", line 197, in execute return await self.execute_service( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/extended_openai_conversation/helpers.py", line 238, in execute_service self.validate_entity_ids(hass, entity_id or [], exposed_entities) File "/config/custom_components/extended_openai_conversation/helpers.py", line 165, in validate_entity_ids raise EntityNotFound(entity_ids) custom_components.extended_openai_conversation.exceptions.EntityNotFound: Unable to find entity ['light.livingroom_couch']

bsakab avatar Jan 14 '24 19:01 bsakab

(update) only version 1.0.1 beta1, messed up downgrade

bsakab avatar Jan 14 '24 19:01 bsakab

Thanks for reporting an issue.

Please correct me if I'm wrong.

  • light.light_livingroom_couch is the entity_id you have.
  • light.livingroom_couch is the entity_id that gpt tries to call (which is wrong)

If this is true, it seems it should also happen in 1.0.1-beta1. It's gpt which passed a wrong entity_id.

jekalmin avatar Jan 17 '24 11:01 jekalmin

You are absolutely right The name of the entity is: light.livingroom_couch but the ID of the entity is: light.light_livingroom_couch

That could be the reason why chatgpt is confused. I tested it and the prompt "switch on light light_livingroom_couch" works and "switch on light livingroom_couch" does not work So avoiding multiple terms like "light" in the entity id should fix this problem.

I downgraded from the beta to stable 1.0 Version and I thought it fixed that issue. But today that behavior appeared also on Version 1.0.

Thanks for ypur support.

bsakab avatar Jan 18 '24 01:01 bsakab

So avoiding multiple terms like "light" in the entity id should fix this problem.

I think so. Since entity_id and friendly_name of attributes matter in gpt, changing entity_id might solve the problem.

jekalmin avatar Jan 18 '24 01:01 jekalmin

I've also seen this issue a lot. So the solution is to edit entity IDs to avoid duplicates? Or is it to have the full entity ID match the friendly name?

Do aliases help with this?

ayjbachata avatar Feb 06 '24 16:02 ayjbachata

Could you try with gpt-4o-mini?

jekalmin avatar Nov 12 '24 14:11 jekalmin

Closing the issue.

jekalmin avatar Dec 01 '24 14:12 jekalmin