Hi Guys,
Im try to let this work but it won’t work…
this part of a script is not working:
- service: input_text.set_value
target:
entity_id: "input_text.{{ name }}_data"
data:
value: "{{ message }}"
Below is also in same script and works perfect. {{ name }} shows the different sensors im using:
dishwasher_machine, dryer_machine and washer_machine
The {{ message }} is also good.
- service: script.mobile_notify_no_actionable
data:
title: "{{ friendly_name }} is done. binary_sensor.{{ name }}"
message: "{{ message }}"
I have 3 input_text entities:
input_text. dishwasher_machine_data
input_text. dryer_machine_data
input_text. washer_machine_data
When I change the value to: value: TEST and change it to TEST 2 then the action part is working.
It stuck on: value: "{{ message }}"
There is no error in the HA log at all…
Here full script:
utility_notification:
alias: "Notify - Washing/Diskwasher/Dryer Done"
mode: parallel
max: 20
variables:
binary_sensor: "{{ 'binary_sensor.{}'.format(name) }}"
friendly_name: "{{ state_attr(binary_sensor, 'friendly_name') }}"
time_stamp: "{{ as_timestamp(now()) | timestamp_custom('%-H:%M:%S') }}"
sequence:
- variables:
start_time: "{{ as_timestamp(now()) }}"
start_kwh: "{{ state_attr(binary_sensor, 'kwh') }}"
- wait_for_trigger:
platform: template
value_template: "{{ is_state(binary_sensor, 'off') }}"
timeout: "04:00:00"
continue_on_timeout: false
- variables:
end_time: "{{ as_timestamp(now()) }}"
end_kwh: "{{ state_attr(binary_sensor, 'kwh') }}"
total_time: "{{ (end_time - start_time) }}"
minutes: "{{ (total_time / 60) | round(0) }}"
total_kwh: "{{ end_kwh - start_kwh }}"
total_kwh_rounded: "{{ (total_kwh) | round(2) }}"
price: "{{ (0.30 * total_kwh) | round(2) }}"
message: "The {{ friendly_name }} is done after {{ minutes }} minutes and it used {{ total_kwh_rounded }} kWh (Cost: €{{ price }}). (Date: {{ as_timestamp(now())|timestamp_custom('%d-%m-%Y') }}). (Time:{{ as_timestamp(now())|timestamp_custom('%H:%M:%S') }}). binary_sensor.{{ name }}"
# HA NOTIFY
- service: script.mobile_notify_no_actionable
data:
title: "{{ friendly_name }} is done."
message: "{{ message }}"
# HA ALEXA NOTIFY
- continue_on_error: true
service: script.engine_say
data:
media_player: media_player.livingroom
notify: notify.alexa_media_livingroom
message: "The {{ friendly_name }} is done"
- service: input_text.set_value
target:
entity_id: "input_text.{{ name }}_data"
data:
value: "{{ message }}"