GDS3710 and Loqed smartlock integration

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)

3 Likes

TKS!! @DBM

one question: did you have integrated the GDS in HA by a SIP server?

No, no SIP server integration. I am using a Grandstream 6201

Hello, I’m a beginner, can you advise me how to integrate this, what with those files: GDS3710_webhook.yaml rest.yaml open_voordeur.yaml vergrendel_voordeur.yaml

Do you have the GDS3710 already woring with SIP?

Yes, SIP works for me and I call my phone with it.

Then put all of the files in the right place and replace the specific items (automation id, API key, ip addresses with your own. I have a split config so for me all are single files with in a directory. The split config directory is within brackets.

OK and does it only work on the local network or do I need some communication with the granstream cloud over the internet?

works local even with Loqed

so now I see only one file: GDS3710_webhook.yaml (automation)

So I assume that this code is enough to insert as a new automation?
Where exactly on the HA server should these directories be created? /api/webhook/GDS3710_status
I didn’t find where to enter an API key, or did you mean webhook_id?

I have adapted the file(s) to the new situation where the lock can be operated locally, this after installing the Loqed integration. You do not need the API key anymore, at least not for the automation.
The file either has to merged into automation.yaml or on its own but then you need a split config setup.

When I want to install the LOQED Touch Smart Lock, it wants to enter the name of your lock in the LOQED app, I don’t know where to get it?

All installation stuff regarding Loqed can be found on the website

Well, I don’t quite understand what LOQED and GRANDSTREAM have in common? Isn’t that competition?