-
Notifications
You must be signed in to change notification settings - Fork 0
/
otherconfigs.yaml
43 lines (39 loc) · 1.24 KB
/
otherconfigs.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
42
- platform: template
sensors:
time_of_day_greeting:
friendly_name: "Time of Day Greeting"
value_template: >-
{% set hour = now().hour %}
{% if hour < 12 %}
Good Morning
{% elif hour < 18 %}
Good Afternoon
{% else %}
Good Evening
{% endif %}
# Feed Parser base sensor
- platform: feedparser
name: daily_quote_feed
feed_url: 'https://www.brainyquote.com/link/quotefu.rss'
scan_interval:
hours: 24
template:
- sensor:
- name: "Daily Quote"
state: >
{% set feed = states('sensor.daily_quote_feed') %}
{% set entries = state_attr('sensor.daily_quote_feed', 'entries') %}
{% if entries and entries|length > 0 %}
{% set entry = entries|random %}
{{ entry.description if entry.description else "No quote available" }}
{% else %}
No quote available
{% endif %}
attributes:
author: >
{% set entries = state_attr('sensor.daily_quote_feed', 'entries') %}
{% if entries and entries|length > 0 %}
{{ entries[0].title }}
{% else %}
Unknown
{% endif %}