Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions source/_components/sensor.scrape.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Configuration variables:
- **authentication** (*Optional*): Type of the HTTP authentication. Either `basic` or `digest`.
- **username** (*Optional*): The username for accessing the website.
- **password** (*Optional*): The password for accessing the website.
- **headers** (*Optional*): Headers to use for the web request

## {% linkable_title Examples %}

Expand Down Expand Up @@ -130,3 +131,23 @@ sensor:
unit_of_measurement: "öre/kWh"
```
{% endraw %}

### {% linkable_title BOM Weather %}

The Australian Bureau of Meterology website returns an error if the User Agent header is not sent.

{% raw %}
```yaml
# Example configuration.yaml entry
sensor:
- platform: scrape
resource: http://www.bom.gov.au/vic/forecasts/melbourne.shtml
name: Melbourne Forecast Summary
select: ".main .forecast p"
value_template: '{{ value | truncate(255) }}'
# Request every hour
scan_interval: 3600
headers:
User-Agent: Mozilla/5.0
```
{% endraw %}