Hi, I have a Christmas tree with three different strings of lights, every 20 minutes I want to make a random selection of 1 - 3 and use it as an input of my choose statement. I have been trying (and yes reading everything I can about variables and random) to get this to work for a couple weeks, I know how to do the every 20 minutes it’s just getting a random number 1-3 into my choose statement that I need help with, your help is greatly appreciated.
Here is what I am trying to get working, getting an error on my value_template statement “Failed to perform the action script/new_script. extra keys not allowed @ data[‘value_template’]”
alias: New Script
sequence:
- action: input_number.set_value
metadata: {}
data:
value_template: “{{ range(1, 3) | random }}”
target:
entity_id: input_number.christmaslight - choose:
- conditions:
- condition: numeric_state
entity_id: input_number.christmaslight
above: 0
below: 2
sequence: - action: persistent_notification.create
metadata: {}
data:
message: “1”
- condition: numeric_state
- conditions:
- condition: numeric_state
entity_id: input_number.christmaslight
above: 1
below: 3
sequence: - action: persistent_notification.create
metadata: {}
data:
message: “2”
- condition: numeric_state
- conditions:
- condition: numeric_state
entity_id: input_number.christmaslight
above: 2
below: 4
sequence: - action: persistent_notification.create
metadata: {}
data:
message: “3”
enabled: true
description: “”
- condition: numeric_state
- conditions: