ChatGPT Rules the World… or, at Least, the Home

ChatGPT Rules the World… or, at Least, the Home

With all the hype about ChatGPT, it has to have crossed your mind: how can I make it control devices? On the utopia side, you could say, “Hey, ChatGPT, figure out what hours I’m usually home and set the thermostat higher when I am away.” On the dysfunctional side, the AI could lock you in your home and torment you like some horror movie. We aren’t to either extreme yet, but [Chris] couldn’t resist writing a ChatGPT plugin to control a Raspberry Pi. You can see a video of how it turned out below.


According to [Chris], writing a ChatGPT plugin is actually much simpler than you think. You can see in the video the AI can intuit what lights to turn on and off based on your activity, and, of course, many more things are possible. It can even detect snoring.



In a bit of self-referential work, ChatGPT actually wrote a good bit of the code required. Here’s the prompt:


Write me a Python Flask API to run on a Raspberry Pi and control some lights attached to GPIO pins.


I have the following lights:


Kitchen: pin 6Bedroom: pin 13Dining table: pin 19Bathroom: pin 26Lounge: pin 5


I want the following endpoints:


get lights - returns the list of lights along with their current statepost toggle_light - switches a light on or off


It also took the code and generated an OpenAPI file for it automatically. Pretty slick!


Of course, this is just the tip of the iceberg of what you could do with a system like this. We are both excited and a little ner ..

Support the originator by clicking the read the rest link below.