max5962 / prixcarburant-home-assistant Goto Github PK
View Code? Open in Web Editor NEWRécupération des prix des stations en France
Récupération des prix des stations en France
"33127006": {
"Nom": "Intermarché ST JEAN D'ILLAC",
"Marque": "Intermarché"
},
Bonjour, je vous remerci pour le taff et pour contribuer... un autre markdown qui ne nécessite pas des groups et (pour moi) moins des choses a maintenir manuel
type: markdown
title: Prix Gasoil
content: >-
<table> <tr> <td><h4>Name</td> <td><h4>Gasoil</td> <td><h4>Day</td> </tr> {%
for station in (states.sensor | sort(attribute='state')) if 'prix' in
station.entity_id %} <tr><td> {{ state_attr(station.entity_id, 'Station name')
}}</td> <td>{{- state_attr(station.entity_id, 'Gasoil') }}</td>
<td>({{state_attr(station.entity_id, 'Last update').split('-',2)[2]
-}}th)</td> {{- '\n' -}} <tr> <td>{{ state_attr(station.entity_id, 'Station
Address') -}} </td><td><td></td> {% endfor %}
card_mod:
style:
.: |
ha-card ha-markdown {
padding:0px
}
ha-card ha-markdown.no-header {
padding:0px
}
ha-markdown:
$:
ha-markdown-element: |
h1 {
font-weight: normal;
font-size: 24px;
}
div {
background-color:rgb(100, 100, 100);
padding: 12px 12px;
color:white;
font-weight:normal;
font-size:1.2em;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
table{
border-collapse: collapse;
font-size: 0.9em;
font-family: Roboto;
width: auto;
outline: 0px solid #393c3d;
margin-top: 10px;
} caption {
text-align: center;
font-weight: bold;
font-size: 1.2em;
} td {
padding: 5px 5px 5px 5px;
text-align: left;
border-bottom: 0px solid #1c2020;
}
tr {
border-bottom: 0px solid #1c2020;
}
tr:nth-of-type(even) {
background-color: rgb(54, 54, 54, 0.3);
}
tr:last-of-type {
border-bottom: transparent;
}
mark {
background: green;
color: #222627;
border-radius: 5px;
padding: 5px;
}
span {
background: red;
color: #222627;
border-radius: 5px;
padding: 5px;
}
p {
background: lightgreen;
color: #222627;
border-radius: 5px;
padding: 5px;
}
strong {
background: red;
color: #222627;
border-radius: 5px;
padding: 5px;
}
em {
background: yellow;
color: #222627;
border-radius: 5px;
padding: 5px;
}
u {
background: lightblue;
color: #222627;
border-radius: 5px;
padding: 5px;
}
span {
padding: 5px;
}
tr:nth-child(n+2) > td:nth-child(2) {
text-align: left;
}
Hello, it is nbot an issue but, where create:
group:
station_essence:
`Logger: root
Source: custom_components/prixCarburant/prixCarburantClient.py:222
Integration: prixCarburant (documentation, issues)
First occurred: 22:04:09 (1 occurrences)
Last logged: 22:04:09
File up to date, no download needed`
Hi everyone, why am I getting this error message ?
`Logger: homeassistant.components.sensor
Source: custom_components/prixCarburant/sensor.py:73
Integration: Capteur (documentation, issues)
First occurred: 00:24:05 (1 occurrences)
Last logged: 00:24:05
Error while setting up prixCarburant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/prixCarburant/sensor.py", line 73, in setup_platform
stations = client.extractSpecificStation(list)
File "/usr/local/lib/python3.9/site-packages/prixCarburantClient/prixCarburantClient.py", line 163, in extractSpecificStation
stationsXML = self.stationsXML
AttributeError: 'PrixCarburantClient' object has no attribute 'stationsXML'`
Aucune entitée ne remonte chez moi malgrés que l'integration soit bien chargée.
> grep -i carbur home-assistant.log
2022-01-26 14:30:08 WARNING (SyncWorker_6) [homeassistant.loader] We found a custom integration prixCarburant which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
- platform: prixCarburant
#maxDistance: 20
stationID:
- 33000005
- 33000003
Got this in logs...
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 472, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/prixCarburant/sensor.py", line 144, in update
self.client.clean()
File "/srv/homeassistant/lib/python3.7/site-packages/prixCarburantClient/prixCarburantClient.py", line 217, in clean
self.removeFile("station.csv")
File "/srv/homeassistant/lib/python3.7/site-packages/prixCarburantClient/prixCarburantClient.py", line 128, in removeFile
os.remove(file)
FileNotFoundError: [Errno 2] No such file or directory: 'station.csv'
Bonjour
pour je ne sais quelle raison mon affichage est complètement faussé
il s'affiche désormais sous la forme 0.001815 pour le gasoil par exemple au lieu de 1.815
est ce que qq un a une idée
merci
Hi,
Recently bug after restart HA
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:361
Integration: Capteur (documentation, issues)
First occurred: 18:54:07 (1 occurrences)
Last logged: 18:54:07
Error while setting up prixCarburant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/prixCarburant/sensor.py", line 73, in setup_platform
stations = client.extractSpecificStation(list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prixCarburantClient/prixCarburantClient.py", line 159, in extractSpecificStation
stationsXML = self.stationsXML
^^^^^^^^^^^^^^^^
AttributeError: 'PrixCarburantClient' object has no attribute 'stationsXML'
Thanks
Salut
Depuis 2 jours, plus aucune remontée d'info et ce message d'erreur en log
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 558, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/prixCarburant/sensor.py", line 163, in update
self.client.clean()
File "/usr/local/lib/python3.8/site-packages/prixCarburantClient/prixCarburantClient.py", line 221, in clean
self.removeFile("station.csv")
File "/usr/local/lib/python3.8/site-packages/prixCarburantClient/prixCarburantClient.py", line 130, in removeFile
os.remove(file)
FileNotFoundError: [Errno 2] No such file or directory: 'station.csv'
Bonjour,
je m'aperçois que les informations remontées par le plugin ne sont pas bonnes (les prix ne correspondent pas).
J'ai vu que le plugin se base sur le flux quotidien (j'ai bien les mêmes informations que ce flux qui remontent). Par contre, les valeurs sont un peu farfelues alors que dans le flux instantanné, les valeurs sont bonnes et correspondent au prix à l'instant T.
Est-il possible de pouvoir sélectionner le flux voulu ?
Bonjour,
l'application marchait très bien il y a un moment mais depuis peu j'ai cette rerreur dans les logs et les prix des stations que j'ai paramétré ne remonte plus... Depuis une MAJ de Home Assistant je pense.
L'appli est vraiment bien sinon merci pour le travail ! j'espère que vous allez continuer et trouver mon problème.
Je suis a disposition si vous voulez plus d'informations.
Les logs de mon journal HA :
Error while setting up prixCarburant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/prixCarburant/sensor.py", line 70, in setup_platform
stations = client.extractSpecificStation(list)
File "/usr/local/lib/python3.8/site-packages/prixCarburantClient/prixCarburantClient.py", line 159, in extractSpecificStation
stationsXML = self.stationsXML
AttributeError: 'PrixCarburantClient' object has no attribute 'stationsXML'
L’intégration fonctionne bien.
Mais l'utilisation (surtout l'affichage), tel-quel, n'est ni-simple, ni performante :
Voici comment j'ai fait
1/ Group
il faut crée un group avec les differents sensors
group:
station_essence:
- sensor.prixcarburant_38220002
- sensor.prixcarburant_38320006
- sensor.prixcarburant_38800003
- sensor.prixcarburant_38700003
2/ Tableau markdown trié par prix
on peut, ensuite utiliser un template pour le parser, trié et affiche "que" ce qu'on a besoin :
{% set sorted_station_essence =
"group.station_essence" | expand | sort(attribute='attributes.Gasoil')
%}
| Station | Gasoil | Last Update |
| --- | --- |--- |
{% for station in sorted_station_essence %}|
{{- state_attr(station.entity_id, 'Station name') -}}
| {{- state_attr(station.entity_id, 'Gasoil') -}}
| {{- state_attr(station.entity_id, 'Last update') }} |
{% endfor %}
Bonjour!
J'avais peu être cette erreur avant la mise a jour de HA en 2021.12.0 mais cette erreur remonte pas mal de fois dans les logs. Pour le moment le plugins fonctionne... ;)
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549
First occurred: 10:38:30 (4 occurrences)
Last logged: 10:38:30Entity sensor.prixcarburant_77130005 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_77130006 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_77130008 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_77250006 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Bonjour je viens de remarquer que dans mes logs j'ai ça comme erreur et depuis plus aucun prix n'est remonter sur mon interface voici les lignes de code d'erreur
Error while setting up prixCarburant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/prixCarburant/sensor.py", line 73, in setup_platform
stations = client.extractSpecificStation(list)
File "/usr/local/lib/python3.9/site-packages/prixCarburantClient/prixCarburantClient.py", line 163, in extractSpecificStation
stationsXML = self.stationsXML
AttributeError: 'PrixCarburantClient' object has no attribute 'stationsXML'
Bonjour,
J'ai ces message d'erreur et des prix qui ne se mettent pas à jour :(
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549
First occurred: 2 février 2022 à 23:22:13 (9 occurrences)
Last logged: 2 février 2022 à 23:22:15
Entity sensor.prixcarburant_28000011 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_28150001 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_28150002 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_28600002 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.prixcarburant_28630001 (<class 'custom_components.prixCarburant.sensor.PrixCarburant'>) implements device_state_attributes. Please report it to the custom component author.
Logger: root
Source: /usr/local/lib/python3.9/site-packages/prixCarburantClient/prixCarburantClient.py:159
First occurred: 01:22:17 (9 occurrences)
Last logged: 01:22:31
Failed to download new data, will be retry
Trying to use this service got this in log:
2020-03-22 13:52:56 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up prixCarburant platform for sensor
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/prixCarburant/sensor.py", line 70, in setup_platform
stations = client.extractSpecificStation(list)
File "/srv/homeassistant/lib/python3.7/site-packages/prixCarburantClient/prixCarburantClient.py", line 159, in extractSpecificStation
stationsXML = self.stationsXML
AttributeError: 'PrixCarburantClient' object has no attribute 'stationsXML'
my sensor file looks like this:
- platform: prixCarburant
# maxDistance: 20
stationID:
- 21000001
L'intégration PrixCarburant semble correctement installé sur HA (HACS). Elle semble correctement fonctionnement chez moi, mais j'ai des "tonnes" de fichier "PrixCarburant_quotidien_{date}.xml" qui s'accumulent... Ils ne semblent jamais supprimés.
Dans les logs j'ai :
2021-07-01 14:45:01 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.prixcarburant_85500002 fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 558, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/prixCarburant/sensor.py", line 163, in update self.client.clean() File "/usr/local/lib/python3.8/site-packages/prixCarburantClient/prixCarburantClient.py", line 221, in clean self.removeFile("station.csv") File "/usr/local/lib/python3.8/site-packages/prixCarburantClient/prixCarburantClient.py", line 130, in removeFile os.remove(file) FileNotFoundError: [Errno 2] No such file or directory: 'station.csv'
Hi, I have this error on the latest versions of home assistant.
`Logger: homeassistant.components.sensor
Source: custom_components/prixCarburant/sensor.py:73
Integration: Capteur (documentation, issues)
First occurred: 09:58:18 (1 occurrences)
Last logged: 09:58:18
Error while setting up prixCarburant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/prixCarburant/sensor.py", line 73, in setup_platform
stations = client.extractSpecificStation(list)
File "/usr/local/lib/python3.9/site-packages/prixCarburantClient/prixCarburantClient.py", line 163, in extractSpecificStation
stationsXML = self.stationsXML
AttributeError: 'PrixCarburantClient' object has no attribute 'stationsXML'
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.