dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

Woox R7052 Smart SOS Button #4323

Closed EarlOfBurton closed 1 year ago

EarlOfBurton commented 3 years ago

Device

Product page: https://wooxhome.com/new-c8/woox-r7052-smart-sos-button-p50

Screenshots

cluster info node_info power_info

Mimiix commented 3 years ago

Missing screen of the device on deconz (and what clusters it houses).

EarlOfBurton commented 3 years ago

Is this the screenshot I forgot to do? 1

Mimiix commented 3 years ago

Yes. But now also missing Time, IAS zone and IAS ACE.

EarlOfBurton commented 3 years ago

Okay, I'm sorry, I'm new to the process. Is this what you need?

Basic

basic

Time

time

Power Configuration

power_configuration

IAS Zone

ias_zone

IAS ACE (part 1 of 2)

ias_ace_1

IAS ACE (part 2 of 2)

ias_ace_2

OTAU

otau

Mimiix commented 3 years ago

Yes. Well, not me, but the developers.

EarlOfBurton commented 3 years ago

Hello friends, are you still missing data from my side, since it has still the mark "incomplete issue"? If so, could you let me know what it is, please?

github-actions[bot] commented 3 years ago

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.

EarlOfBurton commented 3 years ago

Bump to keep it active

github-actions[bot] commented 3 years ago

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[bot] commented 3 years ago

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.

Mimiix commented 2 years ago

Re opened on user request.

github-actions[bot] commented 2 years ago

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.

Nomeboj commented 2 years ago

Bump to keep it active

github-actions[bot] commented 2 years ago

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.

Nomeboj commented 2 years ago

Bump to keep it active

github-actions[bot] commented 1 year ago

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.

Nomeboj commented 1 year ago

Bump to keep it active

github-actions[bot] commented 1 year ago

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.

Nomeboj commented 1 year ago

Bump to keep it active

Mimiix commented 1 year ago

@Smanar Can this be done you think?

Smanar commented 1 year ago

Yep, can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3000_ssp0maqm",
  "modelid": "TS0215A",
  "vendor": "Woox",
  "product": "R7052 Smart SOS Button",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0401",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0500",
          "0x0501"
        ]
      },
      "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/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent",
          "awake": true
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0501"
    }
  ]
}

With this DDF the device will be reconized but not working. Pls check deconz log with flag "info" and "info_l2" and pressing button, you will see error about missing button map, can you share them ?

But I think you will have thoses one

        "immaxKeyfobMap": {
            "vendor": "Immax",
            "doc": "Smart Keyfob 07046L",
            "modelids": ["Keyfob-ZB3.0"],
            "map": [
                [1, "0x01", "IAS_ACE", "ARM", "1", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "Arm day/home zones only"],
                [1, "0x01", "IAS_ACE", "ARM", "0", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "Disarm"],
                [1, "0x01", "IAS_ACE", "EMERGENCY", "0", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "Emergency"],
                [1, "0x01", "IAS_ACE", "ARM", "3", "S_BUTTON_4", "S_BUTTON_ACTION_SHORT_RELEASED", "Arm all zones"]
            ]
        },
Nomeboj commented 1 year ago

Hi.

I will try something tomorrow . It seems that i did not receive SOS from Woox but from Tuya even I ordered Woox so i am bumping wrong case for some time :-p

Regards.

Smanar commented 1 year ago

My DDF is based on the one on the first post, and this one is not a tuya.

EarlOfBurton commented 1 year ago

Hi friends, thanks for providing the start of the DDF. The Log says: 19:42:11:912 [INFO] - No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None, zclSeq: 110 19:42:11:942 Websocket 172.30.32.1:37604 send message: {"attr":{"id":"103","lastannounced":null,"lastseen":"2022-10-12T17:42Z","manufacturername":"_TZ3000_ssp0maqm","modelid":"TS0215A","name":"Switch 103","swversion":null,"type":"ZHASwitch","uniqueid":"bc:33:ac:ff:fe:xx:xx:xx-xx-xxxx"},"e":"changed","id":"103","r":"sensors","t":"event","uniqueid":"bc:33:ac:ff:fe:xx:xx:xx-xx-xxxx"} (ret = 328)

Is this what you need? Since I'm having 73 nodes it's pretty hard to get the right portion of the log to me...

There is a small typo in the DDF, you wrote "modelid": "TS0215" but it should be "modelid": "TS0215A"

Couldn't get it working without the "A" at the end.

Smanar commented 1 year ago

Ha thx, have correctyed the DDF

Is this what you need?

Yes exactly and this one is the same than

No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None,

[1, "0x01", "IAS_ACE", "EMERGENCY", "0", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "Emergency"],

So we can suppose all are same. You can edit the file "button_maps.json" you can find it in the "devices" folder too

And add inside

        "TuyaKeyfobMap": {
            "vendor": "Woox",
            "modelids": ["TS0215A"],
            "map": [
                [1, "0x01", "IAS_ACE", "ARM", "1", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "Arm day/home zones only"],
                [1, "0x01", "IAS_ACE", "ARM", "0", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "Disarm"],
                [1, "0x01", "IAS_ACE", "EMERGENCY", "0", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "Emergency"],
                [1, "0x01", "IAS_ACE", "ARM", "3", "S_BUTTON_4", "S_BUTTON_ACTION_SHORT_RELEASED", "Arm all zones"]
            ]
        },
EarlOfBurton commented 1 year ago

Hi and thanks, I implemented the part to button_maps.json then I had to restart deCONZ the changes to take effect. Now I can see an action connected to the device in Home Assistant (before there was nothing):

woox_2 but when I use it in an Automation, nothing happens. I tried it with two more automations to be sure there's nothing wrong with that - same result. Nothing happens. I pressed it, pressed it long, pressed it twice, pressed it really long like 10 secsonds - the automation was never triggered.

I relogged with INFO and INFO_L2, maybe this can help you to identify the problem? 22:43:07:138 Websocket 172.30.32.1:37758 send message: {"attr":{"id":"105","lastannounced":null,"lastseen":"2022-10-13T20:43Z","manufacturername":"_TZ3000_ssp0maqm","modelid":"TS0215A","name":"Woox R7052 Smart SOS Button 1","swversion":null,"type":"ZHASwitch","uniqueid":"bc:33:ac:ff:xx:xx:xx:xx-xx-xxxx"},"e":"changed","id":"105","r":"sensors","t":"event","uniqueid":"bc:33:ac:ff:xx:xx:xx:xx-xx-xxxx"} (ret = 347)

The API Information from Phoscon states as follows (I edited the etag and uniqueid field for safety reasons): { "config": { "enrolled": 0, "on": true, "pending": [], "reachable": true }, "ep": 1, "etag": "ff5bfac77c156167f0a6f67xxxxxxxxx", "lastannounced": null, "lastseen": "2022-10-13T20:53Z", "manufacturername": "_TZ3000_ssp0maqm", "mode": 1, "modelid": "TS0215A", "name": "Woox R7052 Smart SOS Button 1", "state": { "buttonevent": null, "lastupdated": "none", "lowbattery": null, "tampered": false }, "type": "ZHASwitch", "uniqueid": "bc:33:ac:ff:xx:xx:xx:xx-xx-xxxx" }

Or do you need something else I can support you with? Kind regards.

Smanar commented 1 year ago

"buttonevent": null

I have something wrong. You still have same error message in deconz when using a button ?

No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None

EarlOfBurton commented 1 year ago

Hi @Smanar, I think there was no message like "No button map". Btw. the "Woox R7052 Smart SOS Button" has only one button, in case that is important for the button map.

Now there is something weird happening. I deleted the node via deCONZ, to have a new clean pairing. I reset the Woox device. Then I tried to re-pair it with Phoscon, as I did before. But Phoscon will no more recognise it, but in deCONZ I see it with the randomly generated name (0x48BD): woox

I restarted the deCONZ addon, no luck. I shutdown the Raspi, took it off power for 1 min, rebooted it. Still the same, Phoscon is not recognising the device again, although I can see in deCONZ that it has loaded the correct DDF file...

Can you help me?

Kind regards.

EarlOfBurton commented 1 year ago

@Smanar, I got it working again... it seems that the DDF-file that I created, woox_r7052_ts0215a.json got deleted as well as the new button_maps.json was overwritten during restart or reboot of deCONZ and the changes are gone. I had to reupload the files in the usr/share/deCONZ/devices/woox -folder. Strange. At the moment, with the by deCONZ cleaned button_maps.json I get the following when pressing the button: 19:16:03:547 [INFO] - No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None, zclSeq: 42

Does this help to get it working?

Smanar commented 1 year ago

Yes :( Ha use docker system, lot of stuff are not permanent.

Btw. the "Woox R7052 Smart SOS Button" has only one button, in case that is important for the button map.

Only one button ? So yes, no need to use the button map, can make something faster

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3000_ssp0maqm",
  "modelid": "TS0215A",
  "vendor": "Woox",
  "product": "R7052 Smart SOS Button",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0401",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0500",
          "0x0501"
        ]
      },
      "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/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent",
          "awake": true,
          "parse": {
            "cl": "0x0501",
            "cmd": "0x02",
            "eval": "Item.val = 1002"
          }
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0501"
    }
  ]
}
EarlOfBurton commented 1 year ago

Hi @Smanar, i replaced the device-file with your definition, re-paired, now I get 21:15:21:120 [INFO] - No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None, zclSeq: 17

Btw. now it is recognised as "Remote Control" and before it was recognised as "Switch" - but both are ok to me.

Smanar commented 1 year ago

now it is recognised as "Remote Control" and before it was recognised as "Switch"

I don't see what happen, the device type is a ZHAswitch

You can have the error in logs, but now the device don't use the buttonmap, it work direclty with the api If I m right every time you use the button you receive a notification with state/buttonevent = 1002 in websocket (it s visible too on phoscon/help/API Information/event/sensor/ ..)

EarlOfBurton commented 1 year ago

Hi @Smanar, true. In Phoscon it looks like this: device

and the websocket, as you describe is:

websocket2

But in the automations in Home assistant I cannot select "button press" as trigger. I do have the device woox_r7052_sos_button1 but no trigger as I have it from other switches. What am I doing wrong?

Smanar commented 1 year ago

Not your fault ^^

It seem there is still missing the state/buttonevent

Are you sure HA haven't replaced your DDF ? You need to have

        {
          "name": "state/buttonevent",
          "awake": true,
          "parse": {
            "cl": "0x0501",
            "cmd": "0x02",
            "eval": "Item.val = 1002"
          }
        },

nothing in log with "DDF" when using the button ? BTW I forgot the battery too.

EarlOfBurton commented 1 year ago

True, my mistake. Maybe I uploaded the wrong ddf. Now with state/buttonevent existing in DDF (I double checked). Un-paired. Deleted old DDF, uploaded new DDF, re-paired: device

websocket

Still no "button press" as trigger available.

EarlOfBurton commented 1 year ago

How do I know that deCONZ is using the recently uploaded woox_r7052_ts0215a.json and not an old cached one? At the moment, when I cat the file, I get:

root@core-deconz:/usr/share/deCONZ/devices/woox# cat woox_r7052_ts0215a.json 
{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3000_ssp0maqm",
  "modelid": "TS0215A",
  "vendor": "Woox",
  "product": "R7052 Smart SOS Button",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0401",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0500",
          "0x0501"
        ]
      },
      "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/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent",
          "awake": true,
          "parse": {
            "cl": "0x0501",
            "cmd": "0x02",
            "eval": "Item.val = 1002"
          }
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0501"
    }
  ]
}

Edit: changed markups so that line breaks are correct.

Smanar commented 1 year ago

Now with state/buttonevent existing in DDF (I double checked). Un-paired. Deleted old DDF, uploaded new DDF, re-paired:

Can just use the "hot reload" command in the DDF editor.

Bind/report are already set, so no need to reconfigure the device.

But the state/buttonevent is still "null", you can see nothing in logs with the flag" DDF" ?

I don't see what I m making bad, perhaps with more information

        {
          "name": "state/buttonevent",
          "awake": true,
          "parse": {
            "cl": "0x0501",
            "cmd": "0x02",
           "fn": "zcl",
           "ep": 1,
            "eval": "Item.val = 1002"
          }
        },
EarlOfBurton commented 1 year ago

It seems like it is not accepting anything below "awake": true It is ignoring the rest, see screenshot below. is it possible that there is some bad indentation or some typo? text

EarlOfBurton commented 1 year ago

@Smanar should it maybe be "zcl" instead of "cl" below the "parse"-line?

Smanar commented 1 year ago

I realy hate the HA OS ....

I have just checked the json, all is fine I think the editor don't use the same you are looking in the console. You have the file/path name in the editor title, it s the same you are editing in the console ?

It's possible too making the sate/buttonevent chnage using the editor, but you need in the preview the fingerprint part

      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0401",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0500",
          "0x0501"
        ]
      },

If you can see this part in the "preview", select state/buttonevent in the editor and you can fill all fields manually.

Nomeboj commented 1 year ago

Hi.

I created same thing for my SOS button. I changed "manufacturername": "_TZ3000_zsh6uat3"

So DDF looks like:

{ "schema": "devcap1.schema.json", "manufacturername": "_TZ3000_zsh6uat3", "modelid": "TS0215A", "vendor": "Woox", "product": "R7052 Smart SOS Button", "sleeper": true, "status": "Gold", "path": "/devices/woox/woox_r7052_ts0215a.json", "subdevices": [ { "type": "$TYPE_SWITCH", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0500" ], "fingerprint": { "profile": "0x0104", "device": "0x0401", "endpoint": "0x01", "in": [ "0x0000", "0x0500", "0x0501" ] }, "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/enrolled", "public": false }, { "name": "config/on" }, { "name": "config/pending" }, { "name": "config/reachable" }, { "name": "state/buttonevent", "awake": true, "parse": { "cl": "0x0501", "cmd": "0x02", "ep": 1, "eval": "Item.val = 1002", "fn": "zcl" } }, { "name": "state/lastupdated" }, { "name": "state/lowbattery" } ] } ], "bindings": [ { "bind": "unicast", "src.ep": 1, "cl": "0x0500" }, { "bind": "unicast", "src.ep": 1, "cl": "0x0501" } ] }

Added this to button_maps.json:

"TuyaKeyfobMap": { "vendor": "Woox", "modelids": ["TS0215A"], "map": [ [1, "0x01", "IAS_ACE", "ARM", "1", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "Arm day/home zones only"], [1, "0x01", "IAS_ACE", "ARM", "0", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "Disarm"], [1, "0x01", "IAS_ACE", "EMERGENCY", "0", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "Emergency"], [1, "0x01", "IAS_ACE", "ARM", "3", "S_BUTTON_4", "S_BUTTON_ACTION_SHORT_RELEASED", "Arm all zones"] ] },

restarted everything. In Home assistant i can see remote it is not switch but no entities. However in HA logbook i can see info when button is presed: Remote control fired event '1002'

In log i can see :

No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None, zclSeq: 179

And this is strange if button map is updated. Are you sure that mapping is correct for EMERGENCY button:

[1, "0x01", "IAS_ACE", "EMERGENCY", "0", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "Emergency"],

Regards

Smanar commented 1 year ago

It's because we are no more using the button map file.

{
"name": "state/buttonevent",
"awake": true,
"parse": {
"cl": "0x0501",
"cmd": "0x02",
"ep": 1,
"eval": "Item.val = 1002",
"fn": "zcl"
}

With this code we totaly by-pass the legacy code, but I don't see why it have not worked on my DDF, you are using same code ^^. You can make a test with changing the value 1002 by 1234.

I think if you remove the code part in the buttonmap file, you will have same result.

Nomeboj commented 1 year ago

Hi.

Tried with 1234. Re added switch, i can see in DDF that is updated still no entity in HA. Logs shows:

19:25:02:546 [INFO] - No button map for: TS0215A, unicast to: 0x0000, endpoint: 0x01, cluster: IAS_ACE (0x0501), command: EMERGENCY (0x02), payload: None, zclSeq: 202 19:25:02:546 Websocket 192.168.0.58:34976 send message: {"e":"changed","id":"10","r":"sensors","state":{"buttonevent":1234,"lastupdated":"2022-10-18T17:25:02.545","lowbattery":null},"t":"event","uniqueid":"a4:c1:38:11:30:61:52:3b-01-0500"} (ret = 183)

Smanar commented 1 year ago

For me it mean it work (and no need to re-add the switch, just "hot relaod" the DDF or restart deconz is enought) The buttonevent = 1002 mean button 1, relased button.

For the fact it's not visible in HA perhaps this link can help you https://www.home-assistant.io/integrations/deconz/#remote-control-devices

Nomeboj commented 1 year ago

Ok, so this means that we will not have entity but we need to create automation based on event trigger?

Smanar commented 1 year ago

Honnestly IDK how work HA, but I m seing this question regulary, on the last, one user have post capture but I don't find again the issue

BTW, we forget the battery level

Miss "config/battery" and bind

      {
         "bind":"unicast",
         "src.ep":1,
         "cl":"0x0001",
         "report":[
            {
               "at":"0x0021",
               "dt":"0x20",
               "min":600,
               "max":6000,
               "change":"0x00000001"
            }
         ]
      }
EarlOfBurton commented 1 year ago

Hi @Smanar, thank you for your help, this is not an easy journey ;)

I got the DDF now replaced, finally I had to rename the file so that HA OS reads the new definition. It seems to use a cached file from ... somewhere? I can see the battery indicator in deCONZ. But in Home Assistant I can't see either the battery state nor I can use the button event as a trigger. With my simple minded brain it seems Home Assistant does not know that there is button or the battery state, still receiving events but not knowing that this is a button press? woox

Comparing it to i.e. an Ikea 2-button switch: ikea

My DDF is now:

{
    "schema": "devcap1.schema.json",
    "manufacturername": "_TZ3000_ssp0maqm",
    "modelid": "TS0215A",
    "vendor": "Woox",
    "product": "R7052 Smart SOS Button",
    "sleeper": true,
    "status": "Gold",
    "path": "/devices/woox/woox_r7052_ts0215a.json",
    "subdevices": [
    {
        "type": "$TYPE_SWITCH",
        "restapi": "/sensors",
        "uuid": [
            "$address.ext",
            "0x01",
            "0x0500"
        ],
        "fingerprint": {
            "profile": "0x0104",
            "device": "0x0401",
            "endpoint": "0x01",
                "in": [
                    "0x0000",
                    "0x0500",
                    "0x0501"
                ]
        },
        "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/enrolled",
                "public": false
            },
            { "name": "config/on" },
            { "name": "config/pending" },
            { "name": "config/battery" },
            { "name": "config/reachable" },
            {
                "name": "state/buttonevent",
                "awake": true,
                    "parse": {
                    "cl": "0x0501",
                    "cmd": "0x02",
                    "ep": 1,
                    "eval": "Item.val = 1002",
                    "fn": "zcl"
                    }
            },
            { "name": "state/lastupdated" },
            { "name": "state/lowbattery" }
        ]
    }
    ],
    "bindings": [
        {
            "bind": "unicast",
            "src.ep": 1,
            "cl": "0x0500"
        },
        {
            "bind": "unicast",
            "src.ep": 1,
            "cl": "0x0501"
        },
        {
            "bind":"unicast",
            "src.ep":1,
            "cl":"0x0001",
            "report":[
                {
                    "at":"0x0021",
                    "dt":"0x20",
                    "min":600,
                    "max":6000,
                    "change":"0x00000001"
                }
            ]
        }
    ]
}

The debug says:

22:51:26:021 Websocket 172.30.32.1:41750 send message: {"e":"changed","id":"106","r":"sensors","state":{"buttonevent":
1002,"lastupdated":"2022-10-18T20:51:26.012","lowbattery":null},"t":"event","uniqueid":"bc:33:ac:ff:fe:xx:xx:xx-xx-xxxx"} (ret = 184)
Nomeboj commented 1 year ago

Hi.

It is same behavior that i have. According to https://www.home-assistant.io/integrations/deconz/#remote-control-devices remote controls (ZHASwitch category) will not be exposed as regular entities what is strange to me because there are other remotes in ZHAswitch category and we can see entity.

I mean we can create automation with deconz event but maybe it is possible to get entity for switch, same for battery level?

Example for trigger automation:

platform: event event_type: deconz_event event_data: id: remote_control event: 1002

So not sure are we done with this or something else needs to be done to have included entity in HA?

This is manufacturername that i counted from printouts: _TZ3000_ssp0maqm _TZ3000_zsh6uat3

Smanar commented 1 year ago

Can you take a look direclty in the API to see the device json ? Using phoscon / help / API Information / sensors / "Device_id" You will see the device json created by the API, you need to have a config/battery field

Something I know on HA, it scan device during the first detection, so if the device was included in HA before the field was in the device json, HA can ignore it. Just need to "re synchronise" deconz and HA.

Else not normal. You need to have the same result an entity just with the battery.

EarlOfBurton commented 1 year ago

Hi @Smanar, this is interesting, the battery field says "0" (screenshot below). Is there something wrong with the DDF I use? ( https://github.com/dresden-elektronik/deconz-rest-plugin/issues/4323#issuecomment-1282993416 )

woox