tambyq
(Tam)
May 18, 2022, 9:02am
1
Newbie here!
I am looking if it’s possible to change the value of helper “text” from something to something else when automation is triggered.
For Example, When Automation A is triggered the value in the helper will be “That happened” and when Automation B is triggered later, the value will switch to " this happened"
would appreciate if someone can help me knowing how to achieve this
1 Like
tobi-bo
(Tobi Bo)
May 18, 2022, 10:00am
2
Hi, you can call the set_value
service with the entity_id and value, you want to set.
1 Like
pedolsky
(Pedolsky)
May 18, 2022, 10:18am
3
You can also use the automation_triggered
event:
trigger:
- platform: event
event_type: automation_triggered
event_data:
entity_id: automation.do_something_a
- platform: event
event_type: automation_triggered
event_data:
entity_id: automation.do_something_ b
condition: []
action:
- service: input_text.set_value
data:
value: |
Automation {{ trigger.event.data['name'] }} ({{trigger.event.data['entity_id'] }}) has been triggered
target:
entity_id: input_text.target
Output:
Automation Do something A (automation.do_something_a) has been triggered
1 Like
pdwonline
(When a goat is on the net)
May 12, 2023, 2:20pm
4
This type or helper is clear. But how can I set a value of a template sensor/helper? And can I even set an attribute value?
pedolsky
(Pedolsky)
May 12, 2023, 4:47pm
5
Do you mean something like this?
I don’t know how to handle different float defaults, otherwise you can shorten it a bit:
template:
- sensor:
- name: Thermostat Target
unique_id: thermostat_target_202211232124
icon: mdi:fire
state: |-
{% set target = states('input_select.thermostat_target') %}
{{ states(target)|float(22) }}
Or prettified:
input_select:
thermostat_target_prettified:
name: Thermostat Target
options:
- Loggia
- Eingang
- Küche
…