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

Add DDF for MHCOZY ZG-005-RF #7310

Merged
merged 7 commits into from Dec 18, 2023
Merged

Add DDF for MHCOZY ZG-005-RF #7310

merged 7 commits into from Dec 18, 2023

Conversation

ebaauw
Copy link
Collaborator

@ebaauw ebaauw commented Oct 20, 2023

See #7309.

Initial support is quite straightforward, see resources below.

I want to expose the button mode (values: toggle, state, momentary) and, if we can reverse engineer it, the device mode (values: self-locking, interlock; jog), but I'm a bit lost in the various config attributes: clickmode vs devicemode vs mode. Neither are currently supported for lights attributes, and I don't think the API checks for valid values when PUTting these for /sensors resources. I think we'd need corresponding capabilities attributes to list the possible values.

Also these modes are for all endpoints. In /devices I would expose these on the main device. Not sure whether to expose these on all /lights resources, or only on the first.

I'm not sure if we already have a standard how we name DDFs for devices using the Tuya convention. I've seen, what I assume is the same device on Amazon an AliExpress, which different (commercial) manufacturer name and model identifier. I don't know if these use the same Manufacturer Name and Model Identifier values.

{
  "config": {
    "groups": [
      "0"
    ],
    "on": {
      "startup": false
    }
  },
  "etag": "501be1375a3277518ddf91ec052b1d90",
  "hascolor": false,
  "lastannounced": null,
  "lastseen": "2023-10-20T11:10Z",
  "manufacturername": "MHCOZY",
  "modelid": "ZG-005-RF",
  "name": "Relay 1",
  "state": {
    "on": false,
    "reachable": true
  },
  "swversion": "1.1.0",
  "type": "On/Off output",
  "uniqueid": "a4:c1:38:22:67:96:ec:15-01"
}
{
  "config": {
    "groups": [
      "0"
    ],
    "on": {
      "startup": false
    }
  },
  "etag": "501be1375a3277518ddf91ec052b1d90",
  "hascolor": false,
  "lastannounced": null,
  "lastseen": "2023-10-20T11:10Z",
  "manufacturername": "MHCOZY",
  "modelid": "ZG-005-RF",
  "name": "Relay 2",
  "state": {
    "on": false,
    "reachable": true
  },
  "swversion": "1.1.0",
  "type": "On/Off output",
  "uniqueid": "a4:c1:38:22:67:96:ec:15-02"
}
{
  "config": {
    "groups": [
      "0"
    ],
    "on": {
      "startup": false
    }
  },
  "etag": "501be1375a3277518ddf91ec052b1d90",
  "hascolor": false,
  "lastannounced": null,
  "lastseen": "2023-10-20T11:10Z",
  "manufacturername": "MHCOZY",
  "modelid": "ZG-005-RF",
  "name": "Relay 3",
  "state": {
    "on": false,
    "reachable": true
  },
  "swversion": "1.1.0",
  "type": "On/Off output",
  "uniqueid": "a4:c1:38:22:67:96:ec:15-03"
}
{
  "config": {
    "groups": [
      "0"
    ],
    "on": {
      "startup": "previous"
    }
  },
  "etag": "6d4d6840823cf39cb6627098ae94bcfe",
  "hascolor": false,
  "lastannounced": null,
  "lastseen": "2023-10-20T11:10Z",
  "manufacturername": "MHCOZY",
  "modelid": "ZG-005-RF",
  "name": "Relay 4",
  "state": {
    "on": false,
    "reachable": true
  },
  "swversion": "1.1.0",
  "type": "On/Off output",
  "uniqueid": "a4:c1:38:22:67:96:ec:15-04"
}

@ebaauw ebaauw added Device Request Device Improvement Additional tag to attach to a existing issue. labels Oct 20, 2023
@ebaauw ebaauw added this to the v2.24.2-beta milestone Oct 20, 2023
@ebaauw ebaauw requested review from manup and Smanar October 20, 2023 11:31
@Smanar
Copy link
Collaborator

Smanar commented Oct 20, 2023

For me not a good idea to change model id and manufacture name. It's alredy a problem for lidl with user not able to reconize their own device (and it's not possible for devs too if this one don't have access to the GUI). And we had some issue with that in c++ core with device that fail some checks with value "randomly patched" during core evolution, it's a field too critic to be patched, just for estetic reasons.

And can have tommorow the same device but on another brand called ZG-008-XY

Good question about "config" for "light", I have this problem too, and I m not sure creating a ZHASensor is the better idea. But with this way you can put all the config on the "sensor" (and only 1 created), so not a problem for that

Also these modes are for all endpoints. In /devices I would expose these on the main device. Not sure whether to expose these on all /lights resources, or only on the first.

And about

I'm not sure if we already have a standard how we name DDFs for devices using the Tuya convention. I've seen, what I assume is the same device on Amazon an AliExpress, which different (commercial) manufacturer name and model identifier. I don't know if these use the same Manufacturer Name and Model Identifier values.

Never make assumptions with Tuya ^^

@ebaauw
Copy link
Collaborator Author

ebaauw commented Dec 15, 2023

Now basing manufacturername and modelid on Manufacturer Name and Model Identifier. The real (non-Tuya) model id is exposed as productid. See below:

{
  "config": {
    "groups": [],
    "on": {
      "startup": "previous"
    }
  },
  "etag": "f3cd380fbc54272565d1e70ab84f8bf8",
  "hascolor": false,
  "lastannounced": null,
  "lastseen": "2023-12-15T10:29Z",
  "manufacturername": "_TZ3000_u3oupgdy",
  "modelid": "TS0004",
  "name": "On/Off output 8",
  "productid": "ZG-005-RF",
  "state": {
    "on": false,
    "reachable": true
  },
  "swversion": "1.1.0",
  "type": "On/Off output",
  "uniqueid": "a4:c1:38:22:67:96:ec:15-01"
}

@Smanar
Copy link
Collaborator

Smanar commented Dec 15, 2023

Nice, on my side I prefer ^^, this solution is perfect for me.

@manup manup merged commit e9f634d into dresden-elektronik:master Dec 18, 2023
1 check passed
@ebaauw ebaauw deleted the mhcozy branch December 18, 2023 10:26
@FhemiR
Copy link

FhemiR commented Dec 22, 2023

I have tested it, I'm not sure if it is related to deconz-rest or is it a HW issue, but the device is time to time not reachable, it keeps the last state however. It comes back online again after a while however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Device Improvement Additional tag to attach to a existing issue. Device Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants