Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105611

Input_select not able to use templating for initial value

$
0
0

Hi All,
Just seeking clarification that the initial value in a input_select cannot use jinja2 templating for a response.

I have a input_select:

ground_hvac_climate_mode:
  name: Ground HVAC Climate Mode
  options:
    - 'Off'
    - Heat
    - Cool
  initial: Heat
  icon: mdi:sun-snowflake-variant

When I use the input select as:

ground_hvac_climate_mode:
  name: Ground HVAC Climate Mode
  options:
    - 'Off'
    - Heat
    - Cool
  initial: |
    {% for now().month in [4,5,6,7,8,9,10] %}
      Heat
    {% else %}
      "Off"
    {% endif %}
  icon: mdi:sun-snowflake-variant

then the system generates an error
Logger: homeassistant.config
Source: config.py:942
First occurred: 10:57:27 (1 occurrences)
Last logged: 10:57:27

Invalid config for ‘input_select’ at input_selects/hvac.yaml, line 9: initial state {% if now().month in [4,5,6,7,8,9,10] %} Heat {% else %} “Off” {% endif %} is not part of the options: Off,Heat,Cool for dictionary value ‘input_select->ground_hvac_climate_mode’, got {‘name’: ‘Ground HVAC Climate Mode’, ‘options’: [‘Off’, ‘Heat’, ‘Cool’], ‘initial’: ‘{% if now().month in [4,5,6,7,8,9,10] %}\n Heat\n{% else %}\n “Off”\n{% endif %}\n’, ‘icon’: ‘mdi:sun-snowflake-variant’}, please check the docs at Input select - Home Assistant

So no jinja templating for initial value is allowed? Am I doing something wrong?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105611

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>