Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
Last active July 18, 2023 15:23
Show Gist options
  • Save TheGroundZero/6942de79c45e143608f3cad26553a93f to your computer and use it in GitHub Desktop.
Save TheGroundZero/6942de79c45e143608f3cad26553a93f to your computer and use it in GitHub Desktop.
Display DAREBEE daily challenge on Home Assistant dashboard
---
# Create an image entity showing the DAREBEE daily challenge
#
# https://www.home-assistant.io/integrations/image/
# https://darebee.com/daily
# https://sequr.be/blog/2023/07/darebee-daily-challenge-on-home-assistant-dashboard/
#
scrape:
- resource: https://darebee.com/
scan_interval: 3600 # Every hour
sensor:
- name: Darebee daily challenge
unique_id: darebee_daily
icon: mdi:weight-lifter
select: "#exercise > div:nth-child(1) > p:nth-child(1) > a:nth-child(1) > img:nth-child(1)"
attribute: src
value_template: "https://darebee.com{{ value }}" # E.g. https://darebee.com/images/exercise/2023/july10.gif
template:
- image:
- name: Darebee daily challenge
unique_id: darebee_daily_img
icon: mdi:weight-lifter
url: "{{ states('sensor.darebee_daily_challenge') }}"
# On HA Dashboard:
cards:
- type: picture
image_entity: image.darebee_daily_challenge
alt_text: Darebee Daily Challenge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment