Get sensor data from output string?

Hi,
i want to get “value”:“X.X” from the last row ( {“Name”:“Vattentemp”,“Value”:“2.8”,“Heading”:0,“Unit”:“°C”,“Type”:“watertemp”,“Trend”:"",“Msg”:"",“Calm”:0,“Updated”:“2019-02-12 22:20:00”,“StationID”:69,“Quality”:“Ok”,“WaterLevelReference”:null}],“Felmeddelande”:null}} )
from this page
https://services.viva.sjofartsverket.se:8080/output/vivaoutputservice.svc/vivastation/69

I dont think scrape sensor will work and im not sure if sensor sql do either. any ideas?

You can use the Restful Sensor for this.

  - platform: rest
    resource: https://services.viva.sjofartsverket.se:8080/output/vivaoutputservice.svc/vivastation/69
    name: Vattentemp
    value_template: '{{ value_json["GetSingleStationResult"]["Samples"][3]["Value"] }}'

should do it.

1 Like

thanks alot! now i have do read about restful, seems useful :wink: