So, just having the card is enough?
The README still says that a sensor:
is required, and the cards error out without it, hence the question.
Dank je wel!
So, just having the card is enough?
The README still says that a sensor:
is required, and the cards error out without it, hence the question.
Dank je wel!
Ah crap. Update incoming
0.3.3 Did not fix it for me (tried complete reinstall of the card as well, including several reboots)
- type: custom:formulaone-card
card_type: next_race
# sensor: sensor.formula_one_sensor_races
title: Volgende race
date_locale: nl
image_clickable: true
- type: custom:formulaone-card
card_type: last_result
# sensor: sensor.formula_one_sensor_last_result
title: Laatste race
- type: custom:formulaone-card
card_type: driver_standings
# sensor: sensor.formula_one_sensor_drivers
title: Stand coureurs
standings:
show_flag: true
show_team: true
- type: custom:formulaone-card
card_type: constructor_standings
# sensor: sensor.formula_one_sensor_constructors
title: Stand constructeurs
- type: custom:formulaone-card
card_type: schedule
# sensor: sensor.formula_one_sensor_races
title: Volgende races
date_locale: nl
previous_race: hide
Let me know if I can help testing - you can find me at Discord (official HA channel or the two major NL channels, Dutch Domotics / Home Assistant Addicts)
edit:
in the source of the compiled package, the error is still defined. Did the compile go well?
Recompiled it and new version released
Always using the latest versionâŚ
EDIT: Yes, now is workingâŚ
So we donât need anymore the - platform: formulaone_api in sensor.yaml?
Indeed and you can uninstall the integration in hacs
For who used the data from the API for notifications for example.
I use a REST sensor.
The rest sensor:
- platform: rest
scan_interval: 86400
resource_template: https://ergast.com/api/f1/{{ now().strftime('%Y') }}.json
sensor:
- name: "F1 Schedule"
json_attributes_path: "$.MRData"
value_template: "OK"
json_attributes:
- "total"
- "RaceTable"
The sensor for exposing the data:
platform: template
sensors:
formula_one_next_race:
friendly_name: 'Formula One Next Race'
unique_id: 'formula_one_next_race'
attribute_templates:
data: >-
{% set data = namespace(found=False) %}
{% for race in state_attr("sensor.f1_schedule", "RaceTable").Races if data.found == false -%}
{% set datetime = ((race.date + 'T' + race.time) | as_datetime) -%}
{%- if datetime > now() -%}
{{ race }}
{% set data.found = true %}
{%- endif %}
{%- endfor %}
race_name: >-
{%- if 'data' in this.attributes -%}
{{ this.attributes.data.raceName }}
{%- endif %}
race_start: >-
{%- if 'data' in this.attributes -%}
{{ ((this.attributes.data.date + 'T' + this.attributes.data.time) | as_datetime) }}
{%- endif %}
first_practice: >-
{%- if 'data' in this.attributes -%}
{{ ((this.attributes.data.FirstPractice.date + 'T' + this.attributes.data.FirstPractice.time) | as_datetime) }}
{%- endif %}
second_practice: >-
{%- if 'data' in this.attributes -%}
{{ ((this.attributes.data.SecondPractice.date + 'T' + this.attributes.data.SecondPractice.time) | as_datetime) }}
{%- endif %}
third_practice: >-
{%- if 'data' in this.attributes -%}
{{ ((this.attributes.data.ThirdPractice.date + 'T' + this.attributes.data.ThirdPractice.time) | as_datetime) }}
{%- endif %}
qualifying: >-
{%- if 'data' in this.attributes and 'Qualifying' in this.attributes.data -%}
{{ ((this.attributes.data.Qualifying.date + 'T' + this.attributes.data.Qualifying.time) | as_datetime) }}
{% else %}
-
{%- endif %}
sprint: >-
{%- if 'data' in this.attributes and 'Sprint' in this.attributes.data -%}
{{ ((this.attributes.data.Sprint.date + 'T' + this.attributes.data.Sprint.time) | as_datetime) }}
{% else %}
-
{%- endif %}
value_template: >-
on
Most of the if statements are to prevent warnings when HA boots. The sensor isnt available from the start
Other option, itâs a faster option, is to use ics_calender integration and use calendar automations
Is there an option to reduce the size of the track image?
I tried this
style: |
img {
width: 35%;
}
But also effects the flag image
No build in option no, does image:first help?
Thanks for the tip. I used the follow CSS and it works!
style: |
img:nth-child(2){
width: 35%;
}
I do not maintain the API. But as I have mentioned earlier. The card isnt dependent on the API anymore
didnât realize, thanks for that: implemented today and didnât go through the whole thread
Like most people do haha. Its ok
But itâs now fetching from a site, isnât that also shutting down now?
Api integration will go away , but the backing service too if i read this well, or is the source for this card now completely different ( then I missed something completely)
I use the source of the API directly. So no caching of the API in between
This wont only make the card independent, it will also open up the possibility for more functionality
the ergast.com API does not mention anything about shutting down. I think it is⌠some elaborate wording of the custom_component owner talking about servers etc.
TL;DR; Nothing to worry.
Exactly!