Join us

Using ChatGPT to control Hue Lights

Using ChatGPT to control Hue Lights

The author used GPT-3 to control their Hue Lights with simple instructions such as ‘make the lights blue’, ‘make one light pink and one like orange’ or ‘make them fancy’.

They wrote the project in Python using the phue library to talk to their Hue lights. They integrated this with GPT-3 by asking it to give responses in the JSON format. They used the OpenAI Python API to talk to their models, and a header was defined to tell GPT-3 to give responses in the JSON format, to populate the values in the response to match the request, and to specify what they actually wanted to happen to the lights.

Every time a user enters a message, the message is added to the end of the header and given to GPT-3. The response is parsed into a JSON and used to modify the lights. The author experimented with changing the header around and including the last few messages entered by the user, with mixed results.


Let's keep in touch!

Stay updated with my latest posts and news. I share insights, updates, and exclusive content.

Unsubscribe anytime. By subscribing, you share your email with @faun and accept our Terms & Privacy.

Give a Pawfive to this post!


Only registered users can post comments. Please, login or signup.

Start writing about what excites you in tech — connect with developers, grow your voice, and get rewarded.

Join other developers and claim your FAUN.dev() account now!

Avatar

The FAUN

FAUN.dev()

@faun
The FAUN watches over the forest of developers. It roams between Kubernetes clusters, code caves, AI trails, and cloud canopies, gathering the signals that matter and clearing out the noise.
Developer Influence
3k

Influence

302k

Total Hits

3711

Posts