Hello folks,
I 'm trying to create a restful sensor that can get the watertemprature from the Ocean. The goverment has placed some sensors in the ocean and it has an rest API. First I got problems with the result beeing longer than 256-charters. So I got the data using a dummy template. Now I’m struggling with creating sensors from the data I collected.
My configuration.yaml look like this:
- platform: rest
name: csensor
resource: "https://as-weu-sandefjordsc-api.azurewebsites.net/api/watertemperaturemeasurements/8966e800000001be"
value_template: 'ok'
json_attributes:
- SensorMeasurements
- platform: template
sensors:
granholmen_measurment:
value_template: '{{ state_attr("sensor.cstate", "SensorMeasurements")["Measurement"] }}'
device_class: temperature
entity_id: sensor.cstate
unit_of_measurement: '°C'
The result from the csensor look like this:
But the temperatur sensor look like this:
Do anyone know how the write the value_template so I can get the attribute “measurement” as a the value of a temperature sensor?