PiAware monitoring

Nothing fancy, but in case anyone else is interested here is some config to get PiAware status into Home Assistant.

rest:
  - resource: http://piaware/status.json
    scan_interval: 60
    sensor:
      - name: Piaware Status
        value_template: "OK"
        json_attributes:
          - "modes_enabled"
          - "dump978_version"
          - "cpu_load_percent"
          - "site_url"
          - "time"
          - "uat_radio"
          - "piaware"
          - "cpu_temp_celcius"
          - "uat_enabled"
          - "dump1090_version"
          - "adept"
          - "mlat"
          - "piaware_version"
          - "radio"

template:
  - sensor:
      - name: "Piaware Status CPU Load"
        unit_of_measurement: "%"
        state: "{{ state_attr('sensor.piaware_status', 'cpu_load_percent')|float(default=0) }}"
        state_class: 'measurement'
        
      - name: "Piaware Status CPU Temperature"
        unit_of_measurement: "°F"
        state: >
            {%- set c = state_attr('sensor.piaware_status', 'cpu_temp_celcius')|float(default=16) %}
            {{ ((c)*9/5)+32 }}
        device_class: 'temperature'
        state_class: 'measurement'
        
      - name: "Piaware Status 978 Radio"
        state: "{{ state_attr('sensor.piaware_status', 'uat_radio')['status'] }}"
        attributes:
          message: "{{ state_attr('sensor.piaware_status', 'uat_radio')['message'] }}"

      - name: "Piaware Status 1090 Radio"
        state: "{{ state_attr('sensor.piaware_status', 'radio')['status'] }}"
        attributes:
          message: "{{ state_attr('sensor.piaware_status', 'radio')['message'] }}"

      - name: "Piaware Status Daemon"
        state: "{{ state_attr('sensor.piaware_status', 'piaware')['status'] }}"
        attributes:
          message: "{{ state_attr('sensor.piaware_status', 'piaware')['message'] }}"

      - name: "Piaware Status Connection"
        state: "{{ state_attr('sensor.piaware_status', 'adept')['status'] }}"
        attributes:
          message: "{{ state_attr('sensor.piaware_status', 'adept')['message'] }}"

      - name: "Piaware Status MLAT"
        state: "{{ state_attr('sensor.piaware_status', 'mlat')['status'] }}"
        attributes:
          message: "{{ state_attr('sensor.piaware_status', 'mlat')['message'] }}"

I think I’m going to try to pull together a custom component to replace this and add a little polish, but that’s a post for another day.

2 Likes

What are the various radio and MLAT status sensors? The number aircraft currently being received for those methods or?

Do you know if they expose a way to get a list of all tails by distance? It’d be nice to be able to filter by distance and show details for say the 3 closest or within x miles

What are the various radio and MLAT status sensors? The number aircraft currently being received for those methods or?

Right now the radio sensors just show radio health: red for can’t talk to radio, amber for radio’s there but no traffic, and green for radio’s there and there’s traffic. MLAT is the same: is MLAT synced or not.

Do you know if they expose a way to get a list of all tails by distance? It’d be nice to be able to filter by distance and show details for say the 3 closest or within x miles

The aircraft lists are probably too long and complicated for using the simple method I’m using above. For that I think a custom component will be required. I’m working on building the library, but it’s probably going to take awhile.

3 Likes

To track your piaware detected aircrafts, you may use http://<IP:Port PiAware WebUI>/data/aircraft.json

Hey mate, I’m interested in pulling in my piaware into as well, but I’m still a little new to home assistant, is there a certain type of card this is nested into? Or could you share the entire card’s yaml? Thank you so much, excited to add this and sorry if I’m overlooking something!

No specific card. The rest block of code above creates sensor.piaware_* entities. Then you can use standard HA cards to display them. The screenshot I posted above is showing a History Graph Card set to display the entities.

1 Like

Oh, are you adding the above code into your config yaml? Maybe that’s where I just got lost, where to put the code itself. I’ll try config yaml, but let me know if its somewhere else. Thanks for the reply!

EDIT: Got it working, thank you so much!