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

What is wrong with this template

$
0
0

When it does “work” or have no errors I just keep getting a loading symbol when I check the config. I don’t understand the "expected token ‘,’,’ " part of the error.

- platform: template
    sensors:
      sam_bt:    
        friendly_name: 'Sam BT Beacon'
        value_template: >
          {% if is_state('person.sam', 'home') and
           is_state('sensor.sam_s_beacon', 'not_home') -%}
            Home
          {% elif is_state('person.sam', 'home') and
          is_state('sensor.sam_s_beacon', 'kitchen') -%}
            kitchen
          {% elif is_state('person.sam', 'home') and
           is_state('sensor.sam_s_beacon', 'bedroom') -%}
          bedroom
          {% elif is_state('person.sam', 'home') and
           is_state('sensor.sam_s_beacon', 'living_room') -%}
          Living Room
          {% elif is_state('person.sam', 'home') and
           is_state('sensor.sam_s_beacon', 'east_bedroom') -%}
          East Bedroom
          {% elif is_state('person.sam', 'not_home') and
           is_state('sensor.sam_s_beacon', 'not_home') -%}
          Not Home   
          {%- endif %}
          
  - platform: template
    sensors:
      golf_cart_bt:    
        friendly_name: 'Golf Cart Keys'
        value_template: >
          {% if is_state('device_tracker.golf_cart_keys_e2a7', 'home') and
           is_state('sensor.golf_cart_key_beacon', 'not_home') -%}
            Home
          {% elif is_state('device_tracker.golf_cart_keys_e2a7', 'home') and
          is_state('sensor.golf_cart_key_beacon', 'kitchen') -%}
            kitchen
          {% elif is_state('device_tracker.golf_cart_keys_e2a7', 'home') and
           is_state('sensor.golf_cart_key_beacon', 'bedroom') -%}
          bedroom
          {% elif is_state('device_tracker.golf_cart_keys_e2a7', 'home') and
           is_state('sensor.golf_cart_key_beacon', 'living_room') -%}
          Living Room
          {% elif is_state('device_tracker.golf_cart_keys_e2a7', 'home') and
           is_state('sensor.golf_cart_key_beacon', 'east_bedroom') -%}
          East Bedroom
          {% elif is_state('device_tracker.golf_cart_keys_e2a7', 'away) and
           is_state('sensor.golf_cart_key_beacon', 'not_home') -%}
          Not Home    
          {%- endif %}                      

13 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 106108

Trending Articles



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