Closed cataseven closed 1 month ago
@cataseven Hi I have fixed the markdown. Please try it
Thank you so mueh. Tested and done.
Reopen after below issue. Please see the 4th flight below
- callsign: NSZ5529
flight_number: D85529
aircraft_registration: null
tracked_type: schedule
state_class: total flights:
@cataseven Yes, the markdown works for this also see this part
...
{% else%}
<ha-icon icon="mdi:airplane"></ha-icon>{{ flight.flight_number }} - {{ flight.callsign }} - {{ flight.tracked_type }}
{% endif%}{% endfor %}
I wrote my own markdown card so I get the bug I think. However for a common solution I wrote this automation.
Maybe you can update your code as "If tracked_type changes from "live" to "schedule" then remove the flight from FlightRadar24 Additional tracked sensor"
alias: Action (Delete Flight Number)
description: ""
triggers:
- event_type: state_changed
trigger: event
conditions:
- condition: template
value_template: >-
{{ trigger.event.data.new_state.domain == 'device_tracker' and
trigger.event.data.new_state.attributes.tracked_type == 'schedule' and
trigger.event.data.old_state.attributes.tracked_type == 'live'}}
actions:
- action: text.set_value
metadata: {}
data:
value: "{{ trigger.event.data.old_state.attributes.flight_number }}"
target:
entity_id: text.flightradar24_remove_from_track
it was requested to add live and schedule flights to track
If any of flights under sensor.flightradar24_additional_tracked returns no data then lovelace card show nothing including the other tracked flights with enough info.
Ex:
Add 4 flights. Lovelace card shows all. If 1 of the flights returns no info (not enough attributes) then also the other 3 flights is not shown on the card.