Are there any plans on expanding the nanoleaf core integration? At the moment i use a restcommand to control my individual element panels on my nanoleaf setup. this works but is a pain to setup in automations. It would be great if the integration has a detection build in which gets all the panel id’s and sets them up as individual lights in home assistant or groups them in the integration so that they can be individually controlled.
at the moment this is my rest command:
nanoleaf:
url: http://192.168.178.86:16021/api/v1/hih87hn076565rfv7/effects
method: PUT
payload: >
{ "write" : {"command": "display", "animType": "static", "animData":
{%- set all = [ 36776, 40379, 39889, 47065, 62644, 56943, 44929, 4212, 50749, 42705, 55753, 9801, 2975, 5181, 59276, 33852, 34713, 42845 ] %}
{%- set ns = namespace(panels=[panels | count | string]) %}
{%- for panel in panels %}
{%- set ns.panels = ns.panels + [ '{} 1 {} {} {} 0 20'.format(all[panel.number-1], panel.r, panel.g, panel.b) ] %}
{%- endfor %}
"{{ ns.panels | join(' ') }}",
"loop": false, "palette": [], "colorType": "HSB"}
}
content_type: 'application/json'
i can control the individual lights by putting this in the automation:
- id: '1618492041197'
alias: Nanoleaf post
description: ''
trigger:
- platform: state
entity_id: input_select.post
to: Er is post
condition:
- condition: state
entity_id: input_boolean.niet_storen
state: 'off'
action:
- service: scene.create
data:
scene_id: nanoleaf_voordat
snapshot_entities:
- light.woonkamer_nanoleaf
- service: rest_command.nanoleaf
data:
panels:
- number: 1
r: 100
g: 0
b: 100
- number: 2
r: 0
g: 0
b: 0
mode: single
With this i can set panel 1 to 18 to have a specific color on the R,G and B spectrum the number goes from 0 to 255 and with this i can set the brightness as wel. Setting R to 125 is half brightness red and R 255 is full brightness.
Maybe this can help the person who build this in expanding the integration. The panels do have all the open api support to implement all the panels individually. There is an api call to get all the panel id’s and with the code i provided these panels can be set to have a specific color and brightness. So in theory it should be possible to expand the integration and let HA add all the panels as individual lights.