AI powered assistant to control dumb switches

I’ve been working for a week already on the following task. I have a dumb switch that turns on and off my boiler. I have already integrated several AI assistants, but none of them meet my requirements.

  1. It must be able to turn the boiler on for any given time (in minutes, hours defined by voice or text)
  2. It must support the context of the conversation.

I was able to configure Extended OpenAI Conversation integration to handle time duration, but it does not support context (correct me if I’m wrong). The official OpenAI Conversation Integration supports only context, but refuses to control the time duration of the boiler activity. The separate Ollama server currently has similar behaviour - it only keeps the context of our conversation. I’ve been trying to solve this with ChatGPT, but unfortunately, without success. I’m sure it is a very common idea on how to make a dumb switch smarter. Maybe someone has any ideas about what is missing in my puzzle.

I would almost think this might be a tongue-in-cheek post.

how would an AI system control a dumb switch? there has to be a way for the AI (or any other system for that matter) to communicate with the switch. If it’s dumb then how is that supposed to work?

AI is great and all (slightly or more also tongue-in-cheek) but it’s not magic…yet.

unless I’m missing something obvious. If so then ignore me and my apologies.

You will have to write your own custom script that accepts time duration as input and handles errors then build context so the llm knows how to use it.

as I said, I succeeded in both tasks, but separately using different AI agents. So it is not a tongue-in-cheek post

You are absolutely right!
I have several scripts to handle primitive actions.

For example, the following script has the logic of turning on a switch for a given duration.

alias: Turn on switch with timer
mode: single
fields:
  switch:
    description: The entity ID of the switch to turn on
    example: switch.boiler
  duration:
    description: The duration to keep the switch on (HH:MM:SS)
    example: "00:10:00"
sequence:
  - data:
      entity_id: "{{ switch }}"
    action: switch.turn_on
  - delay: "{{ duration }}"
  - data:
      entity_id: "{{ switch }}"
    action: switch.turn_off

In addition, ChatGPT helped me to compile several automations assisting in formatting and transferring text received from a user to the LLM agent. All of them work fine if I trigger them manually through a webhook. But they have never been triggered when chatting with Assist (text or voice). I decided to dig slightly deeper and discovered that no event is fired during my communication with the Assist! Which is crucial in all scripts and services I compiled. I believe now that all these auxiliary tools are irrelevant and I need to teach LLM how to work with the above script. Do you have any ideas?

Read my Friday’s Party post.

You’re falling in a trap that just because it’s in HA the llm can do it.

You have to build the context for the llm to understand your tools before it has a prayer of doing it. What you’re looking for is in the first 10 posts.

Friday's Party: Creating a Private, Agentic AI using Voice Assistant tools

then how does the AI control the dumb switches?

1 Like