miicroo / lovelace-vasttrafik-card Goto Github PK
View Code? Open in Web Editor NEWLovelace card for displaying transportation data from Västtrafik in HomeAssistant
Lovelace card for displaying transportation data from Västtrafik in HomeAssistant
I will gladly help with a pull request on this one, it should be easy to add using HACS
I have a sensor for a bus that runs at certain time intervals, and only on weekdays. This means that the sensor is undefined for all other times. This results in a line that doesn't get rendered properly on the card.
This is my code for the card:
type: custom:vasttrafik-card
title: Bussavgångar
entities:
- sensor.17_mot_stan
- sensor.44_mot_stan
municipality: Göteborg
sort: true
showFrom: false
showTo: false
showDir: true
The code for sensors:
- platform: vasttrafik
key: !secret vasttrafik_api_key
secret: !secret vasttrafik_api_secret
departures:
- name: 17, Mot stan
from: Norumsgärde
heading: Tuve torg
delay: 5
lines:
- 17
- name: 44, Mot stan
from: Norumsgärde
heading: Tuve torg
delay: 5
lines:
- 44
I'm not really a programmer, more of a hobby hacker, but I'll see what I can do myself on my branch.
Dear Magnus,
I'm quite new to HA and adding cards manually.
What I've done so far:
Added vasttrafik-card.js, vasttrafik-card-editor.js, vasttrafik-card.css from the dist folder to:
../www/community/lovelace-vasttrafik-card
Added your version of vasttrafik sensor (ha-vasttrafik) to:
../custom_components/vasttrafik
I also added the url of the lovelace .js files via the GUI:
https://my.home-assistant.io/redirect/lovelace_resources/
With these entries:
Sincerely yours,
MonkeyFaceMoney
The editor needs a refresh and to get up to the latest standards, at the moment it is broken.
Sometimes the card shows unreasonable values, like 1000+ minutes to the next departure. It seems to happen mostly on the HA app on android, but haven't found all edge cases yet. It can either be that the card itself is not updated, that the values are incorrect or a miscalculation.
It would be good to have the table optionally show the "heading" (as specified in the configuration) in the table instead of the "from", since "from" does not specify the direction, one tram number can go two directions.
I normally use only one "from" station but multiple "headings", depending on where I am going.
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.