/ematrica_hu

Hungarian highway sticker information for Home Assistant

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

hacs_badge

Buy me a coffee

Hungarian highway sticker information for Home Assistant

This custom component gets Hungarian highway sticker information for your car from https://nemzetiutdij.hu/hu/e-matrica/matrica-lekerdezes

Prerequisites

This has been developed for Raspbian/Debian OS, however if the needed OS packages are available for your OS, most probably it will work on that OS as well.

OS packages needed for this component to work are chromium-browser and chromium-chromedriver.

Since there is no public API to use for querying valid highway stickers, python module selenium is also required. It is specified as requirement in the manifest file, but if it doesn't get installed automatically, install it manually.

Installation

The easiest way to install it is through HACS (Home Assistant Community Store), search for Highway Sticker Information Hungary in the Integrations.

General

The entity created will be named based on the specified plate number e.g. sensor.abc123 (see example configuration below)

The state of the sensor will be the number of days till the first highway sticker expires. The sensor data is updated every 12 hours as the solution is somehow time and resource consuming.

The sensor will also report in attributes all your valid highway stickers:

State and attributes for a sensor

Configuration:

Define sensor with the following configuration parameters:


Name Optional Default Version Description
country Y H 0.0.1 name of the sensor
delay Y 0 0.2.0 delay in seconds when multiple such sensors are used. See below.
plateNumber N `` 0.0.1 plate number

Country code and plateNumber should be in format accepted by https://nemzetiutdij.hu/hu/e-matrica/matrica-lekerdezes, namely:

  • country code in fact accepts a pattern for which the top selection should be made
  • plate number is usually in form of capital letters and numbers without spaces, dashes, etc.

delay is used to flatten the load and interference for webdrivers. When only one sensor is used, you may leave the default value (0) meaning no delay for getting data. When multiple such sensors are used, leave an extra 30 secs delay between sensors, e.g. ABC123 should use no delay (default), ABC124 should use delay 30, ABC125 should use delay 60, etc.y This will also increase the startup time upon Home Assistant restart.

Example

platform: ematrica_hu
country: 'H'
plateNumber: 'ABC123'

You may use custom button card to display the sticker(s): Custom button card displaying sticker

Thanks

Thanks to all the people who have contributed!

contributors