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

Struggling with template trigger

$
0
0

@sparkydave wrote:

If I use the following template in the dev panel, it works, but it doesn’t trigger my automation.

- alias: 'Salt lamp auto OFF with phones'
    trigger:
      - platform: time
        at: '21:00:00'
      - platform: template
        value_template: "{{ state_attr('sensor.daves_s7_battery_level', 'is_charging') }}"   ### Dave's S7 on charge?
    condition:
      - condition: time
        after: '21:00:00'
      - condition: template
        value_template: "{{ state_attr('sensor.daves_s7_battery_level', 'is_charging') }}"   ### Dave's S7 on charge?
    action:
      - service: light.turn_off
        entity_id: light.salt_lamp

Can someone please explain what I’m doing wrong?

I tried changing the template to:
value_template: "{{ is_state_attr('sensor.daves_s7_battery_level', 'is_charging') }}"

…based on the docs but that doesn’t work in the dev panel

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



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