Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heimgard Smart Lock #8073

Open
1 task done
donnib opened this issue Dec 21, 2024 · 10 comments
Open
1 task done

Heimgard Smart Lock #8073

donnib opened this issue Dec 21, 2024 · 10 comments

Comments

@donnib
Copy link

donnib commented Dec 21, 2024

Is there already an existing issue for this?

  • I have searched the existing issues and there is none for my device

Product name

Heimgard Smart Lock

Manufacturer

Heimgard Technologies

Model identifier

HT-SLM-2

Device type to add

Lock

Node info

image

Endpoints and clusters

image

Basic

image

Further relevant clusters

image image image image image image image image image image
@Smanar
Copy link
Collaborator

Smanar commented Dec 21, 2024

Hello can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Heimgard Technologies",
  "modelid": "HT-SLM-2",
  "vendor": "Heimgard",
  "product": "Door lock (HC-SLM-2)",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_DOOR_LOCK_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0101"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "read": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val/2",
            "fn": "zcl:attr"
          },
          "default": 0
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val ==1",
            "fn": "zcl:attr"
          }
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "if (Attr.val == 0) { Item.val = 'not fully locked' } else if (Attr.val == 1) { Item.val = 'locked' } else if (Attr.val == 2) { Item.val = 'unlocked' } else { Item.val = 'undefined' }",
            "fn": "zcl:attr"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val !=1",
            "fn": "zcl:attr"
          }
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 5,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 5,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

Have mimic an actual one, not sure for battery as on your capture both lines are at "0".

@donnib
Copy link
Author

donnib commented Dec 21, 2024

Thank you, i can't load the file. I tried following :

  1. Make a new file on the rpi with the contents above and save it as json
  2. Open the node in deconz ui, edit DDF
  3. Click File -> Open and choose the json file from step 1
    -> Failed to open

What am i doing wrong ?

@donnib
Copy link
Author

donnib commented Dec 22, 2024

image

@Smanar
Copy link
Collaborator

Smanar commented Dec 22, 2024

What is you OS ?
The json need to be in a "devices" folder, then just restart deconz, never use the editor, except to test/check.

All DDF provided directly with deCONZ typically reside in /usr/share/deCONZ/devices/ on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g. /home//.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired

@donnib
Copy link
Author

donnib commented Dec 22, 2024

I am running deconz on a rPi and i believe its a Debian distribution. I wanted to test the file first before restarting second. Why is that not possible ?

@Smanar
Copy link
Collaborator

Smanar commented Dec 22, 2024

Deconz load DDF only at start and too much problem using the editor.

@donnib
Copy link
Author

donnib commented Dec 25, 2024

I have a folder called : /.local/share/data/dresden-elektronik/deCONZ/devices
should i call the file a specific name because i tried making a file called lock.json and place the content above and restarted deconz but nothing happened to the lock, do i need to repair the lock again or ?

@Smanar
Copy link
Collaborator

Smanar commented Dec 25, 2024

No, it just need to be in the folder "devices", can make a subfolder caller Heimgard.
And yes you need to pait it again, and this time deconz will use the DDF to reconise it, if you edit the DDF later it will be not necessary, but it is for the first inclusion (ATM the device is not reconised, so not in the API at all)

@donnib
Copy link
Author

donnib commented Dec 25, 2024

Got it, i repaired and now it shows up however i was hoping i would get events from the lock when it's unlocked like which code was used to unlock to identify the person but i don't see any events in HA either because the lock doesn't send them or something else is needed more in the DFF ? (i don't know if DFF files have any implications on this)

@Smanar
Copy link
Collaborator

Smanar commented Dec 25, 2024

Nope the RFID (or code gestion) need this kind of PR #5918 , playing with DDF will be not enought for me, give me 15mn to see if we can do something.
The working mode ATM is realy basic, you will have only doorlock state.

Edit:
So I have take a look, and need to handle "notification handle" and I don't see DDF using the same method, so I don't think it's possible using only DDF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants