-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.yaml
39 lines (35 loc) · 1.44 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Choose which sensor type(s) - this first one is simple and relies only on simple sensors or derivative sensors
- sensor:
- name: LED Clock Data
unique_id: led_clock_data
state: "OK"
attributes:
# The numbered attributes (0 to 9) are info screens
1:>
{%- if states('sensor.inside_temperature') not in ['unavailable', 'unknown'] -%}
{{ states('sensor.inside_temperature') | float | round(0) }}~C
{%- endif %}
# This style is for a sensor that relies on at least one service call (ie. for weather) - you can still use simple/derivative sensors
- trigger:
- platform: time_pattern
minutes: /5
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.openweathermap_hourly
response_variable: hourly
sensor:
- name: LED Clock Data
unique_id: led_clock_data
state: "OK"
attributes:
# The numbered attributes (0 to 9) are info screens
0: >
to{{ hourly["weather.openweathermap_hourly"].forecast[0].temperature | round(0) | default('NA') }}
1:>
{%- if states('sensor.inside_temperature') not in ['unavailable', 'unknown'] -%}
ti{{ states('sensor.inside_temperature') | float | round(0) }}
{%- endif %}
# Note that for 1: Inside temperature, it checks to see if it is available, otherwise it is blank - and the clock will skip over blanks!