Categories
General Tech IoT

Using Nanoleaf Devices with Home Assistant – Including Setting Effects

Here’s some examples of how to use Nanoleaf lights with Home Assistant. Note that when this doc was written I was using Home Assistant v2021.2 with Nanoleaf firmware v5.0.0

Setting Up

First, set up the lights using the Nanoleaf app, join them to your WiFi, etc.

Then attach them to Home Assistant. The docs on the integration page explain how to do this:

https://www.home-assistant.io/integrations/nanoleaf/

Using the Nanoleaf Light

Once set up, the Nanoleaf is a standard light type in Home Assistant. The “Light” integration page has a bunch of information on how to use the light:

https://www.home-assistant.io/integrations/light/

One of the main purposes of the Nanoleaf devices is all the unique effects that you can put on the light panels. Nanoleaf calls these “Scenes” but Home Assistant calls them “effects”

Installing and Discovering Effects

To get some effects installed, you can use the official Nanoleaf app, which will let you browse through the Discover tab and find lots of interesting effects. Make sure to install them onto your device, using the little download button.

Once installed, you can use Home Assistant to activate the effects. The easiest way I have found to get a list of the effect names is to use the developer tools page to get the states from the device:

screenshot of nanoleaf states

Using the Effects

To activate the effects from Home Assistant you need to use the “Call Service” action. To start, you can test in the Developer Tools. Here’s an example of turning on the lights to the “Vintage Modern” effect at 25% brightness:

turning on Nanoleaf lights to 25% brightness, Vintage Modern effect

Once you have found what you want, you can use that service call in a script/automation:

You can also put some buttons in your Dashboard. To make a horizontal stack of buttons I found I needed to use the YAML editor for the card:

type: horizontal-stack
cards:
  - type: button
    entity: light.triangles
    tap_action:
      action: call-service
      service: light.turn_on
      service_data:
        entity_id: light.triangles
        effect: Vibrant Sunrise
    name: Vibrant Sunrise
  - type: button
    entity: light.triangles
    tap_action:
      action: call-service
      service: light.turn_on
      service_data:
        entity_id: light.triangles
        effect: Cheer Up Emo Kid
    name: Cheer Up Emo Kid

This will make this card:

Other Useful Links

I found a great python library for controlling the Nanoleaf devices in a custom script:

https://github.com/MylesMor/nanoleafapi

The dev who made this library has a forum post here:

https://forum.nanoleaf.me/forum/aurora-open-api/python-wrapper-for-api

Questions? Comments? Want help trying to use your Nanoleaf lights with Home Assistant? Drop a comment here or send me a message: https://jaytuckey.name/about/

2 replies on “Using Nanoleaf Devices with Home Assistant – Including Setting Effects”

Thanks, this was helpful, got super confused by this and HomeKit with home assistant.

The Nanoleaf was discovered automatically, but in states there are no effects listed, any idea why?

A few ideas come to mind:
Have you installed some “Scenes” from the Nanoleaf app? The scenes are what show up as effects.

Does your nanoleaf device have a “effect_list” entry in the developer tools?

Is the entity you are looking at in Home Assistant definitely the Nanoleaf one, not the HomeKit one, if the HomeKit one is there.

Leave a Reply

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