dresden-elektronik / deconz-rest-plugin

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

Mumibiz TYZGTH4CH with temperature #7874

Closed enboer closed 1 month ago

enboer commented 2 months ago

Is there already an existing issue for this?

Product name

Mumibiz TYZGTH4CH

Manufacturer

Mumibiz

Model identifier

TYZGTH4CH

Device type to add

Switch

Node info

nodeinfo

Endpoints and clusters

DEvice has 4 switches and a temp sensor. 4 switches are working fine. But I cannot get the temperature to work. Added the ZHA temperature as a new item (DDF edit). But I do not get that to work.

Basic

cluster

Further relevant clusters

Power Configuration

On/Off

Level Control

Color Control

Thermostat

Simple Metering

Electrical Measurement

Any other cluster of relevance/interest

Mimiix commented 2 months ago

Please add all screenshots.

enboer commented 2 months ago

additional info onoff

otau

tuya_spec

identify

basic

enboer commented 2 months ago

Maybe this helps? https://www.zigbee2mqtt.io/devices/TYZGTH4CH-D1RF.html

Smanar commented 2 months ago

The temperature sensor need to be like

   {
      "type": "$TYPE_TEMPERATURE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0402"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/temperature",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = 10 * Attr.val + R.item('config/offset').val;" },
          "read": {"fn": "none"},
          "default": 0
        }
      ]
    }

Just add it to your previous DDF, or if you share it I can complete it.

The dpid is from https://github.com/Koenkk/zigbee2mqtt/issues/23041

github-actions[bot] commented 1 month 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 1 month 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.

enboer commented 1 month ago

Sorry for replying this late... Thanks for your help. I added it to the json file I get the devices, but not the temp sensor. Also in Deconz I do not see the Temp section or the temp value.

TZ3218.json

In Deconz I see the updated file is used (changed the device description) but no temp updates

enboer commented 1 month ago

2024-09-27_19-54-31

Smanar commented 4 weeks ago

It will be not visible on deconz but in the API, using for exemple Phoscon/help/API Information/sensor Need to reload deconz after the DDF addition, and better to delete/re-nclude the device to be sure

enboer commented 3 weeks ago

Added device again. In Phoscon I see the temp sensor. Only temp value stays at 0 degree

Smanar commented 3 weeks ago

Have you aded the tuya unlock sequence ?

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

You need to re-include the device after or wait 24h.

enboer commented 3 weeks ago

I have added this. unpaired, stopped deconz. Started deconz and paired again. But in the .json file I added the text you have suggested. But in the DDF in Deconz Gui I see some more info. See picture. 2024-10-02_16-13-40

Smanar commented 3 weeks ago

Yeah, the editor make too much "magic". On my side I use only text editor, but all codes are good, one is the 'light" code that use the defaut code, and the second one is the defaut code (complete).

And still no report for temperature ? lot of tuya device are locked and need this request. You can too take a look on logs, deconz/help/debug view, with flag "DDF", to see DDF output, if you have nothing on them can use "info" and "info_l2" you will see "tuya output", perhaps I m using a bad dpid.

I m using the dpid 1.

        {
          "name": "state/temperature",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = 10 * Attr.val + R.item('config/offset').val;" },
          "read": {"fn": "none"},
          "default": 0
        }