mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Add detail for text file
This commit is contained in:
parent
f3459e1f81
commit
f057ec3ceb
@ -82,6 +82,16 @@ You can see directly in the frontend (**Developer tools** -> **About**) what rel
|
||||
name: HA release
|
||||
```
|
||||
|
||||
### {% linkable_title Read value out of a remote text file %}
|
||||
|
||||
If you own a devices which are storing values in text files which are accessible over HTTP then you can use the same approach as shown in the previous section. Instead of looking at the JSON response we directly grab the sensor's value.
|
||||
|
||||
```yaml
|
||||
- platform: command_line
|
||||
command: python3 -c "import requests; print(requests.get('http://remote-host/sensor_data.txt').text)"
|
||||
name: File value
|
||||
```
|
||||
|
||||
### {% linkable_title Use an external script %}
|
||||
|
||||
The example is doing the same as the [aREST sensor](/components/sensor.arest/) but with an external Python script. It should give you an idea about interacting with devices which are exposing a RESTful API.
|
||||
|
Loading…
x
Reference in New Issue
Block a user