Hi,
I used to have a REST based sensor reading some weather data from a weather station very near to my home. This sensor worked before - however, I installed HA on a new machine, and I deliberately wanted to recreate most of my HA config. And for some reason, I do not get this sensor running again.
Here’s my code in sensors.yaml:
- platform: rest
name: upb_json_wetter
resource: <the URL>
value_template: "OK"
scan_interval: 300
json_attributes:
- temperatur
- luftdruck
- luftfeuchte
- windgeschwindigkeit
- windgrad
- platform: template
sensors:
upb_json_wetter_temperatur:
friendly_name: "UPB-Wetter - Temperatur"
value_template: '{{ states.sensor.upb_json_wetter.attributes["temperatur"] }}'
unit_of_measurement: "°C"
device_class: "temperature"
upb_json_wetter_luftdruck:
friendly_name: "UPB-Wetter - Luftdruck"
value_template: '{{ states.sensor.upb_json_wetter.attributes["luftdruck"] }}'
unit_of_measurement: "hPa"
device_class: "pressure"
upb_json_wetter_luftfeuchtigkeit:
friendly_name: "UPB-Wetter - Luftfeuchtigkeit"
value_template: '{{ states.sensor.upb_json_wetter.attributes["luftfeuchte"] }}'
unit_of_measurement: "%"
device_class: "humidity"
upb_json_wetter_windgeschwindigkeit:
friendly_name: "UPB-Wetter - Windgeschwindigkeit"
value_template: '{{ states.sensor.upb_json_wetter.attributes["windgeschwindigkeit"] }}'
unit_of_measurement: "km/h"
upb_json_wetter_windrichtung:
friendly_name: "UPB-Wetter - Windrichtung"
value_template: '{{ states.sensor.upb_json_wetter.attributes["windgrad"] }}'
unit_of_measurement: "°"
Under Developer tools/States, I can see the five sensors upb_json_wetter_(temperatur|luftdruck|...)
, but they all are unavailable. However, I can’t see the upper sensor upb_json_wetter
. If I open the resource URL, my browser shows the JSON as expected, so that’s apparently not the problem.
Any idea of what I’m doing wrong? How can I check whether the REST call is done? Do I have to do anything in particular to “enable” the REST platform?
Thanks in advance
Christian