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

Help with Trigger template not working

$
0
0

@noysboy wrote:

I am trying to get a light to turn off after x mins of no motion, but x changes depending on time of day.

Here is the code i have:

  trigger:
  - platform: template
    value_template: "{%- if '06:00' < states.sensor.time.state < '11:00' %}
  device_id: 6113733bf8574759ae0faaa32bcf0b8e
  domain: binary_sensor
  entity_id: binary_sensor.motion_x04_lower_level_motion
  for:
    hours: 0
    minutes: 1
    seconds: 0
  platform: device
  type: no_motion{%- elif '19:00' < states.sensor.time.state
  < '22:00' %}
  device_id: 6113733bf8574759ae0faaa32bcf0b8e
  domain: binary_sensor
  entity_id: binary_sensor.motion_x04_lower_level_motion
  for:
    hours: 0
    minutes: 15
    seconds: 0
  platform: device
  type: no_motion {%- else %}
  device_id: 6113733bf8574759ae0faaa32bcf0b8e
  domain: binary_sensor
  entity_id: binary_sensor.motion_x04_lower_level_motion
  for:
    hours: 0
    minutes: 5
    seconds: 0
  platform: device
  type: no_motion {% endif %}"

The developer tools template checks out and I dont get any errors in the UI/File editor…but it also does not work. The trigger never fires. Any help would be appreciated.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 99113

Trending Articles



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