# PyPortal Philips Hue Lighting Controller

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/074/587/medium800thumb/circuitpython_ezgif.com-video-to-gif_%2810%29.jpg?1555602967)

_ **Want to create the right atmosphere to match your mood?&nbsp;** _

The[**Philips Hue**](http://meethue.com) is the most intelligent lighting system on the market. The Hue system is comprised of a bridge which communicates over the Internet and smart lights. There's&nbsp; **_lots_ of different types of lights** to connect to the Hue Bridge - from bulbs to LED strips.

With Hue, **you can set light colors** to transform the mood of a room, **create lighting profiles** for different scenarios, create light profiles to wake up to, and even **control lights outside of your home**.

- [You can **browse the entire Philips Hue product line on their website here**](https://www2.meethue.com/en-us/products).

**In this guide, you'll be building a touchscreen lighting controller with an Adafruit PyPortal to control a light, or groups of lights, connected to a Philips Hue bridge.**

![](https://cdn-learn.adafruit.com/assets/assets/000/074/589/medium800/circuitpython_Untitled.png?1555603518)

The&nbsp; **Philips Hue** &nbsp;lighting system revolves around the&nbsp; **Hue Bridge**. This bridge is connected to your router and communicates&nbsp;_wirelessly_&nbsp;over radio (in a format called ZigBee) to Hue lights and devices linked to the bridge.

Instead of including a separate WiFi radio in each bulb, which increases the number of WiFi devices on your router,&nbsp;_only the hub is connected to your router_.&nbsp;

![circuitpython_046677458485-IMS-en_US.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/074/477/medium640/circuitpython_046677458485-IMS-en_US.jpeg?1555340273)

If you're looking for a way to **interactively control Philips Hue Lights with CircuitPython** , follow along!

## CircuitPython Code

CircuitPython is perfect for building Internet-of-Things projects. This project uses the [ESP32SPI CircuitPython](https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI)library, which can use the ESP32 as a WiFi-coprocessor to send web requests to the LIFX HTTP Remote Control API.

We've also built a&nbsp;[Philips Hue helper module for CircuitPython](https://github.com/adafruit/Adafruit_CircuitPython_Hue/)&nbsp;to make interfacing with Hue incredibly easy.&nbsp;

![circuitpython_Mu_1_0_2_-_untitled__.png](https://cdn-learn.adafruit.com/assets/assets/000/074/479/medium640/circuitpython_Mu_1_0_2_-_untitled__.png?1555340512)

You can rapidly update your code without having to compile and store WiFi and API secret keys on the device. This means that there's no editing code and re-uploading whenever you move the PyPortal to another network - just update a file and you're set.&nbsp;

## PyPortal

Say hello to PyPortal! The easiest way to build your IoT projects with a touchscreen display!

[Make sure to walk through the PyPortal introduction guide and walkthrough the pages. It'll get you setup with CircuitPython and a handful of demo code to play with!](https://learn.adafruit.com/adafruit-pyportal)

![circuitpython_internet_of_things___iot_3d_printing_hero_(1).jpg](https://cdn-learn.adafruit.com/assets/assets/000/074/388/medium640/circuitpython_internet_of_things___iot_3d_printing_hero_%281%29.jpg?1555089087)

## Prerequisite Guides

If you're new to CircuitPython, take a moment to walk through the following guides to get you started and up-to-speed:

- [Welcome to CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython)
- [PyPortal Introduction Guide](https://learn.adafruit.com/adafruit-pyportal)

## Parts
### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
![Front view of a Adafruit PyPortal - CircuitPython Powered Internet Display with a pyportal logo image on the display. ](https://cdn-shop.adafruit.com/640x480/4116-00.jpeg)

### Part: USB Cable
quantity: 1
USB cable - USB A to Micro-B - 3 foot long
[USB Cable](https://www.adafruit.com/product/592)

You can get both of these and a PyPortal stand in AdaBox 011:

- [Next Page](https://learn.adafruit.com/pyportal-philips-hue-lighting-controller/pyportal-circuitpython-setup.md)

## Featured Products

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
### USB A/Micro Cable - 2m

[USB A/Micro Cable - 2m](https://www.adafruit.com/product/2185)
This is your standard USB A-Plug&nbsp;to Micro-USB cable. It's 2 meters long so you'll have plenty of cord to work with for those longer extensions.

In Stock
[Buy Now](https://www.adafruit.com/product/2185)
[Related Guides to the Product](https://learn.adafruit.com/products/2185/guides)
### Adafruit PyPortal Desktop Stand Enclosure Kit

[Adafruit PyPortal Desktop Stand Enclosure Kit](https://www.adafruit.com/product/4146)
PyPortal is&nbsp;our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Create little pocket universes of joy that connect to something good.

And now that you've made a cool internet-connected project...

In Stock
[Buy Now](https://www.adafruit.com/product/4146)
[Related Guides to the Product](https://learn.adafruit.com/products/4146/guides)
### AdaBox011 - PyPortal

[AdaBox011 - PyPortal](https://www.adafruit.com/product/4061)
Reach out beyond your desk - to the stars and beyond - with **PyPortal**! This ADABOX features a new, easy-to-use IoT device that allows you to customize and create your very own "Internet of Things" portal. We take CircuitPython to the max, pairing a SAMD51 chip with a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4061)
[Related Guides to the Product](https://learn.adafruit.com/products/4061/guides)

## Related Guides

- [Adafruit PyPortal - IoT for CircuitPython](https://learn.adafruit.com/adafruit-pyportal.md)
- [PyPortal US Election Calendar](https://learn.adafruit.com/pyportal-electioncal-us.md)
- [A Logger for CircuitPython](https://learn.adafruit.com/a-logger-for-circuitpython.md)
- [PyPortal Retro Cases](https://learn.adafruit.com/pyportal-retro-compys.md)
- [Adafruit IO Basics: Schedule Actions](https://learn.adafruit.com/adafruit-io-basics-scheduled-triggers.md)
- [CircuitPython Twitter Viewer Using the Twitter API](https://learn.adafruit.com/twitter-api-use.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [PyPortal YouTube Views and Subscribers Display](https://learn.adafruit.com/pyportal-youtube-views-and-subscribers-display.md)
- [PyPortal Event Count-Up Clock](https://learn.adafruit.com/pyportal-event-count-up-clock.md)
- [Daily UV Index PyPortal Display](https://learn.adafruit.com/pyportal-uv-index.md)
- [PyPortal Reddit Stats Trophy](https://learn.adafruit.com/pyportal-reddit-stats-trophy.md)
- [PyPortal IoT Plant Monitor with AWS IoT and CircuitPython](https://learn.adafruit.com/pyportal-iot-plant-monitor-with-aws-iot-and-circuitpython.md)
- [PyPortal Weekly Countdown Clock](https://learn.adafruit.com/pyportal-countdown-clock.md)
- [PyPortal IoT Plant Monitor with Google Cloud IoT Core and CircuitPython](https://learn.adafruit.com/pyportal-iot-plant-monitor-with-google-cloud-iot-core-and-circuitpython.md)
- [PyPortal Hurricane Tracker](https://learn.adafruit.com/pyportal-hurricane-tracker.md)
- [Portable PyPortal](https://learn.adafruit.com/portable-pyportal.md)
