opened
i00
username_0
<!-- READ THIS FIRST:
  - If you need additional help with this template, please refer to https://www.home-assistant.io/help/reporting_issues/
  - Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/core/releases
  - Do not report issues for integrations if you are using custom components or integrations.
  - Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
  DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## The problem
<!-- 
  Describe the issue you are experiencing here to communicate to the
  maintainers. Tell us what you were trying to do and what happened.
-->
Currently a Numeric State has an entity, and value template.
Entity seems to be required; however it should probably be either a value template or entity required and not both.

The issue I have is that the value template seems to be being ignored altogether and the entity state is being used to trigger < 1 for 5:00 that I have set.

## Environment
<!--
  Provide details about the versions you are using, which helps us to reproduce
  and find the issue quicker. Version information is found in the
  Home Assistant frontend: Developer tools -> Info.
-->

- Home Assistant Core release with the issue: 0.108.1
- Last working Home Assistant Core release (if known): 
- Operating environment (Home Assistant/Supervised/Docker/venv): Docker
- Integration causing this issue: Template
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/template/

## Problem-relevant `configuration.yaml`
<!--
  An example configuration that caused the problem for you. Fill this out even
  if it seems unimportant to you. Please be sure to remove personal information
  like passwords, private URLs and other credentials.
-->

```yaml
N/A
```

## Traceback/Error logs
<!--
  If you come across any trace or error logs, please provide them.
-->

```txt
N/A
```

## Additional information
Numeric state Trigger not working with value template correctly
issue
created
pnbruckner
username_1
Please post the YAML code for the trigger. Your description is too vague.
comment
created
i00
username_0
@username_1 I can't show you the yaml because it won't let me save it...
If you set a "Numeric State" trigger, and just fill out a template it complains that you must have entered data into the above or below fields:
```
Message malformed: must contain at least one of below, above. @ data['trigger'][0]
```
It should be that either above, below OR value template are required.
comment
created
pnbruckner
username_1
@username_0 I think you misunderstanding what the `value_template` optional config parameter does. Normally the state of the entity is compared to the `above` and/or `below` parameters to determine if the trigger should fire. However, sometimes one wants the trigger to compare some other value to `above`/`below`, e.g., an attribute of the entity. This is where the `value_template` comes in. It determines what value to compare to `above`/`below`, _not_ the above & below values.

If you want to use a template for the above/below values, then what you really want to use is a template trigger.
comment
created
i00
username_0
I don't understand what you mean... with templates if it returns true then it triggers generally ... so if the template evaluates to true shouldn't this cause the trigger to fire without requiring a above / below?
comment
created
pnbruckner
username_1
@username_0, no, that's not the purpose of the `value_template` option in the `numeric_state` trigger. As I explained, it's for determining what value should be compared to the `above` and/or `below` parameters. The `value_template` in this case must result in a _numeric value_, not true or false.

Again, if you want a trigger the fires when a template evaluates to `'true'`, then that's the [template trigger](https://www.home-assistant.io/docs/automation/trigger/#template-trigger) that does that.
comment
closed
pnbruckner
username_1
issue