DVLA Vehicle Enquiry Service for Home Assistant

Logo DVLA Vehicle Enquiry Service for Home Assistant

This component provides vehicle details of a specified vehicle into and adds a sensor to Home Assistant which can be used in your own automations.


GitHub Release
License
hacs_badge
Project Maintenance

Enjoying this? Help me out with a :beers: or :coffee:!

coffee

Installation through HACS

Installation via HACS is not yet possible but there is a pending PR for that.

Once it’s approved then you can use HACS to install the DVLA Vehicle Enquiry Service integration.

Manual Installation

Use this route only if you do not want to use HACS and love the pain of manually installing regular updates.

  • Add the dvla folder in your custom_components folder

Usage

Before you can configure this sensor, you must register and obtain and API key at VES API Registration.

As the integration only queries the API twice a day you can put 62 for Estimated monthly enquiry volumes. You will need to multiple this by the number of vehicles you wish to query.

Also make sure to select no for Testing otherwise you won’t have access to any live data.


2 Likes

Thanks for this.
I have installed and can see lots of info as attributes of the sensor.
Can you display when your MOT is due, for example, as a badge?
I cannot seem to get it working.

I don’t use badges but if I’m not mistaken I think they will only work with state entities. So you will need to create a template sensor with the attribute you desire and then use that in you badge.

Hope this helps

Works perfectly, thanks!

1 Like

Working with attributes is new to me, but what I did was:

type: entities
entities:
  - entity: sensor.carreg
  - type: attribute
    entity: sensor.carreg
    attribute: motExpiryDate
    name: Mot
  - type: attribute
    entity: sensor.carreg
    attribute: taxDueDate
    name: Tax

I think I still need to turn them into template sensors so I can work on them (eg put them in my calendar 1 month before)

1 Like

I have asked on Github but here maybe more appropriate.

  1. where does the API key go? There is nothing in the documentation

  2. once the API key is set up how do i call the service ?

The HACS entity has no config options.

Thanks

Anyone ?

It seems a shame that a great add on can’t be used for the sake of detailing how to use it !

Thank you in advance

Jeremy

When I added it as an integration it asked for the API key as part of the config flow. Not sure what you are doing wrong!

image

I deleted mine and simply hit the Add Entry button.

I have downloaded this integration through HACS, restarted HA, now what?
I can not find any way to configure it.
Any help appreciated.

Go to integrations and click add. Then search for DVLA .

Ahh, that’s what I wasn’t doing, thanks, sorted.

1 Like

Is there a way to enter multiple registrations? I’m finding I can enter one but get an invalid key if I try more than one vehicle (import ideally as CSV) I’m not able to find the settings to alter the lookup settings which could be the key to my answer. I have the API from the DVLA and it’s working great when using the single pop up, would be great If I could just add a load of registrations for them to be looked up.

Loaded via HACS, added via “Devices-> Add Integration (searching DVLA)”. Pasted API-Key and the registration of the vehicle, entities made and can see the information.

Question - has anyone added logic to give automation or advance warning for TAX or MOT due (i.e. MOT notice 29 days before expiry and Tax 29 days before expiry)? Something like a colour change for TAX to yellow when it is approaching (and red when past due)? Maybe another sensor or an automation?

As it is, it shows the current values for all these things, and will change when they change, but no advance warning. Will add this, but though someone might have already done this :slight_smile:

Cheers

Yep.
I’ve done it :muscle: It sends a notification.
Once your integration is running and you added cars.

  1. New automation.

  2. Add calendar trigger.
    Choose car calendar.
    Tick Start Time.
    Number of hours e.g. 696 which is 29 days
    Tick Before
    IMPORTANT!!! Set Trigger ID to be lowercase e.g: dvla_yourcarreglowercasenospaces

Repeat step 2 for other cars so you end up with a different trigger and differet trigget ID for a different car.

  1. Action.

Optional …
Choose. (I have choose because i have other non dvla calendars going on there, dont use choose and option 1 if you only have dvla calendars in there)
Option 1.
If Triggered by.
Tick all car related Trigger IDs, they must look like e.g.: dvla_yourcarreglowercasenospaces
Then

A must!
Call Service notify to what ever you want to notify. Edit in Yaml. Replace everything starting with data:

service: notify.notify_your_phone_or_group
data:
  title: >-
    {{ states('sensor.'+trigger.id+'_make') }} {{
    states('sensor.'+trigger.id+'_registrationnumber') }} {{
    state_attr('calendar.'+trigger.id, 'message') }}
  message: >-
    on {{ as_timestamp(state_attr('calendar.'+trigger.id, 'start_time')) |
    timestamp_custom('%A, %d/%m/%Y') }}

I hope this helps :smiley:

I’ve just started using this integration and wanted to do the same, so here’s how I achieved it -
Settings > Devices & Services > Add Integration > DVLA
Then merely re-add your API key and the additional registrations you want to check.

Works a treat, thanks for creating it @jampez77

1 Like