Nanoleaf API problem

Hi All,

I had to do a hard reset on my Nanoleaf. Now did the 5 seconds push to get a new API key.
Add this key in my YAML File.

In HA I see a light.nanoleaf but when I want to turn it on. I get this error in log:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pynanoleaf/", line 189, in _request
  File "/usr/local/lib/python3.7/site-packages/requests/", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/", line 564, in async_request_call
    await coro
  File "/usr/local/lib/python3.7/concurrent/futures/", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nanoleaf/", line 208, in turn_on
    self._light.on = True
  File "/usr/local/lib/python3.7/site-packages/pynanoleaf/", line 85, in on
    self._put("state", {"on": {"value": value}})
  File "/usr/local/lib/python3.7/site-packages/pynanoleaf/", line 219, in _put
    self._request(path, 'PUT', data)
  File "/usr/local/lib/python3.7/site-packages/pynanoleaf/", line 197, in _request
    raise NanoleafError("Bad Request sent") from e
pynanoleaf.pynanoleaf.NanoleafError: Bad Request sent

When I hit the link I het this JSON response.


Can someone tell me whats going on?

turned on the Nanoleaf in Homekit. After that again with HA and now its working normal.