Last active
April 6, 2025 12:25
-
-
Save AdamQuixote/763833fb2c122a85645009d8d30c147f to your computer and use it in GitHub Desktop.
Home Assistant markdown card quote of the day
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml - insert into home assistant configuration.yaml, then dev tab>check configuration && restart | |
sensor: | |
- platform: rest | |
name: Daily Quote | |
resource: https://zenquotes.io/api/today | |
method: GET | |
scan_interval: 86400 # Update once per day | |
value_template: "{{ value_json[0].q }}" | |
json_attributes: | |
- q | |
- a | |
# begin markdown, insert into markdown card on dashboard | |
## 🌟 Quote of the Day | |
{% if state_attr('sensor.daily_quote', 'q') and state_attr('sensor.daily_quote', 'a') %} | |
> "{{ state_attr('sensor.daily_quote', 'q') }}" | |
— [{{ state_attr('sensor.daily_quote', 'a') }}](https://en.wikipedia.org/wiki/Special:Search?search={{ state_attr('sensor.daily_quote', 'a') | urlencode }}) | |
{% else %} | |
> "No quote available today." | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment