-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.yaml
41 lines (37 loc) · 1.67 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
40
41
# Choose which sensor type(s) - this first one is simple and relies only on simple sensors or derivative sensors
- sensor:
- name: LED PixelClock Data
unique_id: led_pixelclock_data
state: "OK"
attributes:
# The numbered attributes (0 to 9) are info screens
0: "₿ ₩{{ (states('sensor.bitcoin_price')|int/1000000) | round(0) | default('NA') }}M"
1:>
{%- if states('sensor.inside_temperature') not in ['unavailable', 'unknown'] -%}
In {{ states('sensor.inside_temperature') | float | round(1) }}°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 PixelClock Data
unique_id: led_pixelclock_data
state: "OK"
attributes:
# The numbered attributes (0 to 9) are info screens
0: "₿ ₩{{ (states('sensor.bitcoin_price')|int/1000000) | round(0) | default('NA') }}M"
1:>
{%- if states('sensor.inside_temperature') not in ['unavailable', 'unknown'] -%}
In {{ states('sensor.inside_temperature') | float | round(1) }}°C
{%- endif %}
2: >
Out {{ hourly["weather.openweathermap_hourly"].forecast[0].temperature | round(0) | default('NA') }}°C
# 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!