Invalid config in automation

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

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

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 !

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.

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 !

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.

1 Like

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

Damn. Wish I would have saw this before I bothered replying.

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