Sistema de reconocimiento de matrículas de bricolaje con asistente doméstico


Hoy os voy a enseñar un sistema de reconocimiento de matrículas DIY creado gracias a platerecognizer.com una web que nos permite enviar una imagen para procesar matrículas, home assistant que es mi plataforma de domótica inteligente de elección y una cámara IP de Reolink (que amablemente me han proporcionado)

 

 

Siga los pasos en el video para una guía paso a paso, aquí puede encontrar el código utilizado en ese video:

Enlaces

HASS-plate-recognizer

Regiones del Reconocedor de Placas

Cámara Reolink usada

Código

secretos. yaml

#secret.yaml
plate_recognizer_token: XXXXXX #replace token
number_plate: AB11ZZZ #replace number plate

configuración. yaml

image_processing: - platform: platerecognizer api_token: !secret plate_recognizer_token regions: - gb #replace with your region watched_plates: - !secret number_plate save_file_folder: /config/www/plate_recognizer #replace with your location if you have a different one save_timestamped_file: true always_save_latest_file: true source: - entity_id: camera.parking_bay #replace entity id

sensores de aparcamiento

#you can change names, just remember to then change them in the automation files.
#Replace AB11ZZZ with your number plate
sensor: - platform: template sensors: is_nissan_number_plate_recognised_bay: friendly_name: "Nissan leaf number plate detected in the parking bay" value_template: "{{ state_attr('image_processing.platerecognizer_parking_bay', 'watched_plates').AB11ZZZ }}" plate_recognizer_api_call_remaining: friendly_name: "Plate Recognizer API calls remaining" value_template: "{{ state_attr('image_processing.platerecognizer_parking_bay', 'statistics').calls_remaining }}"

automatización. yaml

- alias: Parking bay motion trigger: - platform: state entity_id: binary_sensor.parking_bay_motion from: "off" to: "on" #This is option as it specific to me only condition: condition: state entity_id: climate.nest attribute: hvac_action state: "off" action: - service: image_processing.scan target: entity_id: image_processing.platerecognizer_parking_bay #replace with your image_processing entity id mode: single
#if you have used the same name in the blog or video you should be ok apart from the notify part!
- alias: Car Deteced in bay trigger: - platform: state entity_id: sensor.plate_recognizer_api_call_remaining action: - alias: "My car and guests" choose: # My car has been detected, and it wasn't already in the bay! - conditions: - condition: state entity_id: sensor.is_nissan_number_plate_recognised_bay state: "True" # Car wasn't already in the parking bay - condition: template value_template: "{{ not (is_state('input_select.nissan_leaf','Parking Bay')) }}" sequence: - service: notify.mobile_app_giordano_s_iphone_12 #replace with your phone data: message: "The car has been parked outside" # Car flagged as in the parking bay - service: input_select.select_option target: entity_id: input_select.nissan_leaf data: option: Parking Bay - conditions: - condition: state entity_id: sensor.is_nissan_number_plate_recognised_bay state: "False" # Car wasn't already in the parking bay, this is for false positives - condition: template value_template: "{{ not (is_state('input_select.nissan_leaf','Parking Bay')) }}" # need to add confidence level sequence: - service: notify.mobile_app_giordano_s_iphone_12 #replace with your phone data: message: "Someone has parked their car in the parking bay" default: - service: notify.mobile_app_giordano_s_iphone_12 #replace with your phone data: message: "There is motion in the parking bay" condition: condition: numeric_state entity_id: image_processing.platerecognizer_parking_bay above: 0
- alias: API Limit reached for Licence Plate trigger: - platform: numeric_state entity_id: sensor.plate_recognizer_api_call_remaining below: 1 action: - service: notify.mobile_app_giordano_s_iphone_12 #replace with you mobile phone data: message: "Number Plate Licence API has been Reached"

 

 

Entradas recientes