yes, thanks!
and this (current) template:
- service: rest_command.set_hue_rule
data:
type: rules
id: 1
data: >
{% set schedule = states('sensor.master_bedroom_schedule') %}
{% set alarm = states('sensor.alarmclock_wd_time') %}
{"conditions":[{"address":"/config/localtime","operator":"in","value":"T{{alarm}}:00/{{schedule.split('/')[1]}}"},
{"address":"/sensors/48/state/presence","operator":"eq","value":"true"},
{"address":"/sensors/48/state/presence","operator":"dx"},
{"address":"/sensors/83/state/status","operator":"lt","value":"1"},
{"address":"/sensors/49/state/dark","operator":"eq","value":"true"}] }
would then translate to:
- service: rest_command.set_hue_rule
data:
type: rules
id: 1
data:
conditions: >
{% set schedule = states('sensor.master_bedroom_schedule') %}
{% set alarm = states('sensor.alarmclock_wd_time') %}
[{"address":"/config/localtime","operator":"in","value":"T{{alarm}}:00/{{schedule.split('/')[1]}}"},
{"address":"/sensors/48/state/presence","operator":"eq","value":"true"},
{"address":"/sensors/48/state/presence","operator":"dx"},
{"address":"/sensors/83/state/status","operator":"lt","value":"1"},
{"address":"/sensors/49/state/dark","operator":"eq","value":"true"}]
? Struggling a bit with the variables that are set in the beginning of the template.
this doesnt work:
sequence:
service: rest_command.set_hue_command
data:
command: config
type: sensors
data:
sensitivity: >
{% set mapper =
{'Low':'0',
'Medium':'1',
'High':'2'} %}
{% set state = states('input_select.select_hue_sensitivity') %}
{% set sensitivity = mapper[state] if state in mapper %}
{{sensitivity}}
coming from:
sequence:
service: rest_command.set_hue_command
data:
command: config
type: sensors
data: >
{% set mapper =
{'Low':'0',
'Medium':'1',
'High':'2'} %}
{% set state = states('input_select.select_hue_sensitivity') %}
{% set sensitivity = mapper[state] if state in mapper %}
{"sensitivity": {{sensitivity}} }
thing is, I need the value to be the full line including the embracing braces and double quotes, just like it is posted here: