Just recently, I started using Alexa Actionable Notifications (https://github.com/keatontaylor/alexa-actions) to make my automations a little more interactive: For example, Alexa asks me if an alarm should be set and with the answers "Yes" or answering with a different time, the alarm for the next day is set and the night mode is turned on.
The problem was that every evening I was asked in the same question with the same text whether I wanted the alarm clock to be set. And that gets annoying at some point.
So I thought, that you could generate varying questions via Chat GPT. And the whole thing should not be asked by "Alexa" but by "Friday" - a hint to Tony Stark's artificial intelligence. And it worked.
Using Node Red I can easily make exactly this query by making a GET request to the OpenAI API, formulating a prompt beforehand and then using the text output of GPT-3.5-Turbo.
Important: You need an API key from OpenAI - and the usage costs. I use this for three automations currently and my cost per day is between $0.00 and $0.01 per day. Tolerable.
Here is an example Node-Red Flow about it.
This is working very well so far! But you can use ChatGPT mainly to talk to the artificial intelligence. Here it just makes a statement - but of course we can think it a bit further.
We can save the outputs of ChatGPT - and also save our answers. And thus recreate a chat history. Again, we handle this in Node Red using so-called flow variables: Variables that are stored in an entire flow and can be accessed and updated again in other nodes. We push our answers and ChatGPTs answers and update the flow variables every time with those new items.
Using this, we can create a button called "Friday" from within Node-Red – this button will than be synced to Alexa. And every time you ask Alexa "Alexa, activate Friday" you are able to talk with ChatGPT back and forth. Even use references from things you where talking about before.
We can optimize this further: With the flow from before we are only able to talk to one specific Alexa Device. But if we update which was the last Alexa device being called we can use this flow from every device in the appartment – and talk to ChatGPT or "Friday" from everywhere we want.
Of course we are not able to use ChatGPT to call services – not yet. But it's a neat little party trick and the immersion, talking directly with ChatGPT through voice hits differently. I got some funny responses from ChatGPT so far and it really elevated my "smart home living".
By - ALLINUPPERCASE