Nanoleaf in 2019

Hi everyone, I just installed a nanoleaf in my bedroom and everything is really nice.
Home assistant detected the device straight from the integration menu, and I quickly added an automation to switch on/off nanoleaf at the same time as my hue lights. Works great.

But, I’m having trouble to apply a scene to nanoleaf.
I tried this code for hue and nanoleaf (sorry I’m french):

    scene_fraise_on:
      alias: Scène fraise
      sequence:
        - service: hue.hue_activate_scene
          data:
            group_name: 'Godefroy'
            scene_name: 'Fraise'
        - service: light.turn_on
          data:
            entity_id: light.nanoleaf_light_panels_55_7d_00
            brightness: 35
            effect: 'Fraise'

It works with hue, But for nanoleaf, it only switches on the lights, and ignore the brightness and the effect (of course the effect name is the same name on the nanoleaf app).
No error appears in the home assistant console.

I checked the documentation on this site, but a lot of it is dated.
I am also aware of this plugin:
Plugin nanoleaf

So here are my questions :

  1. for those of you who uses nanoleaf lights, do you use the native plugin, or a specific one?
  2. If you use a specific one, do you need to remove the native integration first?
  3. If you use the native, what is the proper code to change a scene and adapt the brightness?

Any help would be greatly appreciated.
Thank you for reading so far.

Hello everyone, I found a solution.
I did it manually.

First I declared two shell commands in the configuration file.

shell_command:
  nanoleaf_brightness: "curl -X PUT -H \"Content-Type: application/json\" -d '{\"brightness\" : {\"value\":{{ brightness }} }}' \"http://192.168.0.XXX:16021/api/v1/XXX_TOKEN_XXX/state/\""
  nanoleaf_scene: "curl -X PUT -H \"Content-Type: application/json\" -d '{\"select\" : \"{{ scene }}\"}' \"http://192.168.0.XXX:16021/api/v1/XXX_TOKEN_XXX/effects/\""

You need to open the port 16021 in your firewall.

Then you can use the commands in a script like this:

    start_party:
      sequence:
        - service: shell_command.nanoleaf_scene
          data:
            scene: 'Streaking Notes'
        - service: shell_command.nanoleaf_brightness
          data:
            brightness: 95

It is really fast.
I hope it helps someone.

Very helpful! Works great. Thanks.

1 Like