Hello,
As I wanted to learn python and, if it goes well, contribute to home assistant, I decided to try a first project linked to HA
The end goal is to display some lovelace card with the x trains around a given time/dest/arrival. This would allow to display in red any train canceled/delayed and use it as trigger for an automation.
I have a working python file with this kind of config needed :
CONF_URL = 'http://api.irail.be/connections/'
CONF_FROM_STATION = 'namur'
CONF_TO_STATION = 'bruxelles nord'
CONF_DATE = 'today'
CONF_TIME = 'now'
CONF_TIMESEL = 'departure'
CONF_LANG = 'fr'
And this output (time, stations, platfomrs, delay, cancel and duration) :
14:20:00 - Namur - 9 - 22.0 - 0 - Bruxelles-Nord - 9 - 13.0 - 0 - Bruxelles-Midi - 57.0
14:46:00 - Namur - ? - 0.0 - 1 - Bruxelles-Nord - ? - 0.0 - 1 - Tournai - 61.0
15:20:00 - Namur - 9 - 0.0 - 0 - Bruxelles-Nord - 9 - 0.0 - 0 - Bruxelles-Midi - 56.0
15:46:00 - Namur - 11 - 0.0 - 0 - Bruxelles-Nord - 11 - 0.0 - 0 - Tournai - 61.0
16:20:00 - Namur - 9 - 0.0 - 0 - Bruxelles-Nord - 9 - 0.0 - 0 - Bruxelles-Midi - 56.0
16:46:00 - Namur - 11 - 0.0 - 0 - Bruxelles-Nord - 11 - 0.0 - 0 - Bruxelles-Midi - 61.0
17:20:00 - Namur - 9 - 0.0 - 0 - Bruxelles-Nord - 9 - 0.0 - 0 - Bruxelles-Midi - 57.0
Now, the questions
Is it correct that my component will need to be a sensor ? If not what should I use ?
If we take 3 next trains for examples, will they be 3 different sensors ?
For the Lovelace card, I guess I will need to make custom one to display that info with colors etc.
Thank you for reading my request
Regards,
Tibuski