LIFX call Morph effect with custom palette from within HA

Just define a rest_command in your configuration.yaml. Example:

rest_command:
  intense:
    url: https://api.lifx.com/v1/lights/YOUR_SELECTOR/effects/morph/
    method: POST
    headers:
      authorization: Bearer YOUR_LIFX_TOKEN
      accept_encoding: 'gzip, deflate'
    content_type: 'application/json'
    payload:  '{"palette": ["hue:300 saturation:1", "hue:164 saturation:1", "hue:248 saturation:1", "hue:242 saturation:0.7"],"power_on": false}'

in YOUR_SELECTOR you should write the selector of the light/lights you want to run the effect on. Selector is the equivalent to entity_id in HA. Example:

    url: https://api.lifx.com/v1/lights/8w8sadsk213/effects/morph/

if you want to run the same effect in more than one light within the same call, they must go comma separated. Example:

    url: https://api.lifx.com/v1/lights/8w8sadsk213,3klmrlfd021/effects/morph/

In YOUR_LIFX_TOKEN you must out your lifx token :).

In order to call the effect in automations/scripts:

  - service: rest_command.intense

If you copy and paste the palette in the above example, you’ll get an almost exact Intense Morph effect

In the payload section you can toy around with the parameters: period, duration, palette, power_on and fast. All the information can be found in the LIFX HTTP API documentation: