I am wondering why the following substitutions are failing. Context. I have a script which is handling some data and calling an action (service). Evohome.set_zone_override. If I call the script from dev_tools it works fine. The part which is not working is the frontend substitution of the values from the input selectors.
So here is the backend script - as I results in the expected target room temperature change.
alias: heating_override
description: Script to override the default room set point
fields:
target_temperature:
name: target_temperature
description: The desired room temperature
required: true
selector:
number:
min: 5
max: 25
step: 0.5
unit_of_measurement: °C
target_room:
name: target_room
description: The desired room
required: true
selector:
entity:
domain: climate
target_duration:
name: target_duration
description: The desired time period
required: false
selector:
number:
min: 10
max: 1440
step: 10
unit_of_measurement: minutes
sequence:
- action: evohome.set_zone_override
data:
setpoint: "{{ target_temperature }}"
entity_id: "{{ target_room }}"
duration:
minutes: "{{ target_duration }}"
mode: single
Ok, so then hard coding the front end POC code [like] below results in a repeat of the action generated from the dev_tools action. All good.
type: custom:mushroom-chips-card
chips:
- type: entity
entity: sun.sun
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
target: {}
data:
user_id: THIS
size: classic
title: Heating Override?
dismissable: false
timeout: 60000
content:
- name: p_minutes
label: >-
Duration (max 240 [4h]) - leave this blank to override until
next programmed set point.
selector:
number:
max: 240
min: 10
step: 20
- name: p_entity
label: Room Selector
selector:
entity:
include_entities:
- climate.test_room
- climate.test_room1
- climate.test_room2
filter:
domain: climate
- name: p_setting
label: Target Temperature
selector:
number:
min: 16
max: 21
mode: slider
right_button: Ok
right_button_action:
- target:
entity_id: script.heating_override
action: script.turn_on
data:
variables:
target_room: climate.test_room
target_temperature: 16
target_duration: 10
This is what breaks it:
target_room: "{{p_entity}}"
target_temperature: "{{p_setting}}"
target_duration: "{{p_minutes}}"
I am inputting in the selector UI respectively:
climate.test_room
17
10
This is the error:
Failed to perform the action script/turn_on. extra keys not allowed @ data['p_minutes']
It feels like I am miss-coding how the variables are substituted from the input selectors into the script data call variables. I have tried the following two variations, both without success.
target_room: '[p_entity]]'
target_temperature: '[[p_setting]]'
target_duration: '[[p_minutes]]'
target_room: p_entity
target_temperature: p_setting
target_duration: p_minutes
I am hoping someone has some insight or experience to offer on this.