Slowly dim lights?

how to slowly dim lights?

Use the transition option in the light.turn_on service

https://www.home-assistant.io/integrations/light/#service-lightturn_on

This is great for scripting, however, I’m hoping to find a way to get the Google Assistant Integration to smooth the transition for verbally requested changes to brightness and color. I have a feeling this isn’t possible and actually is being taken care of on the Lifx Cloud side.
Google Assistant (Cloud) to Lifx Cloud is trash, so I’m staying on HA regardless lol.

Write a script and call it from your voice assistant.

like this? in configuration.yaml

alias: slaap langzaam uit
sequence:
  - service: light.turn_off
    domain: light
    entity_id: light.lampen_slaapkamer
data:
      brightness: 0
      transition: 18

Like this:

alias: slaap langzaam uit
sequence:
  - service: light.turn_off
    target:
      entity_id: light.lampen_slaapkamer
    data:
      brightness: 0
      transition: 18

Component error: alias - Integration ‘alias’ not found.
Component error: sequence - Integration ‘sequence’ not found.

Like this:

- alias: slaap langzaam uit
  sequence:
    - service: light.turn_off
      target:
        entity_id: light.lampen_slaapkamer
      data:
        brightness: 0
        transition: 18

were to put it?

It’s a script. So…

Under script: in your configuration.yaml file or if your configuration.yaml file contains this:

script: !include scripts.yaml

then it goes in the scripts.yaml file (do not put the line scripts: in this file).

Or you can use the GUI to create it.

Incorrect type. Expected “object”.

if i put it in the scripts.yamlscript

script

in the UI

Actually I had it right the first time. Scripts are a dictionary not a list, but like this:

slaap_langzaam_uit:
  sequence:
    - alias: 'slaap langzaam uit'
      service: light.turn_off
      target:
        entity_id: light.lampen_slaapkamer
      data:
        brightness: 0
        transition: 18

now i get this

Visuele editor wordt niet ondersteund voor deze configuratie:

  • Sleutel “alias” wordt niet verwacht of ondersteund door de visuele editor.

Je kan nog steeds de configuratie in YAML bewerken.

Ok so the editor does not support an alias. You need an alias to be able to call the script from your voice assistant. You have two options:

  1. Just use the YAML mode of the editor.

  2. Delete the alias from the script and use customize to give your script a friendly_name.

now i get this error
Message malformed: extra keys not allowed @ data[‘sequence’][0][‘customize’]

sequence:
  - customize: slaap langzaam uit
    service: light.turn_off
    target:
      entity_id: light.lampen_slaapkamer
    data:
      brightness: 0
      transition: 60
mode: single

Please read the customize link I posted. It does not go there.

Tom, I know all about calling scripts from GA, what I wasn’t clear in my description about I guess is the fact I want non scripted commands for percentage and color change to have this transition. I don’t think writing a 100 scripts plus ones for color changes is a viable answer.

I believe lifx cloud must have a global change transition variable that smooths all voice assistant commands. Trying to see if there is a way to pass GA percentage or color variables to a script within HA for a change.

Btw, in your script code the reason alias isn’t working is indentation and the ‘-’ . Here is an example of a working script for calling a custom lifx cloud scene:

alias: It's Movie Time
sequence:
  - service: scene.turn_on
    target:
      entity_id: scene.movie_time
mode: restart