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

Template with random list of lists

$
0
0

@Versus wrote:

I’m trying to randomize colors for my lamps using automation. But for whatever reason, I am getting

Invalid data for call_service at pos 1: None for dictionary value @ data[‘hs_color’]

The code I’m using is:

- alias: Color time
  trigger:
    platform: time_pattern
    seconds: '/3'
  action:
    service: light.turn_on
    data_template:
      entity_id: >
        light.{{ ['color_lamp_1', 'color_lamp_2', 'floor_lamp'] | random }}
      brightness: 250
      hs_color: >
        [10, {{range(30, 70) | random}}]
      transition: 6

What’s strange is that entity_id is working fine with the same approach, but hs_color gets None.

Any ideas why?

Posts: 11

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



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