Skip to content

Instantly share code, notes, and snippets.

@AdamQuixote
Last active April 6, 2025 12:25
Show Gist options
  • Save AdamQuixote/763833fb2c122a85645009d8d30c147f to your computer and use it in GitHub Desktop.
Save AdamQuixote/763833fb2c122a85645009d8d30c147f to your computer and use it in GitHub Desktop.
Home Assistant markdown card quote of the day
# 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