yyrkoon94 / lovelace-idf-mobilite

Lovelace Card for IDF Mobilité (Bus, Métro, RER)
21 stars 6 forks source link

Ratp cap lines invisible #5

Closed tikifarm closed 10 months ago

tikifarm commented 10 months ago

Hi, any line from RATP cap is not showing at all and becomes fully invisible when leaving the HA configuration screen image

i haven't tested (and don't know other groups) on other groupes, but for RATP cap lines, (tram t10 or line 15, 60 and more) it seems to not load at all, while the request seems successful (attribute texts seems to show all needed information) it also seems to affect RATP line 290

thanks :D

yyrkoon94 commented 10 months ago

Hello,

Can you give me more details with the MonitoringRef and/or the LineRef you used i n your PRIM configuration ?

tikifarm commented 10 months ago

for the card on HA :

type: custom:idf-mobilite-card
entities: ''
messages: ''
lineType: BUS
show_screen: false
exclude_lines: ''
entity: sensor.prim_JPT6v2   

on the config.yaml

sensor:
  - platform: rest
    name: prim_JPT6v2                           
    unique_id: uniqueID        
    resource: https://prim.iledefrance-mobilites.fr/marketplace/stop-monitoring
    method: GET
    params:
      MonitoringRef: "STIF:StopPoint:Q:486812:"
    headers:
      apiKey: "API key"                                 
    scan_interval: 60                                     
    timeout: 30
    value_template: "OK"
    json_attributes:
      - Siri

or if i chose any tram line connected with the T10, there is the same issue (47746)

yyrkoon94 commented 10 months ago

Hmmm, it's a line located in Anthony and it looks like there is no line information in the json. Normally I find the line definition in MonitoredVehicleJourney.OperatorRef, but it's empty. What other strange thing is that the line is a RATPDev line, looks like it's not totally include in the PRIM API. I'll try to analyse more precisely the json but if I have no line information I can't display it :(

tikifarm commented 10 months ago

its weird, i still manage to get the data with a different app, https://github.com/droso-hass/idfm , but yhea, i don't have any idea of how he did, but it had a configuration assistant, il try to search on my side, hopefully something can be found :D

yyrkoon94 commented 10 months ago

Is this what you expect ?

Capture d’écran 2023-11-14 à 09 00 43
tikifarm commented 10 months ago

Yesss At least its my goal, (and the fact that T10 is fully encased is the best part since im using darkmode)

yyrkoon94 commented 10 months ago

Ok good ! Fix in the new release v0.1.8

Let me know ;)

tikifarm commented 10 months ago

great thanks! i just updated, but it doesn't seem to work for me (yet? mabe wrong code ?) any chance you could send me an example code ? (im really bad at code lol)

yyrkoon94 commented 10 months ago

Probably you have to clean your cache. I changed data in a refernrtial js so it's probably not reload correctly (I tried on my side and without clean it doesn't work too)

tikifarm commented 10 months ago

welp still not working, tried restarting H.A.

mabe i did it wrong ? i saw a new line appear that wasn't part of RATP :D

card :

type: custom:idf-mobilite-card
entities: ''
messages: ''
lineType: BUS
show_screen: false
exclude_lines: ''
entity: sensor.prim_jphome

yaml :

this is what i get

yyrkoon94 commented 10 months ago

I had the same without cleaning cache. Did it again, close your browser and restart it, it works on my side after cleaning.

tikifarm commented 10 months ago

it work thanks a lot ! image

tikifarm commented 10 months ago

image

im just adding this as a request (i didn't seem to see any request, might be blind lol) but do you know if its possible to get that "filled" logo from the website ? (since im planning to make a "smart mirror" i need that dark background exep for the logo of each line) but my issue is resolved, thanks for your help and work :D

yyrkoon94 commented 10 months ago

Let me fix it ;)

yyrkoon94 commented 10 months ago

Done in v0.1.9

(with special "dédicace" for T10 ;))