dresden-elektronik / deconz-rest-plugin

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

Zigbee Smart Remote Controller -Y #7787

Open tengomol opened 1 month ago

tengomol commented 1 month ago

Is there already an existing issue for this?

Product name

Zigbee Smart Remote Controller -Y

Manufacturer

_TYZB01_qm6djpta

Model identifier

TS0215

Device type to add

Switch

Node info

image

Endpoints and clusters

image

Basic

image

Further relevant clusters

Power Configuration

image

On/Off

Level Control

Color Control

Thermostat

Simple Metering

Electrical Measurement

Any other cluster of relevance/interest

Smanar commented 1 month ago

Hello, what is your OS ? Because for test we need to edit the button_maps.json file. From the picture it look like a clone of

"modelids": ["_TZ3000_0zrccfgx", "_TZ3000_fsiepnrh", "_TZ3000_p6ju8myv"],

tengomol commented 1 month ago

It is:

image

I'm running in raspberry pi 3 model b. ( Linux core-ssh 6.6.28-haos-raspi #1 SMP PREEMPT Wed May 8 10:24:22 UTC 2024 armv7l Linux)

BR, Oliver.

Smanar commented 1 month ago

Ok so hard for you to test DDF, and more to edit the file ....

tengomol commented 1 month ago

How Can I do it? Is there a guide?

I edited "button_maps.json" directly in Home Assistant using Portainer Addon, I added:

"modelids": ["_TZ3000_0zrccfgx", "_TZ3000_fsiepnrh", "_TZ3000_p6ju8myv","TS0215"],

But It doesn't work, is is need to modify in the code, compile and restart?

BR, Oliver.

Smanar commented 1 month ago

There is 2 things:

The easier, you can create this DDF in the persistent folder /data/.local/share/dresden-elektronik/deCONZ/devices/ (hidden)

{
   "schema":"devcap1.schema.json",
   "manufacturername":["_TZ3000_0zrccfgx", "_TZ3000_p6ju8myv", "_TYZB01_qm6djpta"],
   "modelid":["TS0215A", "TS0215A", "TS0215"],
   "vendor":"Woox",
   "product":"R7054 4 gang",
   "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",
               "public":false
            },
            {
               "name":"config/on"
            },
            {
               "name":"config/pending"
            },
            {
               "name":"config/reachable"
            },
            {
                "name": "state/buttonevent"
            },
            {
               "name":"state/lastupdated"
            },
            {
               "name": "state/lowbattery",
               "default": false
            }
         ]
      }
   ],
   "bindings":[
      {
         "bind":"unicast",
         "src.ep":1,
         "cl":"0x0500"
      },
      {
         "bind":"unicast",
         "src.ep":1,
         "cl":"0x0501"
      }
   ]
}

But ATM to work you need too edit the button_maps.json file to add this model, problem HA use docker, so you realy need lot of skill to use this kind of OS, changes are not persistent, if you restart, you loose your change.

tengomol commented 1 month ago

I did all the changes, DDF and also changed button_maps.json. DDF is working because it is detected as switch (instead of sensor), but there is no button. :-( I changed buttons_maps.json, delete device and added again, but still not showing any button. I restarted and change again button-maps.json (because it is not persistent) add device again and nothing change, no button was added. I don't know if the "hot" changes in button-maps.json are applied or there is an error.

Smanar commented 1 month ago

It will depend on how you have changed the button_maps.json. Change need to be persistent, as you need to restart the deconz docker, it's possible, but not easy to do, and I can't explain how to do. You don't need to re-include the device, the DDF is a thing, the buttonmap another. Without the buttonmap file, you will have error on logs about a missing buttonmap every time you press a button.

For me there is only 3 solutions, waiting someone with an OS more open to test the file, make the PR in blind mode without waranty , or wait for the DDF package support button mapping.

tengomol commented 1 month ago

I think so, thanks again for your support @Smanar . I'll investigate if I can create a new docker image from existing ones to include new button_maps.json, change the script to build home-assistant plugin to use my new docker image, compile and packed home assistant addon, uninstall official addon and install my compiled. But not sure if I have time to do this changes, a lot of time needed. If I finally do it and it works, I will let you know the result, thank you!

Smanar commented 4 weeks ago

There is "docker request" to make possible a file edition, but not easy for me. Something easier, just install deconz on a PC for 10mn, time for test, clone your zigbee network and make HA use the second deconz install if needed, but don't need HA to test the file.

tengomol commented 3 weeks ago

Finally I installed using raspbian OS and connect using deconz integration to Home Assistant.

I configured DDF and button_maps.json, and I can see the events in home assistant, for example I configure this automation and it is working when I click one of the buttons:

platform: event event_type: deconz_event event_data: id: remote_control unique_id: XXXXXXXXXXX event: 4002 device_id: XXXXXXXXXXXX

I think it is for button_maps.json, without add DDF I think also works (not sure)

Smanar commented 3 weeks ago

It's fine for me, 4002 mean the button 4, release after press (ARM button), and it's the only even the device is able to send, so for me no problem. Do you want to make the PR to submit the device or want I make it ?

github-actions[bot] commented 2 days 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.