Suprema Biostar Locks

Just dumping the config I used to integrate my Suprema Biostar fingerprint lock to my HASS

- platform: command_line
  scan_interval: 3
  switches:
    bioentry:
      command_on: 'curl -kX POST "https://172.16.0.19/api/doors/unlock" -H "accept: application/json" -H "bs-session-id: 270b8f4bd4664c2f90c57e1f97294c5b" -H "Content-Type: application/json" -d "{ \"DoorCollection\": { \"total\": 1, \"rows\": [ { \"id\": 1 } ] }}"'
      command_off: 'curl -kX POST "https://172.16.0.19/api/doors/lock" -H "accept: application/json" -H "bs-session-id: 270b8f4bd4664c2f90c57e1f97294c5b" -H "Content-Type: application/json" -d "{ \"DoorCollection\": { \"total\": 1, \"rows\": [ { \"id\": 1 } ] }}"'
      command_state: 'curl -kX POST "https://172.16.0.19/api/doors/status" -H "accept: application/json" -H "bs-session-id: 270b8f4bd4664c2f90c57e1f97294c5b" -H "Content-Type: application/json" -d "{ \"monitoring_permission\": true}"'
      #      command_state: 'curl -kX GET "https://172.16.0.19/api/doors/1" -H "accept: application/json" -H "bs-session-id: 270b8f4bd4664c2f90c57e1f97294c5b"'
      value_template: '{{ value_json["DoorStatusCollection"]["rows"][0]["unlocked"] == "true" }}'
      #      value_template: '{{ value_json["x"]["Door"]["status"] == "2048" }}'
      friendly_name: "BioEntry W2"

2 Likes

Hi
BioStar2 API
Home assistant Is it possible to control the door? Can you tell me in detail?

Yes its possible, the info in my post plus the biostar docs should be enough to get you going. If you cant understand at least that much then youll have a REALLY hard time if it breaks :frowning:

Give it a go and let me know if you have any questions and I can try to help

/config/configuration.yaml
Can I only configure it here?
Does it automatically appear on the dashboard~?

  • platform: command_line
    scan_interval: 3
    switches:
    bioentry:
    command_on: ‘curl -kX POST “https://192.168.1.200/api/doors/unlock” -H “accept: application/json” -H “bs-session-id: a1fb9224ba4c43b7a7b671fa3fddf712” -H “Content-Type: application/json” -d “{ “DoorCollection”: { “total”: 1, “rows”: [ { “id”: 1 } ] }}”’
    command_off: ‘curl -kX POST “https://192.168.1.200/api/doors/lock” -H “accept: application/json” -H “bs-session-id: a1fb9224ba4c43b7a7b671fa3fddf712” -H “Content-Type: application/json” -d “{ “DoorCollection”: { “total”: 1, “rows”: [ { “id”: 1 } ] }}”’
    command_state: ‘curl -kX POST “https://192.168.1.200/api/doors/status” -H “accept: application/json” -H “bs-session-id: a1fb9224ba4c43b7a7b671fa3fddf712” -H “Content-Type: application/json” -d “{ “monitoring_permission”: true}”’
    # command_state: ‘curl -kX GET “https://192.168.1.200/api/doors/1” -H “accept: application/json” -H “bs-session-id: a1fb9224ba4c43b7a7b671fa3fddf712”’
    value_template: ‘{{ value_json[“DoorStatusCollection”][“rows”][0][“unlocked”] == “true” }}’
    # value_template: ‘{{ value_json[“x”][“Door”][“status”] == “2048” }}’
    friendly_name: “BioStation 2”

That looks mostly correct, but dont forget to make sure its under switches!

When its configured you should get some new entities, you can check them under Developer Tools

Logger: homeassistant.components.command_line
Source: components/command_line/init.py:43
Integration: command_line (documentation, issues)
First occurred: 오후 1:06:13 (42 occurrences)
Last logged: 오후 1:18:31
ogger: homeassistant.helpers.template
Source: helpers/template.py:529
First occurred: 오후 1:06:13 (42 occurrences)
Last logged: 오후 1:18:31

Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json[“DoorStatusCollection”][“rows”][0][“unlocked”] == “false” }})

Timeout for command: curl -X POST “https://192.168.1.200/api/doors/status” -H “accept: application/json” -H "bs-session-id: f480f3ff93e14a969120253f50f68c7c " -H “Content-Type: application/json” -d “{ “monitoring_permission”: true}”

Maybe something with templates has changed… I’ll try and set things up again in a few days and try for you

Thank you.
Please help

Is there a way?