I’ve been learning how to run a voice assistant locally but was pleasantly surprised when I found it dramatically cleaned up a mess of scripts I had by a capability google lacked.
I have two areas where I had created a large number of individual scripts. One is to display a security camera (I have 8 + grid = 9) on any of four TV’s by voice. With google, as best I could ever find, that meant 9 x 4 = 36 scripts. I also have a dozen or so music lists for player piano music with the same issue – each required a separate script to activate the piano and play via Kodi. Call it about 50 total scripts. I think it’s actually more as I have two HA displays I display similar to cameras but unrelated to cameras.
Well, the LLM can use tools and call scripts with variables. I now have 4 scripts, one each to call the piano script or the camera script with a set of selection choices, and one each to actually do the work (so I can call it non-blocking so the LLM doesn’t wait).
About 50+ scripts now became 4, and much easier to extend.
It’s a very nice feature I was not expecting.
So if starting down the LLM rabbit hole, keep it in mind. Good descriptions help, e.g.
display_content_on_tv:
alias: "Display Content on TV"
description: "When given a command such as 'Display HVAC on Office TV' this tool is used by matching the fields to a source and tv and then activating this script with those fields. Use this for specific named camera displays even when you do not have access to the camera itself."
fields:
Well not to be unfriendly but it tells me also that the person who made the 50+ scripts in the first place didn’t had the skills to do it smarter.
However, no matter the tools used you made a great jump in simplifying your setup
Keeping in mind I wanted to tell google to display [camera name] on [tv name] how would I have done that smarter? I’ll be the first to confess that I don’t pay enough attention to all the changes in scripting and templates and may have missed a technique.
With more the 30 years developing software behind me I know it’s true that new technics will make things easier however even with the most basic syntax set you can do miracles if you think a little further about the given problem. If I made 50 some scripts all doing the same things (yes, i’ve done that too) and the AI do it in 4 then I for sure want to know how it’s done. To learn but also to check if it is done correctly.
But anyway, problem solved and that is a good thing
No, the problem is not solved, at least not the problem of my education. It was said there was a much better approach than writing 50 copies of the script all similar but for device names. That problem remains, and I really hope your extensive career developing software can help me learn something.
Google, as I understand it, offers to call scripts but only by a on/off technique, not with parameters.
So I’m waiting patiently to be taught how I can get that google interface to do all these combinations with one or a few scripts. Or as you put it, please “give me the skills to do it smarter”. Please.
I have other places where I can simplify things if so.