Giter Club home page Giter Club logo

hass-prixcarburant's People

Contributors

adorem avatar albi24 avatar aohzan avatar bsegault avatar damsper avatar gloird avatar max5962 avatar nin2jardin avatar nonobzh29 avatar overnuts avatar ryann72 avatar sabjul33 avatar submarcos avatar tikismoke avatar vingerha avatar yvrogne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hass-prixcarburant's Issues

Cannot calculate days between last update

Describe the bug
Since a couple of days, I get a lot Cannot calculate days between last update, every 30s.
I also have an automation to reload the prices every hour. I don't think it's related but here it is:

trigger:
  - platform: time_pattern
    hours: "*"
condition: []
action:
  - service: button.press
    data: {}
    target:
      entity_id: button.prix_carburant_refresh_prices
mode: single

Configuration

- platform: prix_carburant
  stations:
    - 33610005
    - 33600006 
    - 33600009
    - 33600001
    - 33700024
    - 33700001
    - 33600011
    - 33260011
    - 33470001
    - 33470003
    - 33380004

Expected behavior
Not getting spammed by these warnings

Screenshots
If applicable, add screenshots to help explain your problem.

Debug logs

2023-11-24 10:09:02.762 DEBUG (MainThread) [custom_components.prix_carburant.tools] Load stations names from local file stations_name.json
2023-11-24 10:09:02.794 INFO (MainThread) [custom_components.prix_carburant] Init stations data from yaml list
2023-11-24 10:09:02.794 DEBUG (MainThread) [custom_components.prix_carburant.tools] Call https://data.economie.gouv.fr/api/explore/v2.1/catalog/datasets/prix-des-carburants-en-france-flux-instantane-v2/records API to retrieve station data
2023-11-24 10:09:02.795 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33610005
2023-11-24 10:09:02.815 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33600006
2023-11-24 10:09:02.835 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33600009
2023-11-24 10:09:02.855 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33600001
2023-11-24 10:09:02.876 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33700024
2023-11-24 10:09:02.899 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33700001
2023-11-24 10:09:02.923 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33600011
2023-11-24 10:09:02.953 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33260011
2023-11-24 10:09:02.973 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33470001
2023-11-24 10:09:02.998 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33470003
2023-11-24 10:09:03.032 DEBUG (MainThread) [custom_components.prix_carburant.tools] Search station ID 33380004
2023-11-24 10:09:03.050 DEBUG (MainThread) [custom_components.prix_carburant.tools] Call https://data.economie.gouv.fr/api/explore/v2.1/catalog/datasets/prix-des-carburants-en-france-flux-instantane-v2/records API to retrieve fuel prices
2023-11-24 10:09:03.050 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33610005: Intermarché Cestas
2023-11-24 10:09:03.072 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33600006: Esso Alouette
2023-11-24 10:09:03.089 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33600009: Relais Haut Leveque
2023-11-24 10:09:03.107 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33600001: Geant Casino
2023-11-24 10:09:03.126 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33700024: Relais Merignac Somme
2023-11-24 10:09:03.147 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33700001: Carrefour Merignac
2023-11-24 10:09:03.164 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33600011: Relais Cap De Bos
2023-11-24 10:09:03.185 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33260011: E.Leclerc La Teste De Buch
2023-11-24 10:09:03.210 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33470001: undefined
2023-11-24 10:09:03.232 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33470003: Super U
2023-11-24 10:09:03.253 DEBUG (MainThread) [custom_components.prix_carburant.tools] Update fuel prices for station id 33380004: Leclerc Mios
2023-11-24 10:09:03.275 DEBUG (MainThread) [custom_components.prix_carburant] Finished fetching prix_carburant data in 0.225 seconds (success: True)
2023-11-24 10:09:03.277 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.277 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.278 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.278 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.279 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.279 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.280 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.280 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.281 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.281 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.282 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.283 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.284 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.284 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.285 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.285 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.285 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.286 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.286 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.287 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.287 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.287 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.288 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.288 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.290 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.290 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.291 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.291 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.291 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.292 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.292 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.292 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.293 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.293 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.294 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.296 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:03.296 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.317 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.317 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.317 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.318 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.318 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.318 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.318 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.318 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.318 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.319 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.320 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.320 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.320 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.320 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.320 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.320 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.321 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.322 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.322 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.322 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.322 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.322 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.322 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.323 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update
2023-11-24 10:09:33.323 WARNING (MainThread) [custom_components.prix_carburant.sensor] Cannot calculate days between last update

no data After restart ha

Hi, m'y bug IS After restart ha all station data "indisponible".

For résolve bug : delete manually config in intégration > station > delete config of station.
And créate a New research of station.

I've a lateast version of intégration and ha.

My entity send message :
Cette entité n'est plus fournie par l'intégration prix_carburant. Si l'entité n'est plus utilisée, supprimez-la depuis les paramètres.

Afficher le nom + la ville au lieu de l'ID

Je pense que si le nom de la station etait systématiquement la marque +la ville (Comme Auchan La Queue), ça aiderait à l'utilisation.
La j'ai du mal à identifier qui est qui.
2024-04-16_22-36

Mise a jour du code pour HA 2023.3

Bonjour @Aohzan @vingerha ,
suite à la mise à jour vers la version 2023.2, j'ai ces logs qui apparaissent:

Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for prix_carburant using this method at custom_components/prix_carburant/__init__.py, line 10: hass.config_entries.async_setup_platforms(entry, PLATFORMS)

Je suis ne pas developpeur expérimenté mais je pense qu'il ne s'agit que d'un changement de fonction sur la ligne mentionnée.

Serait-il possible de mettre l'extension à jour afin d'éviter des futures erreurs lors de la MAJ vers 2023.3 ?

Merci !

Error setting up entry Prix Carburant for prix_carburant

Bonjour,

Depuis quelques temps cette extension ne fonctionne plus chez moi, j'ai cette erreur :

Error setting up entry Prix Carburant for prix_carburant Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/prix_carburant/__init__.py", line 10, in async_setup_entry hass.config_entries.async_setup_platforms(entry, PLATFORMS) AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

Une idée de ce qui pose problème ?

Absence de logo Auchan

Bonjour,

Je remarque que le logo de Auchan n'apparaît pas.
Le chemin utilisé est File not found: /v1/AUTH_mw/wikipedia-commons-local-public.aa/a/aa/Auchan-A.svg

Merci pour le travail réalisé !

Known issue: station details outdated

The details of the stations are derived from a file, see link below
This file is not maintained and has not been updated since years, as a result your stations may show an old name or no name at all.
dd. 30/6/2022 there seems to be no other centralized solution providing the same data in manageable format.
This remains open issue until such a solution is provided by the French government or if someone (else) takes provides a workaround.

Suggestions are welcome

https://static.data.gouv.fr/resources/prix-des-carburants-en-france/20181117-111538/active-stations.csv

Error Prix carburant <-> Watchman

Describe the bug
L'integration Watchman report un message de sensor absent :

person.me | missing | custom_components/prix_carburant/services.yaml:9
Comment faut il traiter la ligne pour que cette (mini) erreur n'apparaisse plus ? Par défaut un '#' ??

Peut être faut il préciser à quoi sert cette ligne pour les NewBee comme moi : )

Merci

Petites demandes d'ameilloration

Bonjour

Cette nouvelle version est vraiment pratique !
2 petites demandes pour la prochaine version si possible

  • ajout du logo "Auchan" dans sensor.py - j'ai chargé un logo sur Wikipedia Communs (https://upload.wikimedia.org/wikipedia/commons/4/4f/Auchan_A.svg) mais il y a peut-être mieux...

  • dans sensor.py, ligne 109, j'ai enlevé le "Station" dans le "station name" car je trouve que "Auchan Plaisir E10" suffit (plutôt que "Station Auchan Plaisir E10")

Merci encore pour tout le travail!

Afficher les stations même en l'absence de données

Is your feature request related to a problem? Please describe.
Avec les pénuries dans mon secteur en ce moment, certaines stations ne renvoient pas de données, car ne proposent plus de carburant.
Elle ne s'affichent donc plus sur la carte (ça encore ce n'est pas gênant), mais dans le dashboard ça met des "undefined" de partout.
Exemple :
undefined

Sur mobile ça a pour conséquence que le tableau dépasse sur la droite de la carte.

Describe the solution you'd like
Est-t-il possible d'afficher les stations (elles sont spécifiées dans la config yaml) même en l'absence de données ?
Quitte à afficher du vide, "N/A", ou "Erreur" pour le prix et la dernière update.

localisation des stations

Bonjour
es qu'il est possible que la localisation des station service ce fasse par rapport a la localisation du telephone ou est installe l'app mobile de ha ?
On a dans instagration mobile de ha ce sensor sensor.XXXXXXX_XXXXX_7a_geocoded_location qui peut faire office de localisation.

Passage au flux instantané v2

Après les recherches d'Emeraude998, il semblerait que le jeu de données du site web https://donnees.roulez-eco.fr/opendata/instantane ne sera bientôt plus maintenu

Selon le site www.data.gouv.fr, il faudrait passer à la version v2 améliorée : https://www.data.gouv.fr/fr/datasets/prix-des-carburants-en-france-flux-instantane

Cela demande de reprendre l'API des requêtes et l'extraction des données.


After Emeraude998's research, it appears that the dataset from the website https://donnees.roulez-eco.fr/opendata/instantane will soon no longer be maintained.

According to the website www.data.gouv.fr, it is necessary to switch to the improved v2 version: https://www.data.gouv.fr/fr/datasets/prix-des-carburants-en-france-flux-instantane

This requires revising the API requests and data extraction.

Configuration fails after the last update (3.5.3) with HACS

Describe the bug
All my sensor are "indisponible" since the last update. The configuration fail.

Configuration
From UI

Expected behavior
The integration share the price

Screenshots
image

image

Debug logs
image

Paste debug logs here

Enregistreur: homeassistant.config_entries
Source: config_entries.py:551
S'est produit pour la première fois: 13:55:13 (3 occurrences)
Dernier enregistrement: 13:56:11

Error setting up entry Prix Carburant for prix_carburant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/__init__.py", line 58, in async_setup_entry
    await tool.init_stations_from_location(
  File "/config/custom_components/prix_carburant/tools.py", line 145, in init_stations_from_location
    response_count = await self._request_api(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/tools.py", line 89, in _request_api
    raise PrixCarburantToolRequestError(
custom_components.prix_carburant.tools.PrixCarburantToolRequestError: API request error 404: {'error_code': 'NotFoundResource', 'message': 'The requested dataset prix-carburants-flux-instantane-v2 does not exist.'}

Platform error: sensor

Logger: homeassistant.config
Source: config.py:873
First occurred: 09:57:38 (1 occurrences)
Last logged: 09:57:38

Platform error: sensor - Integration 'prixCarburant' not found.

Updated multi entity row template

Hi,

Here is an updated version of the multi entity row template, maybe this can help someone :)

type: custom:auto-entities
card:
  type: entities
filter:
  template: |-
    {% for state in states.sensor -%}
      {%- if state.entity_id | regex_match("sensor.station\_.*\_e10", ignorecase=True) -%}
        {{
          {
          'entity': state.entity_id,
          'name': state.attributes.friendly_name.split()[1:-1] | join(" "),
          'type': "custom:multiple-entity-row",
          'entities': [
            {
              'entity': state.entity_id,
              'name': False
            },
          ],
          'attribute': 'days_since_last_update'
          }
        }},
      {%- endif -%}
    {%- endfor %}

Display prices on map

Is your feature request related to a problem? Please describe.
When I am on Home Assistant maps,
I can easily see carburant prices for any station icon.

Describe the solution you'd like
Add a way to show price on map, based on lowest price available in the station.

image

A second integration of this feature could also colorize the price color to easily know wich type of carburant it is.

Implement svg can be better maybe.

Additional context
This idea come from another HA integration called "Carbu.com", but I prefer yours :P
Here a quick preview from Carbu.com:
image

Missing configurations

Hi
Will you add in your GitHub all the configurations described in the Vingerha original GitHub ?
There are all necessary
Regards
Philippe

faire un sensor

Bonjour, j'ai trouvée comment faire et si tu veut tu modifier la doc pour que tout le monde puissi faire la meme chose que moi .
alors déjà on peut faire un virtuel avec une varaible
`template:

  • trigger:
    • platform: time_pattern
      minutes: /1
      action:
    • service: prix_carburant.find_nearest_stations
      data:
      distance: 10
      entity_id: device_tracker.XXXXX.XXX # metre id de la personne a suivre
      fuel: Gazole # metre les type de carburant
      response_variable: whatever # la variable
      sensor:
    • name: test_stations # le mon du sensor
      unique_id: test_stations # id du sensor
      state: "{{ now().isoformat() }}"
      attributes:
      stations: "{{ whatever.stations }}" # metre la variable avec. station

`
Apres tu redemare ha et tu a un nouveau sensor

resultat gazoil

Maitemant une carte, j'ai prix la flex

gazol gazol

Et le code de la carte

`type: custom:flex-table-card
title: Christophe
clickable: true
sort_by: state
max_rows: 20
entities:
include: sensor.test.stations
columns:

  • name: nom station
    data: stations
    modify: x.name
  • name: prix
    data: stations
    modify: x.price
    suffix: €
  • name: adresse station
    data: stations
    modify: x.address
    align: left
    suffix: J
    css:
    tbody tr:nth-child(odd): 'background-color: rgba(255, 255, 255, 0.2)'
    tbody tr:nth-child(even): 'background-color: rgba(255, 255, 255, 0.1)'
    card_mod:
    style: |`

voila c'est tout, il y a vingerha qui ma aidée aussi, je te remerci d'avoir lu ce poste et je suis a ta disposition si tu veut des info suplemantaire

Le logo pour Carrefour Market n'apparaît pas

Bonjour, je remarque que le logo de Carrefour Market n'apparaît pas. Dans le fichier sensor.py ligne 132, le lien vers le svg n'existe pas. Par contre le lien ligne 131 pour les autres Carrefour est correct.
Perso je vais utiliser le lien de la ligne 131.
PS : Merci pour le travail accompli :)

Error after an update HA

Hello

I have this error since update core assistant :

Enregistreur: homeassistant.config_entries
Source: config_entries.py:551
S'est produit pour la première fois: 20:17:16 (2 occurrences)
Dernier enregistrement: 20:17:32

Error setting up entry Prix Carburant for prix_carburant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/__init__.py", line 50, in async_setup_entry
    await tool.init_stations_from_list(
  File "/config/custom_components/prix_carburant/tools.py", line 114, in init_stations_from_list
    response = await self._request_api(
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/tools.py", line 89, in _request_api
    raise PrixCarburantToolRequestError(
custom_components.prix_carburant.tools.PrixCarburantToolRequestError: API request error 404: {'error_code': 'NotFoundResource', 'message': 'The requested dataset prix-des-carburants-en-france-flux-instantane-v2 does not exist.'}

Manque icone Leclerc

Pour la station 62138005 il manque l'icone
c'est une station leclerc
j'ai survolé les issues précédentes, j'ai bien vu auchan et carrefour mais pas leclerc

(ha 24.4.2 - prixcarbu 3.5.2)

Readme update & retenu des statistiques

Bonjour Matthieu,

2 petites choses :

Crois tu qu'il serait possible de corriger et d'ajouter cette fonctionnalité ?

Merci,
Thierry

Toutes petites choses

Bonjour et merci pour tout travail,

Les images des stations sont disponibles et tu as rajouté celle d'Auchan récemment, peux tu rajouter celle de Netto et Casino à l'occasion, merci bien

Some station name contain address

Hello,

With some gaz station in flex-table-card i got some address

type: custom:flex-table-card
clickable: true
sort_by: state
max_rows: 2
title: Carburant
entities:
  include: sensor.station*sp95
columns:
  - name: Station
    data: name
    icon: mdi:gas-station
  - name: SP95 €/L
    data: state
  - name: ' '
    data: updated_date
    align: right
css:
  tbody tr:nth-child(odd): 'background-color: rgba(255, 255, 255, 0.2)'
  tbody tr:nth-child(even): 'background-color: rgba(255, 255, 255, 0.1)'
  tbody tr:nth-child(1): 'color: #00ff00'
  tbody tr:nth-child(2): 'color: #FF0000'
card_mod: null
style: |
  :host {
    font-size: 13px;
    /*border-radius: 10px;
    border-style: solid;
    border-width: 2px 2px 0px 2px;
    border-color: #ffffff;*/
  }

And the result look like this :

image

I the dev panel the name and address are ine the field name, if you want to test here the id of the station : 29196001

entities not updating

hi, my entities are not updating (unless i reboot ha)

screenshot295

- platform: prix_carburant stations: - xxxxxxxxx - xxxxxxxxx

do you know what can i do ?

thanks

Passage au flux instantané v2

J'utilise l'intégration Prix Carburant depuis maintenant plus de 4 mois et n'ai pas eu de souci d'ici à cette semaine.
Toutes les entités qui avaient été trouvées (56 stations et plus d'une centaine d'entités) sont devenues Unavailable.
Recharger l'intégration n'aide pas et redemarrer mon instance de Home Assistant ne fait rien non plus.

Dans les logs, je trouve les erreurs suivantes :

2023-10-01 05:00:00.112 ERROR (MainThread) [custom_components.prix_carburant.sensor] Error requesting prix_carburant data: HTTP Error 502: Bad Gateway
2023-10-01 05:00:00.113 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up prix_carburant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/prix_carburant/sensor.py", line 103, in async_setup_entry
raise ConfigEntryNotReady
homeassistant.exceptions.ConfigEntryNotReady: None

Pourrais-tu m'aider à résoudre ce problème ?

Get Price Data Info

Hello Everybody,

The module work very well since 1 month , but since this morning, i can't receive the new data price info.

In the journal , i have this error log :
[custom_components.prix_carburant.sensor] Error requesting prix_carburant data: <urlopen error [Errno -3] Try again>

Anybody have the same problem ?

Unexpected reset, config back to all stations and no data

I define the setup a 8km around my house and only gazole
This works fine but 'sometimes' the whole thing resets
The integration states to be active, the chosen options (gazole) is gone and the entities are no longer available
Reload does not help, need to setup from scratch

There are no errors visible but ... I restart every night and are not daily looking at the prices

config_entries shows:

        "entry_id": "b3b10a555a5dc95c0dd4814fc9da3d15",
        "version": 1,
        "domain": "prix_carburant",
        "title": "Prix Carburant",
        "data": {
          "platform": "prix_carburant",
          "max_km": 8,
          "stations": []
        },
        "options": {},
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "unique_id": "prix_carburant",
        "disabled_by": null

image

Aucune entité / données après installation

Describe the bug
J'ai installé l'intégration via HACS (version 3.4.1) puis j'ai redémarré HA, j'ai ensuite ajouté l'intégration qui m'a proposé de configurer des types de carburants et une distance max.
Une fois ces opérations effectuée je n'ai aucun entités liées à l'intégration mis à part le bouton qui est censé refresh les données.
J'ai tenté de cliquer justement sur le bouton refresh de données il semble le faire correctement mais toujours aucune données.
J'ai voulu alors modifier la configuration de l'intégration via l'UI j'ai juste changé la distance pour mettre 10km cela ne fonctionne pas mieux mais j'ai relevé une erreur dans les journaux.

Configuration
From UI

Expected behavior
Je m'attend à voir les entités correspondant aux stations autour de chez moi

Debug logs

Paste debug logs here

Logger: homeassistant.config_entries
Source: helpers/entity_component.py:202
First occurred: 21:26:41 (1 occurrences)
Last logged: 21:26:41

Error unloading entry Prix Carburant for sensor
Traceback (most recent call last):
  File "/volume1/@appstore/homeassistant/env/lib/python3.11/site-packages/homeassistant/config_entries.py", line 546, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/volume1/@appstore/homeassistant/env/lib/python3.11/site-packages/homeassistant/components/sensor/__init__.py", line 137, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/volume1/@appstore/homeassistant/env/lib/python3.11/site-packages/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

custom_components.prix_carburant.tools.PrixCarburantToolRequestError: API request error 404: {'error_code': 'NotFoundResource', 'message': 'The requested dataset prix-carburants-flux-instantane-v2 does not exist.'}

Describe the bug
The requested dataset prix-carburants-flux-instantane-v2 does not exist: HTTP 404 error: prix-carburants-flux-instantane-v2

Configuration
From UI or in configuration.yaml (paste it here between xxx)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Debug logs

home-assistant_prix_carburant_2024-04-18T12-00-26.006Z.log

2024-04-18 14:00:19.825 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Prix Carburant for prix_carburant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/__init__.py", line 58, in async_setup_entry
    await tool.init_stations_from_location(
  File "/config/custom_components/prix_carburant/tools.py", line 145, in init_stations_from_location
    response_count = await self._request_api(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/tools.py", line 89, in _request_api
    raise PrixCarburantToolRequestError(
custom_components.prix_carburant.tools.PrixCarburantToolRequestError: API request error 404: {'error_code': 'NotFoundResource', 'message': 'The requested dataset prix-carburants-flux-instantane-v2 does not exist.'}
2024-04-18 14:00:23.474 DEBUG (MainThread) [custom_components.prix_carburant.tools] Load stations names from local file stations_name.json
2024-04-18 14:00:23.628 INFO (MainThread) [custom_components.prix_carburant] Init stations list near Home-Assistant location
2024-04-18 14:00:23.629 DEBUG (MainThread) [custom_components.prix_carburant.tools] Call https://data.economie.gouv.fr/api/explore/v2.1/catalog/datasets/prix-carburants-flux-instantane-v2/records API to retrieve station data
2024-04-18 14:00:23.751 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Prix Carburant for prix_carburant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/__init__.py", line 58, in async_setup_entry
    await tool.init_stations_from_location(
  File "/config/custom_components/prix_carburant/tools.py", line 145, in init_stations_from_location
    response_count = await self._request_api(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/prix_carburant/tools.py", line 89, in _request_api
    raise PrixCarburantToolRequestError(
custom_components.prix_carburant.tools.PrixCarburantToolRequestError: API request error 404: {'error_code': 'NotFoundResource', 'message': 'The requested dataset prix-carburants-flux-instantane-v2 does not exist.'}

Les nouvelles icônes de stations rendent l'utilisation des entités dans une carte "map" inutile

Describe the bug
Suite à l'ajout des icônes de stations, le composants HA "map" affiche l'icône de la station au lieu d'utiliser la valeur de "label_mode" dans la configuration, cassant ainsi le moyen de visualiser rapidement le prix du carburant sur une carte.

Si le bug d'affichage provient de HA, il faudrait a minima une configuration permettant de désactiver les icônes des stations afin de retrouver un comportement rendant les entités utilisables sur une carte

Configuration
Configuration d'exemple :

type: map
entities:
  - entity: sensor.station_xyz
    label_mode: state
    focus: false
default_zoom: 11
auto_fit: false
dark_mode: false

Expected behavior
Le composant "map" devrait afficher le prix au lieu de l'icône.

Screenshots
image
Avant MaJ 3.0.0, le prix était indiqué en utilisant label_mode: state. Après MaJ, seul l'icône apparait, le prix n'apparait plus.

Debug logs
Aucun, problème dans la visualisation des données de l'entité

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.