Skip to content

Commit 3b001c7

Browse files
DarkFoxfabaff
authored andcommitted
Documentation for scrape sensor attribute option (#3696)
* Documentation for scrape sensor attribute option * Move comment up
1 parent 0ded1ab commit 3b001c7

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

source/_components/sensor.scrape.markdown

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Configuration variables:
3030
3131
- **resource** (*Required*): The URL to the website that contains the value.
3232
- **select** (*Required*): Defines the HTML tag to search for. Check Beautifulsoup's [CSS selectors](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#css-selectors) for details.
33+
- **attribute** (*optional*): Get value of an attribute on the selected tag.
3334
- **name** (*Optional*): Name of the sensor.
3435
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
3536
@@ -67,11 +68,11 @@ sensor:
6768
6869
### {% linkable_title Get a value out of a tag %}
6970
70-
The German [Federal Office for Radiation protection (Bundesamt für Strahlenschutz)](http://www.bfs.de/) is publishing various details about optical radiation including an UV index. This example is getting the index for a region in Germany.
71+
The German [Federal Office for Radiation protection (Bundesamt für Strahlenschutz)](http://www.bfs.de/) is publishing various details about optical radiation including an UV index. This example is getting the index for a region in Germany.
7172
7273
```yaml
73-
sensor:
7474
# Example configuration.yaml entry
75+
sensor:
7576
- platform: scrape
7677
resource: http://www.bfs.de/DE/themen/opt/uv/uv-index/prognose/prognose_node.html
7778
name: Coast Ostsee
@@ -84,11 +85,24 @@ sensor:
8485
If you make heavy use of the [IFTTT](/components/ifttt/) web service for your automations and are curious about the [status of IFTTT](http://status.ifttt.com/) then you can display the current state of IFTTT in your frontend.
8586
8687
```yaml
87-
sensor:
8888
# Example configuration.yaml entry
89+
sensor:
8990
- platform: scrape
9091
resource: http://status.ifttt.com/
9192
name: IFTTT status
9293
select: '.component-status'
9394
```
9495
96+
### {% linkable_title Get the latest podcast episode file URL %}
97+
98+
If you want to get the file URL for the latest episode of your [favourite podcast](https://hasspodcast.io/), so you can pass it on to a compatible media player.
99+
100+
```yaml
101+
# Example configuration.yaml entry
102+
sensor:
103+
- platform: scrape
104+
resource: https://hasspodcast.io/feed/podcast
105+
name: Home Assistant Podcast
106+
select: 'enclosure:nth-of-type(1)'
107+
attribute: url
108+
```

0 commit comments

Comments
 (0)