Trying to get local OpenALPR to work on my setup. Have tried it with different camera’s, they all give an image on my dashboard. There is also the Image processing block on my dashboard, with ‘OpenAlpr cam_test Onbekend’ in it. Onbekend is Dutch for ‘unknown’.
Home Assistant log-file shows no errors on imageprocessing and/or alpr.
One thing I found was that the documentation says I need OpenALPR version 2.3.1, but the official docker container comes with OpenALPR 2.3.0. But there doesn’t seem to be a 2.3.1 anywhere.
bash-4.4# alpr --version
alpr version: 2.3.0
Switching the config to openalpr_cloud works fine:
Ok so i thought i’d find a way to make this work. This is my solution.
The command line binary alpr works fine at returns the Number Plate data. So just needed a way to work with it for now.
I can then display the contents of those sensors on a Lovelace dashboard or use the response to fire more automation’s. i.e
- id: Local ALPR Number Plate Listener Garage
alias: Local ALPR Number Plate Listener Garage
trigger:
platform: state
entity_id: sensor.garage_number_plate
condition:
condition: template
value_template: "{% if not is_state('sensor.garage_number_plate', 'XXXXXXX') and not is_state('sensor.garage_number_plate', 'XXXXXXX') and not is_state('sensor.garage_number_plate', 'XXXXXXX') and not is_state('sensor.garage_number_plate', 'XXXXXXX') and not is_state('sensor.garage_number_plate', 'unknown') %}true{% endif %}"
action:
service: notify.gavin_home_dashboard
data_template:
title: Home Security Alert - Garage Camera ALPR
message: >
'Unknown Car on Drive with Number Plate {{ states("sensor.garage_number_plate") }} {{ now().strftime("%H:%M %d/%b") }}'
data:
image: "https://home.assistant.url:8123/local/alerts/garage_outdoor_camera.jpg?{{now().second}}{{now().second}}{{range(1000)|random}}"
url: "https://home.assistant.url:8123/api/camera_proxy_stream/camera.garage_outdoor_camera"
actions:
- action: tv_lamp_on
icon: "/local/tv.png"
title: TV / Lamp On
- action: intruder_alert
icon: "/local/Alarm-128.png"
title: Activate Intruder Alert
priority: high
tag: 'garage-outdoor-motion-plate_{{ now().strftime("%Y%m%d-%H%M%S") }}'
or
- id: Local ALPR Number Plate Listener Garage Daddy Home
alias: Local ALPR Number Plate Listener Garage Daddy Home
trigger:
platform: state
entity_id: sensor.garage_number_plate
condition:
condition: template
value_template: "{% if is_state('sensor.garage_number_plate', 'DADDY') %}true{% endif %}"
action:
- service: tts.google_translate_say
data:
entity_id: media_player.lounge_speaker
message: Daddys Car is pulling on the Drive
- service: notify.gavin_home_dashboard
data_template:
message: >
'Daddys Car is pulling on the Drive {{ now().strftime("%H:%M %d/%b") }}'
data:
data:
priority: high
tag: "daddy-car-arrived-home-garage"
I’m running hassio on a VirtualBox VM as I’m on Windows. Do you know what I’d need to do to use a shell command? Do I need to create a separate VM for OpenALPR to run in
Where do you put your file in the ubuntu environment?
What do you use to trigger the motion? The camera motion detector im guessing from your code… Wondering if its better to have the openalpr daemon monitor the camera feed then use a Http Post command? Not used that before, think that would work to trigger an automation
the file is in the /usr/bin dir and it is called from anywhere, because its set in the %PaTH% variable. You can do the same for the windows VM, not sure how its built though.
The motion is triggered from Blue Iris sending a MQTT message to HA.
It would probably be pretty intensive monitoring it constantly, thats why i only do it when triggered.