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

Wattle D Pro Multipunkt #5959

Closed
jokerejoker opened this issue Apr 14, 2022 · 63 comments
Closed

Wattle D Pro Multipunkt #5959

jokerejoker opened this issue Apr 14, 2022 · 63 comments

Comments

@jokerejoker
Copy link

jokerejoker commented Apr 14, 2022

Device

  • Product name: Wattle D Pro Multipunkt
  • Manufacturer: Home Control AS
  • Model identifier: HC-SLM-1
  • Device type:
    • Lock

Screenshots

Basic

image

Power Configuration

image

Identify

image

Groups

image

Scenes

image

Power Configuration

image

Door Lock

image

OTAU

image

@Smanar
Copy link
Collaborator

Smanar commented Apr 14, 2022

Hello.
The support for doorlock is not yet official, we are making one here #5870

can try this DDF to make tries.

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Home Control AS",
  "modelid": "HC-SLM-1",
  "vendor": "Wattle",
  "product": "Wattle D Pro Multipunkt",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_DOOR_LOCK",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "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"
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "eval": "if (Attr.val == 1) { Item.val = 'open' } else if (Attr.val == 2) { Item.val = 'closed' } else { Item.val = 'error' }",
            "fn": "zcl"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 11,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 11,
            "eval": "if (Attr.val == 0) { Item.val = 'open' } else if (Attr.val == 1) { Item.val = 'closed' } else { Item.val = 'error' }",
            "fn": "zcl"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 11,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 1,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 11,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0020",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}


@jokerejoker
Copy link
Author

Thanks, will try it out.

My previous danalock was just recognized as a light bulb and that work fine. Any chance that could be a temporary solution, until the door lock support is implemented?

Anything i can do to help on the door lock support?

@Smanar
Copy link
Collaborator

Smanar commented Apr 15, 2022

Long time door lock are no more reconized as bulbs (even the code is already here for old device like the danalock)
They are now sensor, ZHADoorlock, what is your third app ? They support probably this sensor.

To be honnest it support probably config/lock (like for the version you have, as light bulb) but not state/open and state/lockstate (new features).

Anything i can do to help on the door lock support?

Yep sure, testing the DDF ^^. DDF is the future, I can make change on the core but only to help for DDF support.

And other thing, The last Wattle Door Lock I have tested have issue, it works, but can leave the network after a time. And seem danalock can do same, investigation WIP https://forum.phoscon.de/t/danalock-v3-new-fw-0-20-0-losing-connection/1838

@jokerejoker
Copy link
Author

What do you mean by my third app? Is it home assistant you are referring to?

@Smanar
Copy link
Collaborator

Smanar commented Apr 15, 2022

Yep, for exemple.
And I can confirm, The HA plugin support ZHADoorlock home-assistant/core#48516

@jokerejoker
Copy link
Author

After adding the DDF to the devices folder, the "Add new sensor" wizard reacted by "New sensor ready", but the lock does not appear afterward in the list of sensors, in Phoscon.

This is the result when pulling the /sensors API:

{
    "5": {
        "config": {
            "battery": null,
            "on": true,
            "reachable": true
        },
        "etag": "c8e8698169d827b5044498cb7cc54911",
        "lastannounced": "2022-04-16T16:03:01Z",
        "lastseen": "2022-04-16T16:07Z",
        "manufacturername": "Home Control AS",
        "modelid": "HC-SLM-1",
        "name": "$TYPE_DOOR_LOCK 5",
        "state": {
            "lastupdated": "none",
            "open": null,
            "reachable": null
        },
        "type": "$TYPE_DOOR_LOCK",
        "uniqueid": "68:0a:e2:ff:fe:7b:49:40-01"
    }
}

image

I think we are close, but I am not too familiar with the DDF declarations yet, so please advice on what is wrong and what should be corrected.

@Mimiix
Copy link
Collaborator

Mimiix commented Apr 16, 2022

It wont show in phoscon as they need to add support for it.

@jokerejoker
Copy link
Author

Okay, and that is what is going on at issue #5870 ?

@Smanar
Copy link
Collaborator

Smanar commented Apr 16, 2022

"type": "$TYPE_DOOR_LOCK",

Wich one deconz version are you using ? There is so much things missing.

Okay, and that is what is going on at issue #5870 ?

Nothing special, just he don't have so much time for test, and I prefer waiting for all new feature will works before making a PR.

@jokerejoker
Copy link
Author

I just quickly tested it with the deconz packaged with the hassio (home assistant) core add-on for deconz. It is version 2.14.1

@jokerejoker
Copy link
Author

@Smanar any thoughts ?

@Smanar
Copy link
Collaborator

Smanar commented Apr 16, 2022

Yep you need this PR #5906, so at least the version v2.15.1

@jokerejoker
Copy link
Author

I will build and test a version, of the HA deCONZ Add-on, with the 2.15.1-beta as soon as possible

@Smanar
Copy link
Collaborator

Smanar commented Apr 19, 2022

You don't need to build/recompile the library, the 2.15.1 is available, but not sure how to update it on HA.

@jokerejoker
Copy link
Author

Yes, it was also for the HA plugin that I ment :)

I any ETA on the 2.15.1 stable ?

@Smanar
Copy link
Collaborator

Smanar commented May 3, 2022

@jokerejoker
New stable out https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/v2.15.3

Tell me if the DDF is working ? and by curiosity if your device don't leave the network itself ?

@jokerejoker
Copy link
Author

Awesome! I will test it with in the next days.

FYI - HA addon has been officially updated with the new version

@jokerejoker
Copy link
Author

jokerejoker commented May 15, 2022

This appear to be the result from the API.

image

Execution of lock/unlock command does not appear, lock state does not seam to come through and to be working and battery state is not available. This is properbly due to the DDF being configured wrong?

Also the lock is not recognized correctly by the HA plugin, but is might not be you who need to take a look at that :)

image

I will get back to about if the lock disconnects it self. How long would you expect for to do so ?

@Smanar
Copy link
Collaborator

Smanar commented May 16, 2022

Oups sorry m y bad, I m using bad endpoint on the DDF (you need the 0x01 and I m using "11"
Can you try this one

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Home Control AS",
  "modelid": "HC-SLM-1",
  "vendor": "Wattle",
  "product": "Wattle D Pro Multipunkt",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_DOOR_LOCK",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "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"
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "if (Attr.val == 1) { Item.val = 'open' } else if (Attr.val == 2) { Item.val = 'closed' } else { Item.val = 'error' }",
            "fn": "zcl"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "eval": "if (Attr.val == 0) { Item.val = 'open' } else if (Attr.val == 1) { Item.val = 'closed' } else { Item.val = 'error' }",
            "fn": "zcl"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 1,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0020",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

You will need to delete the old one, because you will have new uniqueid.

I will get back to about if the lock disconnects it self. How long would you expect for to do so ?

The previous user that have the issue have a DC after somes days, but there is some improvement ATM for this issue on the Danalock one.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2022

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Jun 7, 2022
@github-actions
Copy link
Contributor

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

@micv83
Copy link

micv83 commented Sep 12, 2022

When will this DDF be included in the official release ?

@Mimiix
Copy link
Collaborator

Mimiix commented Sep 12, 2022

@micv83 once we know it works :)

@micv83
Copy link

micv83 commented Sep 12, 2022

Would love to test the DDF, but running the official deconz addon there is no easy way, as far as I know ?

@Smanar
Copy link
Collaborator

Smanar commented Sep 12, 2022

Hello, what is your OS, I think the " official deconz addon" mean HA ? https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839

@micv83
Copy link

micv83 commented Sep 13, 2022

Sorry, yes it's HA :-) That is actually a pretty good guide. Managed to edit the DDF, so i'll try testing the device later today or tomorrow.

@Smanar
Copy link
Collaborator

Smanar commented Sep 15, 2022

Ok so let's try with the attribute 0x0021

Take care this new DDF will generate a new unique ID.

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Home Control AS",
  "modelid": "HC-SLM-1",
  "vendor": "Wattle",
  "product": "Wattle D Pro Multipunkt",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "ZHADoorLock",
      "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"
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "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"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "eval": "if (Attr.val == 0) { Item.val = 'open' } else if (Attr.val == 1) { Item.val = 'closed' } else { Item.val = 'error' }",
            "fn": "zcl"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 1,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

@micv83
Copy link

micv83 commented Sep 15, 2022

Result:

image

@Smanar
Copy link
Collaborator

Smanar commented Sep 16, 2022

And it works or not ?

Edit:
Arf fuck, I m seing the 0% on battery. Still 0 % ?

BTW you have perhaps the previous sensor still in the database ? Why you have Doorlock 64 and doorlock 65 ?

Can you replace

        {
          "name": "config/battery"
        },

by

        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          }
        },

And if you still have nothing after 24h

        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          },
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0001", "at": "0x0021"},
          "refresh.interval": 3700
        },

@micv83
Copy link

micv83 commented Sep 20, 2022

I've tried changing to:

{
"name": "config/battery",
"awake": true,
"parse": {
"at": "0x0021",
"cl": "0x0001",
"ep": 1,
"eval": "Item.val = Attr.val / 2"
}
},

Still shows 0%, but will wait 24h.

@micv83
Copy link

micv83 commented Sep 20, 2022

Okay, after pressing read again in Deconz so 0x0021 shows 199 again, battery status updates in HA to 100% :-)

@micv83
Copy link

micv83 commented Sep 26, 2022

Any news @Smanar ?

@Mimiix
Copy link
Collaborator

Mimiix commented Sep 26, 2022

@micv83 Just to let you know: Smanar is on Holiday. I think he will be back in a few days.

@micv83
Copy link

micv83 commented Sep 26, 2022

Okay, and in a few days i will be on holiday :-)

@Smanar
Copy link
Collaborator

Smanar commented Sep 27, 2022

Sorry, so all is working now with this DDF ? I can add it to this PR ? #6334

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Home Control AS",
  "modelid": "HC-SLM-1",
  "vendor": "Wattle",
  "product": "Wattle D Pro Multipunkt",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "ZHADoorLock",
      "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",
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          }
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 11,
            "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"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "eval": "if (Attr.val == 0) { Item.val = 'open' } else if (Attr.val == 1) { Item.val = 'closed' } else { Item.val = 'error' }",
            "fn": "zcl"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 1,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

@micv83
Copy link

micv83 commented Sep 27, 2022

Only the batterystatus worked with the last changes. Did you make any changes to the lock part, in the latest DDF ?

@Smanar
Copy link
Collaborator

Smanar commented Sep 27, 2022

Oups my bad, sorry it s the new DDF (working on another device)

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Home Control AS",
  "modelid": "HC-SLM-1",
  "vendor": "Wattle",
  "product": "Wattle D Pro Multipunkt",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "ZHADoorLock",
      "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",
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          }
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "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"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val !=1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 1,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

@micv83
Copy link

micv83 commented Sep 27, 2022

Still no luck, with the lock part.

Changed DDF, did hot reload, also complete restart of Deconz and reinitialize Deconz plugin in HA.

image

@Smanar
Copy link
Collaborator

Smanar commented Sep 27, 2022

Have you tried to delete the device in HA and resynchronise it ?
Perhaps an error on HA logs ?

Can you share how look the device json ? you can see it in phoscon / help / API Information / sensor

@micv83
Copy link

micv83 commented Sep 27, 2022

This is the device json.

{
"config": {
"battery": 100,
"lock": true,
"on": true,
"reachable": true
},
"etag": "efe17e9d8a774447d98e6ff5aae2da14",
"lastannounced": null,
"lastseen": "2022-09-27T16:15Z",
"manufacturername": "Home Control AS",
"modelid": "HC-SLM-1",
"name": "DoorLock 65",
"state": {
"lastupdated": "none",
"lockstate": null,
"open": null,
"reachable": null
},
"type": "ZHADoorLock",
"uniqueid": "68:0a:e2:ff:fe:7b:60:cc-01-0101"
}

Delete in HA made no difference.

@Smanar
Copy link
Collaborator

Smanar commented Sep 27, 2022

Haaaaa

"reachable": null

You can use it manually to trigger a reaction or replace in the DDF

        {
          "name": "state/reachable"
        }

by

        {
          "name": "state/reachable",
          "default": true
        }

But why all values are null .... Perhaps the device need at least one action for first reporting ....
Or perhaps re-include the device to re-make the bind/report.

@micv83
Copy link

micv83 commented Sep 27, 2022

Tried removing the batteries from the lock an insert again. Now the lock status is shown when unlocking directly on the lock. 😄 But Pushing lock or unlock in HA does nothing.

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2022

"state": {
  "lastupdated": "none",
  "lockstate": null,
  "open": null,
  "reachable": null
},

I think here, you have new values now ? reachable is now true ?
It's the only field that can prevent HA to make the request. So if the value is true, you have something in log.

Can try too direclty with the API.

curl -H 'Content-Type: application/json' -X PUT -d '{"lock": true}' http://IP:PORT/api/KEY/sensors/ID/config

IP and PORT are the same you can see when using phoscon
KEY is an API key, can use the same used by HA
ID is the device id, probably 65 from your last capture.

Edit:
Just to be sure, the device is working if you use it with the GUI (on the cluster 0x0101) ?

@micv83
Copy link

micv83 commented Sep 28, 2022

Reachable is still null:

{
"config": {
"battery": 100,
"lock": true,
"on": true,
"reachable": true
},
"etag": "08487aa99b30bfa47f94a3e59b86717b",
"lastannounced": "2022-09-27T23:20:29Z",
"lastseen": "2022-09-28T12:04Z",
"manufacturername": "Home Control AS",
"modelid": "HC-SLM-1",
"name": "DoorLock 65",
"state": {
"lastupdated": "2022-09-28T12:04:32.359",
"lockstate": "locked",
"open": null,
"reachable": null
},
"type": "ZHADoorLock",
"uniqueid": "68:0a:e2:ff:fe:7b:60:cc-01-0101"
}

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2022

"state": {
   "lastupdated": "2022-09-28T12:04:32.359",
   "reachable": null
},

Ok so new issue ....
But you are on HA ? so you are using the last stable version for deconz available for it ?

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2022

@micv83 and if you use

"sleeper": true,

@micv83
Copy link

micv83 commented Sep 28, 2022

I’m on deconz version 2.17.1 I have 2.18.2 available, but don’t know if an update will wipe the custom ddf, I’m away at the moment so won’t be able to upload the ddf again.

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2022

ok, I m asking some tips to other devs, I will give you a new DDF "last hope" soon.
Perhaps using the poll, as the bind seem not working.

@Smanar
Copy link
Collaborator

Smanar commented Sep 28, 2022

Ok so ebaauw have found the probleml, the DDF was made with the first one (from may), It was totally out. I m using state/reachable, and for sensor It's config/reachable, I m using the good one for the other working device #6334

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Home Control AS",
  "modelid": "HC-SLM-1",
  "vendor": "Wattle",
  "product": "Wattle D Pro Multipunkt",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "ZHADoorLock",
      "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",
          "awake": true,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          }
        },
        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },
        {
          "name": "state/lockstate",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "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"
          }
        },
        {
          "name": "state/open",
          "read": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0003",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val != 1",
            "fn": "zcl"
          }
        },
        {
          "name": "config/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0101",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 1,
          "max": 300
        },
        {
          "at": "0x0003",
          "dt": "0x30",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

@micv83
Copy link

micv83 commented Sep 29, 2022

Super! I’ll test it as soon as I have returned from holiday. 😊

@micv83
Copy link

micv83 commented Oct 8, 2022

State in now correcly displayed when locked/unlocked from the lock, but i'm still not able to lock/unlock from HA.

But it shows reachable in API now.
{
"config": {
"battery": 100,
"lock": false,
"on": true,
"reachable": true
},
"etag": "65fa13a7527403ed7852311da07c1ec0",
"lastannounced": "2022-10-08T17:22:58Z",
"lastseen": "2022-10-08T17:23Z",
"manufacturername": "Home Control AS",
"modelid": "HC-SLM-1",
"name": "DoorLock 65",
"state": {
"lastupdated": "2022-10-08T17:23:59.541",
"lockstate": "locked",
"open": null
},
"type": "ZHADoorLock",
"uniqueid": "68:0a:e2:ff:fe:7b:60:cc-01-0101"
}

@Smanar
Copy link
Collaborator

Smanar commented Oct 9, 2022

All seem fine, even the lastupdated have worked, except the state/open=null, perhaps a bind problem, canbe solved later by deconz.
You don't have error message in HA ?

Can you try direclty with API

curl -H 'Content-Type: application/json' -X PUT -d '{"lock": true}' http://IP:PORT/api/KEY/sensors/ID/config

IP and PORT are the same used than phoscon
KEY is an apikey, can use the same one than the one used by HA
ID is the device id.

The device work manualy ? The value of state/lockstate is updated ?

BTW, I don't see "write" part in the DDF for config/lock ....

If you are sure it's not working, replace

        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          }
        },

by (better)

        {
          "name": "config/lock"
        },

or (last chance)

        {
          "name": "config/lock",
          "read": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0101",
            "ep": 1,
            "eval": "Item.val = Attr.val == 1",
            "fn": "zcl"
          },
          "write": {
            "at": "0x0000",
            "cl": "0x0101",
            "dt": "0x20",
            "ep": 1,
            "eval": "Item.val ? false : true",
            "fn": "zcl"
          },
        },

No need to re-include, can just edit the DDF and make a "hot relaod" or restar deconz.

@micv83
Copy link

micv83 commented Oct 9, 2022

Tried the 2 changes, but then i was unable to even get the status from the lock, so went back to the DDF from before and got the status working again. Hope I wasn’t to impatient, as the lock sometimes takes a bit to update correctly after a deconz restart. If the changes should work, I can try them again.

Don’t know how to extract the apikey from HA or deconz, to do the api call manually?

@Smanar
Copy link
Collaborator

Smanar commented Oct 10, 2022

IDK where to find it in HA.
But you can create a new one using

curl http://IP:PORT/api/ -X POST -d '{"devicetype": "TestKey"}'

And strange the DDF stop status return ...
I m using website like this one to check json validity https://jsonformatter.curiousconcept.com/ perhaps a typo.

And no, don't worry, change are immediate, can use the "hot reload" in the menu, no need to re-include the device, nothing to reconfigure, just need deconz use the new DDF.

I m comparing the DDF with a working one #6334
I don't see what is missing.

@donnib
Copy link

donnib commented Dec 20, 2024

Sorry coming late too the game, I have HT-SLM-2 lock, how can I change the DDF so it works with my lock. I tried changing the name and model to match mine an tried to load the DDF but I get failed to open.

@Smanar
Copy link
Collaborator

Smanar commented Dec 21, 2024

Next here #8073

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

5 participants