I am running a local SkyAware instance and I would like to track aircraft in Home Assistant in order to correlate other sensor readings. Other use cases are identifying aircraft that we can see.
SkyAware provides a json blob of aircraft
http://<IP ADDRESS>:8080/data/aircraft.json
{ "now" : 1625240909.2,
"messages" : 21637,
"aircraft" : [
{"hex":"3c71a1","flight":"BCS954 ","alt_baro":38000,"alt_geom":38800,"gs":495.2,"track":218.6,"baro_rate":0,"squawk":"6334","emergency":"none","category":"A5","nav_qnh":1012.8,"nav_altitude_mcp":38016,"lat":44.975006,"lon":-78.402100,"nic":8,"rc":186,"seen_pos":31.1,"version":2,"nic_baro":1,"nac_p":9,"nac_v":1,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"mlat":[],"tisb":[],"messages":287,"seen":0.7,"rssi":-22.1},
{"hex":"c01066","flight":"NDL654 ","alt_baro":25000,"alt_geom":25200,"gs":250.2,"track":57.1,"geom_rate":64,"squawk":"0552","emergency":"none","category":"A1","lat":44.258330,"lon":-77.722711,"nic":9,"rc":75,"seen_pos":0.9,"version":2,"nic_baro":0,"nac_p":10,"nac_v":2,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"mlat":[],"tisb":[],"messages":56,"seen":0.9,"rssi":-20.3},
{"hex":"ab7265","category":"A1","version":2,"sil_type":"perhour","mlat":[],"tisb":[],"messages":75,"seen":94.6,"rssi":-22.2},
{"hex":"c02fe7","flight":"ACA607 ","alt_baro":30000,"alt_geom":30350,"gs":465.0,"track":237.9,"baro_rate":0,"category":"A3","nav_qnh":1013.6,"nav_altitude_mcp":24000,"nav_heading":251.7,"lat":44.676695,"lon":-77.419181,"nic":8,"rc":186,"seen_pos":8.7,"version":2,"nic_baro":1,"nac_p":10,"nac_v":2,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"mlat":[],"tisb":[],"messages":308,"seen":8.6,"rssi":-16.6},
{"hex":"c05a0e","flight":"NDL876 ","alt_baro":27000,"alt_geom":27275,"gs":254.8,"track":58.8,"geom_rate":-64,"squawk":"2217","emergency":"none","category":"A1","lat":44.522644,"lon":-77.270312,"nic":9,"rc":75,"seen_pos":0.5,"version":2,"nic_baro":1,"nac_p":10,"nac_v":2,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"mlat":[],"tisb":[],"messages":1773,"seen":0.5,"rssi":-14.6},
{"hex":"c035bb","alt_baro":31000,"alt_geom":31350,"gs":498.3,"track":69.9,"baro_rate":-64,"category":"A3","version":2,"nac_v":2,"sil_type":"perhour","mlat":[],"tisb":[],"messages":2199,"seen":52.6,"rssi":-22.5},
{"hex":"c06c95","flight":"NSTAR2 ","alt_baro":1550,"alt_geom":1400,"gs":187.0,"track":232.8,"baro_rate":-256,"squawk":"0207","emergency":"none","category":"A1","lat":44.075938,"lon":-77.499782,"nic":9,"rc":75,"seen_pos":3.7,"version":2,"nic_baro":1,"nac_p":10,"nac_v":2,"sil":3,"sil_type":"perhour","gva":2,"sda":3,"mlat":[],"tisb":[],"messages":772,"seen":0.0,"rssi":-21.8},
{"hex":"43c173","flight":"RRR6657 ","alt_baro":35000,"alt_geom":35650,"gs":464.2,"track":53.7,"geom_rate":0,"squawk":"5745","emergency":"none","category":"A5","nav_qnh":1013.6,"nav_altitude_mcp":35008,"nav_heading":51.3,"nav_modes":["althold","tcas"],"lat":45.447327,"lon":-76.389640,"nic":10,"rc":25,"seen_pos":15.7,"version":2,"nic_baro":1,"nac_p":10,"nac_v":2,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"mlat":[],"tisb":[],"messages":1112,"seen":2.7,"rssi":-21.2},
{"hex":"a37e05","category":"A2","version":2,"sil_type":"perhour","mlat":[],"tisb":[],"messages":2861,"seen":151.6,"rssi":-21.3},
{"hex":"c0882f","category":"A1","version":2,"sil_type":"perhour","mlat":[],"tisb":[],"messages":2082,"seen":278.5,"rssi":-21.7}
]
}
New aircraft appear and disappear frequently. I have tried creating a single rest sensor
- platform: rest
name: SkyAware
resource: http://10.0.0.109:8080/data/aircraft.json
method: GET
scan_interval: 60
But the json blob is too long
Invalid state encountered for entity ID: sensor.skyaware. State max length is 255 characters.
What are some other options and what is the best practice for storing information like this? Is there a way to create a new sensor for each aircraft that appears? Is this an anti pattern? My googling is failing so any direction would be useful.
Cheers Team!