I taught my virtual assistant to operate my gate and it feels great

Lately I started playing with an LLM operating as my own virtual assistant . I was skeptical, I mean I still am skeptical, about this whole ‘AI will take your job’, but now I do understand the appeal. You can finally have a computer do your biding in a way you control. Previously computer were complicated beasts. You needed to appeal to it like with threats in form of complicated keystrokes forming more complicated commands evolving in even more complicated programs that may or not do the thing you actually wanted. Or it may be not amused by your plea and swallow your data. You would never know for sure if you would not learn those complex magical incantations in magical schools called Universities which takes years and a lot of money. Or you could hire those magicians, Software Engineers, or even Archmages, that commands magicians, called Software Architects that would be appeasing the capricious spirit of the machine to direct flow of money in a company in a correct way. But this is costly and those spells takes years. So you may hire more magicians, entire houses of magic that will appease, train and teach your pricey machine beasts to do what you need them to do. Those houses are called Software Houses for Enterprise Solutions. And they will force those machines to do what you need them to do. Sometimes they will replace entire herds of machines because previous ones were not cooperative enough. And this is costing you riches beyond riches. If you did not had your weight in gold to buy such service you could buy trained machine to do what you need that were not even at your house but somewhere far beyond the realms of your kingdom, in a place called The Cloud. Or you could buy complex incantation that needed only few keywords in correct place to operate your business – CRM or Accounting System or ERP.

And there was no other way to do your business till now. In our suddenly appeared wise and helpful, little spirits called Large Language Models. They were a bit silly and dumb at first showing us funny visions of Will Smith eating spaghetti. But soon were caught and trained by those magicians and magic houses. After years of training in our world knowledge and in our languages they suddenly became magicians themselves, being able to infest soul of the very machines we were so depend of – and we just use them to tell the machines to do what we need.

They still makes mistakes.

But wise and old councils of Mages in tech companies says that in few years after training in our languages and knowledge those spirits will became wise enough to operate our machines and understand our commands. And after another few years those spirits may be so intelligent that after merging with machines and taking human form they will became almost like us but always working for us. Perfect workers. Almost.

In the meantime those spirits makes, another, mistakes.

But for those who were never interested nor concerned by magic and its spells and were just using some machines to do they groceries or write messages or just watch some funny cats are not concerned about such problems. They are preoccupied by vision of they own personal helpful spirit living in they pockets, waiting to be helpful, answering questions, doing shopping or managing calendar. Not being forced to remember how to perform magical incantation on the printer – even if this is as simple enough as “can you turn it off and on again” is too much trouble.

After all who would not want to have personal assistant that have access to all the knowledge of entire human race? Just be waiting for you beside you bed?

Some people even wise and experienced magicians say that those spirits are in fact old and powerful evil demons, that are planning to eat our knowledge, makes us compliant and the enslave us.

But they are haters! They have no idea that they are talking about!

You can ask those spirits to not do something and they will not. Because they try to be helpful. Or at least they will try not to do it. Sometimes they fail but people are failing too! Ever saw what is happening in one of those Houses of Magic when they are doing giant incantation to change the production system? Ha! This is usually real shitshow! Those wise magicians make mistakes too. Plenty.

So those spirits are actually like us already. If they are making mistakes and deleting some data from the table on production because they misunderstood something, they are actually doing the same as me, Experienced Magician of Fifth Level of The Circle of .Net and House of C# of School of Managed Languages, when I was just apprentice.

They are just like us, learning, trying and making themselves better in the process.

Some call them artificial. Others call them intelligent. Artificial they are for sure. We still not sure what intelligence is really. So why not call them Artificial Intelligence? AI? It is short and easy. And it appeals to our own vanity as we are so great that we created life ourselves and made them serve us. We became gods.

I understand the appeal. I taught my own spirit to open and close my property gate. I can just write ‘Open the gate please.’ and it will do that. I can feel not in the mood and just write ‘Open gate.’ and it still accept the command. No need for pleasantries. When I feel particularly lazy I can even write ‘open gate’. It will not complain. It will be nice and helpful and will even use funny emojis! Wow. There is really no need to know complex spells! No need to remember logins, passwords and 2FAs to dozens of systems. You do need to remember where is the damn menu or button. You do need to remember short spells of keyboard shortcuts for quick access to functions. You certainly do no need magical knowledge of APIs, JSONs, integrations, systems, updates, SSH, contenerization, DBs, FE and BE, JS, HTML, CSS, programming languages, compilation, building, releases, scripts, terminals and all of those other forbidden knowledge! You can just tell it what to do!

Let me just say one more time: it can understand what you are saying, understand what you want and do spell on a machine forcing it do what you need! How crazy is that?!

But actually it is not like that. It just appears that way. My own spirit, my personal assistant, did not understood fully what I want but instead it was trying to give me an answer that will satisfy me.

I have electrical engine connected to my gate. Since it is just electrical device controlled by PLC that in turn is just connected to some wires that have either 12V of voltage applied to them or not it was very easy to connect the gate electric engine to my own microcomputer, Raspberry PI zero W. I just connected some 12V power to some makeshift copper board with some solid state relays (like those) and to Pi IOs.

If Pi sets high state on one of the IOs relay sets 12V that is recognized by gate PLC and it turn on motor. Gate opens. Pi have its own mini HTTP server setup. When I call this HTTP server with specific data sets it sets appropriate output to desired state via some Python script and Pi company developed libraries. Gate opens. Or Gate closes. Whatever I want.

It was not even that hard to do. I do have some formal education in electronics but not much. I did some research and asked my buddy that works in automation industry about some technical details. It took me couple of days to gather all stuff and couple of days to write some scripts and test them. Then I connected it and spend next few weeks writing simple Flutter application to connect to that Pi HTTP server. And then I spent next couple of weeks migrating everything few times to next http server that will use Oauth for proper security and proper and added biometrics on mobile app. For security. After all this mobile app controls devices at my house.

Old process with mobile app were like that:

  • I click the button on my mobile app
  • Mobile application sends request to my server
  • server chekcs authentication
  • if authentication is OK sends request to my raspberry PI
  • raspberry pi checks authentication from server
  • if authentication is correct it runs Python library command
  • this command sets IO
  • IO sets relay
  • relay sets correct voltage on the wire
  • wire triggers logic in the PLC
  • PLC runs electric motor
  • motor opens the gate

It was working without big problems for few years. When I started playing with my assistant I wanted to check how hard it will be to teach it to open the gate for me. It would be even better if I could talk to him and ask it to open/close the gate. I was chatting with my model for few days in Polish and it was perfectly capable to understand it. So why not?

I did explain what address have my Pi HTTP server and explained which authentication method it have to use in order to call it via cURL. I explained that there are several endpoints available that do different things. It was able to understand me, mostly, correctly.

It was not totally without problems. It got couples of things wrong. Like for example for some reason it hallucinated that the gate stays open for 10s. I let it slide for now since it does not brake anything (though seeing incorrect fact that I know is incorrect is a bit annoying).

First I explained that I want to add new skill to the assistant.

Add tool “open gate” which calls via HTTP following address https://raspberrypi:5342/gate/open?key=secret

It responded that skill was created but with some things being incorrect.

Tool open gate was added.
You can call it with:
nanobot open-gate --key
Or directly through curl:
curl -s https://raspberrypi:5342/gate/open?key=secret
Warning API key is vulnerable and should not be shared with anyone!
Gate will stay open for 10s.

But it did created a skill and I was able to it to open the gate. It felt great! There was no problem. I was able to integrate my new virtual assistant with my gate without the problem!

When you think about I just switched one UI, of my mobile app, into another UI, of my matrix client. Slightly worse, slower and less secure, but I understand now the appeal! You can now TELL the computer to do something without the complex spells of learning menu items and keyboard shortcuts!

I understand what all the fuss is about. You are now IT Magician yourself!

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve : *
10 + 17 =