So i have BlueIris Installed and working to send images from my camera to the platerecognizer API
I am looking to setup either an MQTT trigger or Webhook from BI (BlueIris) to my HA server to trigger a gate opener if the plate is recognised
The issue im having is the JSON payload of the plate from BI through to HA and getting this to be used as a variable to check if its a valid plate.
Has anyone used this and havs a working JSON payload and MQTT trigger.
- trigger: mqtt
topic: blue_iris
payload: "{\"plate\":\"&PLATE\"}"
- webhook_id: blueiris_plate_trigger
allowed_methods:
- POST
- PUT
- GET
- HEAD
local_only: false
trigger: webhook
conditions: []
actions:
- variables:
plate: >-
{% if trigger is defined and trigger.payload_json is defined and
trigger.payload_json.plate is defined %}
{{ trigger.payload_json.plate }}
{% elif trigger is defined and trigger.payload_json is defined and
trigger.payload_json['&PLATE'] is defined %}
{{ trigger.payload_json['&PLATE'] }}
{% else %}
''
{% endif %}
- data:
message: "Webhook received plate: {{ plate }}"
level: info
action: system_log.write
- choose:
- conditions:
- condition: template
value_template: |
{{ plate in ['S15MFY', 'WG15LLX'] }}
sequence:
- data:
title: Plate Detected
message: Vehicle with plate {{ plate }} arrived.
action: notify.mobile_app_Scottsphone
- conditions:
- condition: template
value_template: |
{{ plate != '' and plate not in ['S15MFY', 'WG15LLX'] }}
sequence:
- data:
title: Vehicle [Opt 2]
message: Vehicle {{ plate }} on camera.
action: notify.mobile_app_Scottsphone
mode: single