Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105993

REST sensor.. how to parse json?

$
0
0

Hi… made a api witch spits out a JSON (parsed and checked on various parsers online)
This is my JSON:

{"icao24":"040102","registration":"ET-ASH","manufacturericao":"BOEING","manufacturername":"Boeing","model":"Boeing 787-8","typecode":"B788","serialnumber":"38754","linenumber":"283","icaoaircrafttype":"L2J","operator":"Ethiopian Airlines","operatorcallsign":"ETHIOPIAN","operatoricao":"ETH","operatoriata":"ET","owner":"Ethiopian Airlines","testreg":"","registered":"2015-04-01","reguntil":"","status":"","built":"2015-01-01","firstflightdate":"","engines":"","modes":"false","adsb":"false","acars":"false","notes":"","categoryDescription":"Heavy (> 300000 lbs)"}

My rest sensor is configured like this:

sensor:
  - platform: rest
    ### REST Sensor for AIRPLAN INFO..
    resource: "http://192.168.1.10/minglarn/php/find_aircraft.php?air=040102"
    timeout: 40
    name: aircraft_info
    method: GET
    json_attributes:
      - manufacturericao
      - manufacturername
      - model
      - operator
      - owner
      - registered
      - built

When checking the logs i see:

2022-04-25 01:33:16 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data

But when I do a CURL -X GET i do get the json…
What is wrong here?!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105993

Trending Articles