vormsty
(Vormsty)
November 5, 2020, 12:22am
1
Hello, i have an message in the log that the config is invalid.
When I check the config withe the validating tool, the config is valid.
When I reload automation I have the follwing detail message:
Logger: homeassistant.config
Source: config.py:415
First occurred: 19:16:58 (1 occurrences)
Last logged: 19:16:58
Invalid config for [automation]: [value_template] is an invalid option for [automation]. Check: automation->value_template. (See ?, line ?).
How can I found the error ??
is this good:
trigger:
platform: time
at: “07:30:00”
value_template: “{{ sensor.dining_room_temp }}”
below: 19.5
Thanks for your help !
Regards
123
(Taras)
November 5, 2020, 12:44am
2
vormsty:
is this good:
No.
You have created an invalid trigger. The Time Trigger doesn’t support value_template
or below
.
If you want the automation to be triggered at 07:30
or when the dining room temperature is below 19.5
then you can use a Time Trigger and a Numeric State Trigger.
- platform: time
at: '07:30:00'
- platform: numeric_state
entity_id: sensor.dining_room_temp
below: 19.5
vormsty
(Vormsty)
November 5, 2020, 12:50am
3
ok thanks a lot.
so, I will have the time tigger to trigg many times:
trigger:
- platform: time
at: "07:30:00"
- platform: time
at: "07:00:00"
and for condions, I will check if at 7:30 the temperature is below 19.5 and at 7h if the temperature is below 19:
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.save_electricity
state: 'off'
- condition: state
entity_id: input_boolean.home_presence_state
state: 'on'
- condition: or
conditions:
- condition: template
value_template: " "
- condition: template
value_tempalte: ""
Can you please write me an template exemple for testing the time and a temperature (sensor.dining_room_temp)
Many thanks in advance !
jazzyisj
(Jason)
November 5, 2020, 12:57am
4
Why do you need a template trigger? You’re overcomplicating this.
You’re testing for time. Use a time condition. You’re testing for temperature. It’s a number. Use a numeric_state condition. Actual examples for both of these are provided in the docs.
vormsty
(Vormsty)
November 5, 2020, 1:02am
5
thanks.
It’s a curve: I need the action if the time is 7:30 and the temperature is below 19,5 or if the time is 7:00 and the temperature is below 19.
In reality, I have one point every 30’ .
So, there a couple of ‘or’ conditions, each of conditions as a time and a temperature
Thanks for your help !
123
(Taras)
November 5, 2020, 1:08am
6
I now realize I answered one of your previous questions that had a very similar requirement to trigger at multiple times and check if the temperature is below a threshold. This seems like the exact same request!
I provided two ways to do it but you never replied.
Simply create a file containing multiple automations.
Sometimes it’s much simpler to create and maintain multiple short and simple automations rather than attempt to consolidate it into a single long and complex automation.
Each short automation can call a script and pass it the desired temperature.
- alias: 'Scheduled Temperature 05:30'
trigger:
- platform: time
at: '05:30:00'
condition:
- condition: state
entity_id: sensor.temperature
below: 17.7
action:
…
1 Like
jazzyisj
(Jason)
November 5, 2020, 1:18am
7
This is template to check if the temp is below 19 at 07:00 or below 19.5 at 07:30.
- condition: template
value_template: >
{{ (is_state('sensor.time','07:00') and states('sensor.dining_room_temp')|float < 19)
or (is_state('sensor.time','07:30') and states('sensor.dining_room_temp')|float < 19.5) }}"
You could do it without a template like this.
- condition: or
conditions:
- condition: and
conditions:
- condition: time
after: '06:59:00'
before: '07:01:00'
- condition: numeric_state
entity_id: sensor.dining_room_temp
below: 19
- condition: and
conditions:
- condition: time
after: '07:29:00'
before: '07:31:00'
- condition: numeric_state
entity_id: sensor.dining_room_temp
below: 19.5
jazzyisj
(Jason)
November 5, 2020, 1:21am
8
Damn. Wish I would have saw this before I bothered replying.
vormsty
(Vormsty)
November 5, 2020, 1:43am
9
Thanks a lot for your help.
I have no more error and learn a bit about how to write automation…
Best regards
Thierry
2 Likes