Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106323

Scrape: Random index?

$
0
0

Hi everyone,

I’m trying to cast a random wallpaper to my chromecasts with no luck.

I successfuly configure a script to cast a sensor value containing the url but the problem is I can’t randomize the item selection

This is my scrape sensor

  - platform: scrape
    resource: https://wallpaper.dog/coolest-gaming-wallpapers
    name: scrape2
    select: "div[data-fullimg]"
    attribute: id
    index: 5
    value_template: '{{ "https://wallpaper.dog/large/" ~ value ~ ".jpg" }}'

Is there any way of using a random index without messing with pyhton?

Sry I’m a begginer and a non english speaker… be patient with me xD

PS: Just in case… this is my script (Initial)

'1649893800180':
  alias: Nuevo script
  sequence:
  - service: media_player.play_media
    target:
      entity_id: media_player.cocina
    data:
      media_content_id: '{{ states(''sensor.scrape2'') }}'
      media_content_type: image/jpeg
  mode: single

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106323

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>