Hi i´m new at templating from sensors.
I´m trying to get the right values from a Rest Api. I have managed to connect to the API but now I dont how to extract the values from it.
I f i make a curl command i get the following:
{"VehicleId":66351,"DistanceReports":[{"BusinessDistanceInKilometers":1151.30,"PersonalDistanceInKilometers":36.21,"OtherDistanceInKilometers":2.05,"Period":201801},{"BusinessDistanceInKilometers":1259.11,"PersonalDistanceInKilometers":null,"OtherDistanceInKilometers":null,"Period":201802},{"BusinessDistanceInKilometers":1462.21,"PersonalDistanceInKilometers":null,"OtherDistanceInKilometers":null,"Period":201803},{"BusinessDistanceInKilometers":1774.52,"PersonalDistanceInKilometers":null,"OtherDistanceInKilometers":null,"Period":201804},{"BusinessDistanceInKilometers":1508.66,"PersonalDistanceInKilometers":null,"OtherDistanceInKilometers":null,"Period":201805},{"BusinessDistanceInKilometers":1054.72,"PersonalDistanceInKilometers":null,"OtherDistanceInKilometers":null,"Period":201806}],"FuelReports":[{"BusinessFuelInLiters":80.79,"PersonalFuelInLiters":2.41,"OtherFuelInLiters":0.15,"Period":201801},{"BusinessFuelInLiters":88.28,"PersonalFuelInLiters":null,"OtherFuelInLiters":null,"Period":201802},{"BusinessFuelInLiters":103.02,"PersonalFuelInLiters":null,"OtherFuelInLiters":null,"Period":201803},{"BusinessFuelInLiters":123.48,"PersonalFuelInLiters":null,"OtherFuelInLiters":null,"Period":201804},{"BusinessFuelInLiters":105.49,"PersonalFuelInLiters":null,"OtherFuelInLiters":null,"Period":201805},{"BusinessFuelInLiters":74.25,"PersonalFuelInLiters":null,"OtherFuelInLiters":null,"Period":201806}],"TravelTimeReports":[{"BusinessTravelTimeInMinutes":2488,"PersonalTravelTimeInMinutes":63,"OtherTravelTimeInMinutes":7,"Period":201801},{"BusinessTravelTimeInMinutes":2714,"PersonalTravelTimeInMinutes":null,"OtherTravelTimeInMinutes":null,"Period":201802},{"BusinessTravelTimeInMinutes":3493,"PersonalTravelTimeInMinutes":null,"OtherTravelTimeInMinutes":null,"Period":201803},{"BusinessTravelTimeInMinutes":3344,"PersonalTravelTimeInMinutes":null,"OtherTravelTimeInMinutes":null,"Period":201804},{"BusinessTravelTimeInMinutes":3061,"PersonalTravelTimeInMinutes":null,"OtherTravelTimeInMinutes":null,"Period":201805},{"BusinessTravelTimeInMinutes":2101,"PersonalTravelTimeInMinutes":null,"OtherTravelTimeInMinutes":null,"Period":201806}],"CO2Reports":[{"BusinessCO2InGrams":221042.22,"PersonalCO2InGrams":6951.71,"OtherCO2InGrams":393.30,"Period":201801},{"BusinessCO2InGrams":241751.68,"PersonalCO2InGrams":null,"OtherCO2InGrams":null,"Period":201802},{"BusinessCO2InGrams":280733.42,"PersonalCO2InGrams":null,"OtherCO2InGrams":null,"Period":201803},{"BusinessCO2InGrams":340703.06,"PersonalCO2InGrams":null,"OtherCO2InGrams":null,"Period":201804},{"BusinessCO2InGrams":289660.57,"PersonalCO2InGrams":null,"OtherCO2InGrams":null,"Period":201805},{"BusinessCO2InGrams":202501.65,"PersonalCO2InGrams":null,"OtherCO2InGrams":null,"Period":201806}],"IdleTimeReports":[{"BusinessIdleTimeInMinutes":891,"PersonalIdleTimeInMinutes":28,"OtherIdleTimeInMinutes":1,"Period":201801},{"BusinessIdleTimeInMinutes":1019,"PersonalIdleTimeInMinutes":null,"OtherIdleTimeInMinutes":null,"Period":201802},{"BusinessIdleTimeInMinutes":1455,"PersonalIdleTimeInMinutes":null,"OtherIdleTimeInMinutes":null,"Period":201803},{"BusinessIdleTimeInMinutes":1112,"PersonalIdleTimeInMinutes":null,"OtherIdleTimeInMinutes":null,"Period":201804},{"BusinessIdleTimeInMinutes":976,"PersonalIdleTimeInMinutes":null,"OtherIdleTimeInMinutes":null,"Period":201805},{"BusinessIdleTimeInMinutes":662,"PersonalIdleTimeInMinutes":null,"OtherIdleTimeInMinutes":null,"Period":201806}]}
How do I format the value template if I want let¨s say PersonalDistanceInKilometers?
Sorry for my bad english…