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

Why are these trigger based binary templates 'unknown'

$
0
0

using:

template:

  - trigger:
      - platform: time_pattern
        hours: 0
        minutes: 0
      - platform: event
        event_type: homeassistant_start
      - platform: event
        event_type: event_template_reloaded

    binary_sensor:

      - unique_id: zomertijd_binary
        name: Zomertijd
        picture: /local/season/summer.png
        state: >
          {{now().timetuple().tm_isdst == 1}}

      - unique_id: wintertijd_binary
        name: Wintertijd
        picture: /local/season/winter.png
        state: >
          {{now().timetuple().tm_isdst == 0}}

      - unique_id: christmas_time
        name: Christmas time
        state: >
          {% set today = now().day %}
          {% set month = now().month %}
          {{month == 12 and today >= 24 or month == 1 and today <= 2}}
        icon: >
          mdi:{{iif(is_state('binary_sensor.christmas_time','on'),'string-lights','pine-tree')}}

    sensor:

      - unique_id: utc_offset
        name: Utc offset
        state: >
          {{now().utcoffset().total_seconds()/3600}}
        icon: >
          {% set offset = now().utcoffset().total_seconds()/3600 %}
          mdi:numeric-{{offset|int|abs}}

# many more sensors here

only the binary_templates show up as unknown, all other sensors, and sensors using another set of triggers before this are correct.

I moved all of these from being perfectly functional state based template sensors to the trigger based section, and have made sure there are no _2 suffixes, or .template_ variants because of that move :wink:

and as far as I can see compliant with the examples just above Template - Home Assistant

must be going blind. What am I missing here?
please have a look? thanks!

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105498

Trending Articles



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