Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95437

Help with scripts and parameters

$
0
0

@xalex75 wrote:

Hi.
I’m trying to use my living room light as a notification for various events, by flashing different colors.

For testing I setup an automation that calls a script when an input_boolean is triggered, and passes the rgb color to the script.
Nothing happens. I tried to put/remove brackets etc. but I didn’t find the correct syntax.

automation:

- id: accendi_lampeggiante_interno
  alias: accendi lampeggiante interno
  trigger:
    - platform: state
      entity_id: input_boolean.lampeggiante_interno
      from: 'off'
      to: 'on'
  action:
    - service: script.lampeggia_ikea_colore_1x
      data_template:
        color: [0,255,0]

script:

lampeggia_ikea_colore_1x:
  sequence:
    - service: light.turn_on
      data_template:
        entity_id: light.0x000d6ffffe688544_light 
        brightness: 255
        rgb_color: "{{ color }}"
    - delay:
        milliseconds: 600
    - service: light.turn_off
      data:
        entity_id: light.0x000d6ffffe688544_light
    - delay:
        milliseconds: 600

The original idea was that the automation calls a script passing the color, and this script calls the abobe script 3 times, repassing to it the same color parameter, and so flashing 3 times.
But first I must make the direct script call working with the parameter…
Can someone help me?
Thanks.

Posts: 11

Participants: 5

Read full topic


Viewing all articles
Browse latest Browse all 95437

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>