Skip to content

Instantly share code, notes, and snippets.

View scheidtdav's full-sized avatar

David Scheidt scheidtdav

View GitHub Profile
@scheidtdav
scheidtdav / configuration.yaml
Last active October 25, 2020 12:15
Home Assistant RESTful Sensor for Covid-19 Numbers (Germany only)
# This snippet is using the RKI (www.rki.de) backend to retrieve
# the 'Inzidenzzahl' (number of new Covid cases in the last 7 days per 100k citizens) for your city/ region.
# To use it, scroll all the way to the right of the resource and fill in your latitude and longitude.
# The api should be able to find your position and retrieve the correct value.
- platform: rest
name: "Inzidenzzahl [YOUR CITY]"
resource: https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?outFields=OBJECTID,cases7_per_100k,GEN,last_update,BL&geometryType=esriGeometryPoint&spatialRel=esriSpatialRelWithin&inSR=4326&outSR=4326&f=json&geometry=[LONGITUDE],[LATITUDE]
method: GET
value_template: '{{ value_json.features[0].attributes.cases7_per_100k | round(2) }}'
unit_of_measurement: 'people'