Created
May 8, 2017 21:35
-
-
Save mattsches/34c33673d9b1b69b8969fa777f1cd8ca to your computer and use it in GitHub Desktop.
Beispiel für RESTful Sensor in Home Assistant zur Abfrage des luftdaten.info API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensor: | |
- platform: rest | |
resource: http://api.luftdaten.info/v1/sensor/1777 | |
value_template: > | |
{% if value_json is sequence %} | |
{% set sensor = value_json | last %} | |
{% else %} | |
{% set sensor = value_json %} | |
{% endif %} | |
{% for sdv in sensor.sensordatavalues %} | |
{% if sdv.value_type == "P1" %} | |
{{ sdv.value | int }} | |
{% endif %} | |
{% endfor %} | |
unit_of_measurement: "µg/m³" | |
name: "PM10" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment