Afficher horaires de bus

Effectivement cela fonctionne, désolé je n’avais pas fait attention au reverse :frowning:
Merci

La plateforme REST a t elle changé ? Depuis un mois c’est HS …
Capture d'écran 2024-01-29 081358

C’est un super post :slight_smile:
Je suis Toulon, métropole TPM … pour l’instant j’ai trouvé que ca :
https://psig-opendata-mtpm.hub.arcgis.com/documents/fd52b3b9952148afab69899f91eb1c81/about

J’aimerai bien également récupérer les infos des lignes 10 et 31 …
Des conseils ?

Bonjour et merci @vingerha pour ta contribution qui est dingue !

j’ai tenté de m’en inspirer pour intégrer non pas l’heure de passage d’un bus mais plutôt le nombre de place disponible dans un parc relais définis (en l’occurence dans mon cas : gare de Venissieux / id:VEN )

Je me suis inspire de ces données en open data :

https://data.grandlyon.com/portail/fr/jeux-de-donnees/parcs-relais-reseau-transports-commun-lyonnais-disponibilites-temps-reel/api

Qui retourne un JSON, si je ne me trompe pas grâce à l’URL Web Service :

https://data.grandlyon.com/fr/datapusher/ws/rdata/tcl_sytral.tclparcrelaistr/all.json?maxfeatures=100&start=1

Tu as la liste des parc relais ainsi que les place disponible théoriquement (j’émets malgré tout un doute car dans mon cas je vois toujours 0 à l’id : nb_tot_place_dispo

Voici ce que j’ai tenté d’intégrer dans mon instance Homeassistant :

sensor:
  - platform: rest
    resource: https://data.grandlyon.com/fr/datapusher/ws/rdata/tcl_sytral.tclparcrelaistr/all.json?maxfeatures=100&start=1
    name: "Parc Relais - Places Disponibles"
    value_template: "{{ value_json.nb_tot_place_dispo }}"
    unit_of_measurement: "places"

Et voici l’erreur que j’obtiens dans les logs :


Enregistreur: homeassistant.helpers.entity
Source: helpers/entity.py:950
S'est produit pour la première fois: 11:35:54 (5 occurrences)
Dernier enregistrement: 11:37:56

Update for sensor.parc_relais_places_disponibles fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 658, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 661, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: ''

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1293, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/rest/entity.py", line 64, in async_update
    self._update_from_rest_data()
  File "/usr/src/homeassistant/homeassistant/components/rest/sensor.py", line 181, in _update_from_rest_data
    self._process_manual_data(raw_value)
  File "/usr/src/homeassistant/homeassistant/helpers/trigger_template_entity.py", line 239, in _process_manual_data
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 665, in state
    raise ValueError(
ValueError: Sensor sensor.parc_relais_places_disponibles has device class 'None', state class 'None' unit 'places' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>)

J’ai tenté de créer un nouveau fil de discussion mais je n’y arrive pas … :sweat_smile: .
Fraichement arrivé dans le monde homeassistant et je crois mon premier post dans un forum d’entraide au passage ^^

Je suis incroyablement surpris par l’entraide de la communauté on peut vraiment s’appuyer sur les connaissances de chacun c’est top !

Voici ce que j’aimerais obtenir sur mon Dashboard dans une card minimaliste :

https://www.t-libr.fr/carte-interactive-t-libr/

Pour le parc relais de gare de Vénissieux

Merci d’avance et au plaisir d’échanger ensemble !