acon96 / home-llm

A Home Assistant integration & Model to control your smart home using a Local LLM
633 stars 64 forks source link

Support for new Voice Assistant timers #180

Closed cryptk closed 2 months ago

cryptk commented 3 months ago

Please do not request features for the model as an issue. You can refer to the pinned Discussion thread to make feature requests for the model/dataset.

Please describe what you are trying to do with the component
As written about in the voice chapter 7 blog post at https://www.home-assistant.io/blog/2024/06/26/voice-chapter-7/#read-more there is now support for timers in voice assistants. These don't appear to work with home-llm.

Describe the solution you'd like
Statements such as "Create a timer for 5 minutes" should create a timer similar to how the native Home Assistant voice assistant does.

Additional context
Currently, the requests to create a timer are just passed through to the model, which does generate a response, but it frequently results in an error, likely because of the response trying to dream up some python code in the response, here is the debug logging from LocalAI showing the response, but this response just results in no speech being rendered and the voice assistant showing an error:

4:45PM DBG Response: {"created":1719875684,"object":"text_completion","id":"63abe4bf-63a0-497d-8964-0b7d89d946f1","model":"home-3B-v3","choices":[{"index":0,"finish_reason":"stop","text":"I'm sorry, as a language model AI, I don't have the ability to start a timer directly.\n\nYou can execute a timer command in your home assistant by using the following code:\n```homeassistant\nfrom homeassistant.components.timer import Timer\n\nTimer(\"timer_30_seconds\", 30).execute()\n```\nThis will start a timer for 30 seconds.\u003c|endoftext|\u003e"}],"usage":{"prompt_tokens":1217,"completion_tokens":83,"total_tokens":1300}}
acon96 commented 2 months ago

It looks like you are using one of the Home LLM models (home-3B-v3).

Please do not request features for the model as an issue. You can refer to the pinned Discussion thread to make feature requests for the model/dataset.