dvejsada / pid_integration Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component for PID (Prague) public transit departure boards API.
Home Assistant custom component for PID (Prague) public transit departure boards API.
Remove attributes provided by API that are not used in practice to reduce amount of data being written into database.
Change the way of entity naming to avoid similar names.
Add platform to the name of the device (stop name) to allow for departure board for both directions.
Add icon to the integration.
I would appreciate help with creation of custom card to display departure board info from this component in useful way on dashboard.
Navrhuji zadávat na vstupu stop_id místo kombinace asw_node_id a asw_stop_id. Evidentně to je vzájemně převoditelné, ale snáze se to vyhledává i zadává. Je to i intuitivnější.
Hi, I recently updated the integration and as expected my dashboard had issues (using Flex table card).
I corrected all entities but even then I just get an error message instead of the table that says x.match is not a function
Any ideas? I only modify the stop name and entities with wildcard.
Flex card yaml looks like this:
type: custom:flex-table-card
title:
- Černý Most
entities:
include:
- sensor.cerny_most_15_next_route_name_*
columns:
- data: departure_timestamp.scheduled
name: TIME
modify: x.match(/[0-9]{2}:[0-9]{2}/);
- data: state
name: LINE
- data: trip.headsign
name: DESTINATION
- data: delay
name: DELAY
modify: |-
if (x.is_available){
x.minutes + " min."
} else {
"-"
};
Any ideas?
Při přidání zastávky 2279_1 (Všenory,žel.zast.) nevidím žádné entity.
Verze: dea4a31
V Logu je chyba:
2024-02-10 23:44:48.928 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up pid_integration platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/pid_integration/sensor.py", line 20, in async_setup_entry new_entities.append(DepartureSensor(departure_board.departures[i], departure_board)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/pid_integration/sensor.py", line 44, in __init__ self._state = self._departure_board.extra_attr[self._departure]["route"]["short_name"] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ IndexError: list index out of range
Bylo by super, pokud by bylo možné jednoduše vypsat jen odjezdy jedné, případně několika linek místo všech odjezdů z konkrétní zastávky.
I downloaded your project (version 0.2), copied files to custom_components folder. Restarted home assistant. Then I clicked on "add integration" button, selected "PID Departure Boards" and got error:
Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble
Add infotext support from the API.
Add sensors for location, platform, wheelchair etc. for each stop device.
Assign unique_id to each departure board to prevent setting similar aswIds twice which may cause issues with entity naming.
Add translations and Czech translation.
Add option to install via HACS.
I got an email from operátor ICT - afaik I only use golemio in this integration, so I guess it's related
Dobrý den,
zaznamenali jsme, že voláte naše api.golemio.cz buď s přebytečným lomítkem na konci "/" nebo otazníkem "?" bez dalších parametrů. V rámci optimalizace našich služeb řešíme i kešování. V případě že ke stránce se přistupuju pod 2 různými URL, tak se pak i 2x kešuje. Plánujeme zavést automatický redirect (kod 301) na zkrácenou verzi, ale nejdříve chceme na to naše uživatele upozornit, aby to mohli upravit sami, protože některým by redirect nemusel fungovat.
Příklady nechtěných URL:
/v2/pid/departureboards/?ids=U693Z2P&total=3&preferredTimezone=Europe%2FPrague&minutesBefore=-9
/v2/pid/departureboards/
/v2/pid/departureboards/?
/v2/pid/departureboards?
/v2/vehiclepositions/gtfsrt/alerts.pb/
Budeme rádi, když si to upravíte, protože tím budeme vědět, že se vám chování api nebude měnit.
Děkujeme
Buď manuálně nebo jej uložit po prvním přidání automatizace a při dalších už jej nevyžadovat. Nebo jen pokud bude v konfiguraci (s manuálním zadáním), tak jej nevyžadovat. Je otravné jej stále dokolečka kopírovat když to člověk zkouší než najde správné parametry.
I am new in Home Assistant
world so maybe I am missing something but I was unable to find a way how to filter data displayed by flex-table-card
. And by filtering I mean for example filtering by trip_headsign
.
What I want to achieve is to display trains departing from Praha-Smíchov
but I am only interested in direction out of the city, not to Praha hl.n.
.
I had expected to be able to filter either in flex-table-card
entities
or somewhere in between PID integration
and the dashboard but found nothing :-)
Am I missing something or is the only way to add a custom filtering feature to PID integration
itself?
Zdravím,
po stažení nové verze jsem se dostal k dialogovému oknu nastavení integrace, ale ani na několik pokusů a s dvěma novými klíči API z Golemio se nechce posunout dále a vyhodí chybu "Unknown API connection error".
Je taky možné, že zadávám zastávku ve špatném formátu. Zkoušel jsem přidat celý řádek ze stops_list.txt i různé části názvu zastávek, ale bez úspěchu.
Log je níže.
Tato chyba pochází z vlastní integrace.
Logger: custom_components.pid_integration.config_flow
Source: custom_components/pid_integration/config_flow.py:60
Integration: PID Departure Boards (documentation, issues)
First occurred: 16:55:53 (7 occurrences)
Last logged: 17:23:23
Unknown API connection error
Traceback (most recent call last):
File "/config/custom_components/pid_integration/config_flow.py", line 60, in async_step_user
info = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/pid_integration/config_flow.py", line 30, in validate_input
raise CannotConnect
custom_components.pid_integration.config_flow.CannotConnect
Druhý log s nenalezenou zastávkou:
Tato chyba pochází z vlastní integrace.
Logger: custom_components.pid_integration.config_flow
Source: custom_components/pid_integration/config_flow.py:60
Integration: pid_integration (documentation, issues)
First occurred: 16:54:32 (1 occurrences)
Last logged: 16:54:32
Stop with provided awsIDs was not found.
Traceback (most recent call last):
File "/config/custom_components/pid_integration/config_flow.py", line 60, in async_step_user
info = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/pid_integration/config_flow.py", line 28, in validate_input
raise StopNotFound
custom_components.pid_integration.config_flow.StopNotFound
Díky za kontrolu a sdělení, co jsem zase udělal špatně:)
R
Improve messages to user and general error handling in case of issues during setup.
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.