Following are my config files for the integration:
GDS3710_webhook.yaml (automation)
---
# Automation of GDS3710 at frontdoor
# Actor is a Grandstream GDS3710 door intercom
# With this actor it is possible to open the frontdoor with RFID Tag or PIN code.
id: bladibladibla
alias: GDS3710 RFID
trigger:
- platform: webhook
webhook_id: GDS3710_status # http://your-home-assistant:8123/api/webhook/GDS3710_status
allowed_methods:
- POST
local_only: true
condition: []
action:
- choose:
########## RFID Cards (Choose 0) ##########
- conditions:
- condition: and
conditions:
# - condition: time
# after: '08:00:00'
# before: '22:00:00'
- condition: state
entity_id: input_boolean.gds3710_rfid_enabled
state: "on"
# type=100 valid entry according to schedule
- condition: template
value_template: "{{trigger.data.type == '100'}}"
- condition: or
conditions:
- condition: template
value_template: "{{trigger.data.RFID_CARDID == 'xxxxxxxxx'}}" ## RFID card xxxxxxxxx
- condition: template
value_template: "{{trigger.data.RFID_CARDID == 'yyyyyyyy'}}" ## RFID card yyyyyyyyyy
sequence:
- service: logbook.log
data:
name: Voordeur wordt geopend
message: GDS3710 RFID {{trigger.data.RFID_CARDID}}
- service: notify.notify
data:
message: "⚠️ Voordeur gaat open (RFID)"
- service: lock.open
data:
entity_id: "lock.voordeur"
########## Privat PIN Release (Choose 1) ##########
- conditions:
- condition: and
conditions:
- condition: time
after: '08:00:00'
before: '22:00:00'
- condition: template
value_template: "{{trigger.data.message == 'Open Door via PrivatePIN'}}"
- condition: state
entity_id: input_boolean.gds3710_pin_enabled
state: "on"
sequence:
- service: logbook.log
data:
name: "⚠️ Voordeur gaat open (PIN)"
message: Open via Private PIN on GDS3710
- service: notify.notify
data:
message: "⚠️ Voordeur gaat open (PIN)"
- service: lock.open
data:
entity_id: "lock.voordeur"
########## 22# Release (Choose 2) ##########
- conditions:
- condition: and
conditions:
# - condition: time
# after: '08:00:00'
# before: '22:00:00'
- condition: template
value_template: "{{trigger.data.message == 'Call In Log'}}"
- condition: template
value_template: "{{trigger.data.type == '501'}}"
- condition: state
entity_id: input_boolean.gds3710_pin_enabled
state: "on"
sequence:
- service: logbook.log
data:
name: "⚠️ Voordeur gaat open (PIN)"
message: Open via 22#
- service: notify.notify
data:
message: "⚠️ Voordeur gaat open (22#)"
- service: lock.open
data:
entity_id: "lock.voordeur"
########## Somebody calls at the frontdoor (Choose 3) ##########
- conditions:
- condition: template
value_template: "{{trigger.data.message == 'Call Log(Door Bell Call)'}}"
- condition: state
entity_id: input_boolean.gds3710_message_when_somebody_calls_enabled
state: "on"
sequence:
- service: logbook.log
data:
name: GDS3710 webhook automation
message: Somebody called at voordeur
- service: camera.snapshot
target:
entity_id: camera.ds918_haab_deurcamera
data:
filename: '/config/www/snapshot_doorbell.jpg'
- alias: "Set up action variables"
variables:
# Including 'id' in 'action' allows us to identify this script run
# and not accidentally trigger for other notification actions
action_open: "{{ 'OPEN_' ~ context.id }}"
action_none: "{{ 'NONE_' ~ context.id }}"
- service: notify.mobilephones
data:
title: 'Voordeurbel gaat'
message: 'Wil je de deur openen?'
data:
attachment:
url: /local/snapshot_doorbell.jpg
actions:
- action: "{{ action_open }}"
title: "Open deur" # The button title
- action: "{{ action_none }}"
title: "Nee dank je" # The button title
- alias: "Wait for a response"
wait_for_trigger:
# We wait for specific actions because we don't want to run for
# any action, only for a response to the one we just sent
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_open }}"
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_none }}"
# if we do not take action after 20 seconds or so, stop the wait for trigger so it can fire again. Other
# wise we get the "is already running" error in the log.
timeout:
seconds: 30
continue_on_timeout: false
- alias: "Handle the response"
choose:
- conditions: "{{ wait.trigger.event.data.action == action_open }}"
sequence:
- service: notify.notify
data:
message: "⚠️ Voordeur gaat open"
- service: lock.open
data:
entity_id: "lock.voordeur"
- conditions: "{{ wait.trigger.event.data.action == action_none }}"
sequence:
- service: notify.notify
data:
message: "Geen actie genomen op voordeurbel"
GDS3710 configuration (Maintenance → Event Notification)