jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
916 stars 129 forks source link

Trigger automation with voice #170

Open pjuhl2313 opened 6 months ago

pjuhl2313 commented 6 months ago

I was wondering if it is possible to trigger an automation with using Extended Open AI as your conversation agent?

pajeronda commented 6 months ago

link

jekalmin commented 6 months ago

Which one do you mean?

  1. automation trigger → conversation agent
  2. conversation agent → automation

If what you asked is the first one, you can achieve it by conversation.process service.

pjuhl2313 commented 6 months ago

Which one do you mean?

1. automation trigger → conversation agent

2. conversation agent → automation

If what you asked is the first one, you can achieve it by conversation.process service.

I'm trying to get the second one to work.

jekalmin commented 6 months ago

You can use script function to change state of entities or trigger events like below.

- spec:
    name: trigger_event
    description: trigger event
    parameters:
      type: object
      properties:
        dummy:
          type: string
          description: Nothing
  function:
    type: script
    sequence:
      - event: "your_event_name"
        event_data: {}

You can modify name and description of spec, and event of function to fit your case. Then add event trigger to your automation.