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

Device request - Moes MS-105Z / _TZE200_la2c2uo9 #5152

Closed
avdbmw opened this issue Jul 21, 2021 · 69 comments · Fixed by #5160
Closed

Device request - Moes MS-105Z / _TZE200_la2c2uo9 #5152

avdbmw opened this issue Jul 21, 2021 · 69 comments · Fixed by #5160

Comments

@avdbmw
Copy link

avdbmw commented Jul 21, 2021

Device

  • Product name: MOES
  • Manufacturer: _TZE200_la2c2uo9
  • Model identifier: TS0601
  • Device type : Please remove all unrelated device types.
    • Light (dimmer)

Screenshots

Node Info

Schermafbeelding 2021-07-21 om 20 24 02

Clusters

Schermafbeelding 2021-07-21 om 20 15 35

Basic

Schermafbeelding 2021-07-21 om 20 15 42

Groups

Schermafbeelding 2021-07-21 om 20 15 58

Schermafbeelding 2021-07-21 om 20 16 09

Scenes

Schermafbeelding 2021-07-21 om 20 16 24

Schermafbeelding 2021-07-21 om 20 16 39

Schermafbeelding 2021-07-21 om 20 16 53

Schermafbeelding 2021-07-21 om 20 17 15

Tuya specific cluster

Schermafbeelding 2021-07-21 om 20 20 28

OTAU

Schermafbeelding 2021-07-21 om 20 20 40

@Smanar
Copy link
Collaborator

Smanar commented Jul 21, 2021

Hello, do you have a linux machine to test code modification ?

@avdbmw
Copy link
Author

avdbmw commented Jul 21, 2021

Hello, do you have a linux machine to test code modification ?

Not directly no, it is running in a docker container within a LXC container. It might be possible to directly compile within the LXC container but haven’t tried that yet.

@Smanar
Copy link
Collaborator

Smanar commented Jul 21, 2021

Yep if you can try, else if you can't, I can make the PR in blind mode (1 line to add), but I can't be sure it will work.

You have the procedure with docker ? #4841 (comment)
Else you have the procedure for classic OS here https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Compiling-the-REST-plugin-for-device-specific-testing
So for you, after having installed deconz :

sudo apt install deconz-dev
git clone --branch tuya17 https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

@avdbmw
Copy link
Author

avdbmw commented Jul 22, 2021

Thank you, I will look into this tonight too see if I can test this in a docker test container.

@avdbmw
Copy link
Author

avdbmw commented Jul 22, 2021

Hey Smanar,

Tested the tuya17 branch with the docker procedure of franciscogouveia, but unfortunately it doesn't work. The switch is still detected as fairy lights and I can only turn off the lights from the phoscon GUI. Do you need additional screenshots from the clusters?
Schermafbeelding 2021-07-22 om 17 53 22

@Smanar
Copy link
Collaborator

Smanar commented Jul 22, 2021

Ok so my bad, have forget some code lines, have updated the branch.
If I m right, you need to delete the old entry, re-include the device and you will have a new one with the type "Dimmable light" and you will have the new field "state/bri"

If it relay don't work you are sure for typo
_TZE200_la2c2uo9

I don't make mistake with I or L ?

PS:
The code modification will impact the action on the bulb, but the detection need to work on the version you already have.

@avdbmw
Copy link
Author

avdbmw commented Jul 22, 2021

Just checked the last update of the branch, but still it is recognized as fairy light and not as a dimmable light and the only action I can perform is switching it off. I deleted the existing entry and paired the device again, but no luck.

The type number seems to be correct, I also crosse checked that already with the number in your commit

@Smanar
Copy link
Collaborator

Smanar commented Jul 22, 2021

Even after a new inclusion ? Can you share the device Json pls ?
You can find it on third app or http://phoscon.de/pwabeta in help / Api Information.

@avdbmw
Copy link
Author

avdbmw commented Jul 22, 2021

Yes even after a new inclusion, sometimes it also shows the general plug symbol and sometimes it shows the light symbol.
Below the JSON:
{
"etag": "7f1853b382da53e4608e6d587914f397",
"hascolor": false,
"lastannounced": null,
"lastseen": "2021-07-22T18:33Z",
"manufacturername": "_TZE200_la2c2uo9",
"modelid": "TS0601",
"name": "Smart plug 28",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "84:fd:27:ff:fe:86:6d:89-01"
}

@avdbmw
Copy link
Author

avdbmw commented Jul 22, 2021

Just to double check, I'm running the correct git commit right? See below screenshot:
Schermafbeelding 2021-07-22 om 20 37 56

@Smanar
Copy link
Collaborator

Smanar commented Jul 23, 2021

Yep the git commit is the same.
The JSON too.

Have you tried 2 inclusion without deleting the device (to use previous data) ?

it also shows the general plug symbol and sometimes it shows the light symbol

And with the same JSON ? The detection is event based, so it can be different at every inclusion, it depend of event order.

Can you share the log during the inclusion if it still not working pls ? with "info" and "info_l2" ?

@avdbmw
Copy link
Author

avdbmw commented Jul 25, 2021

Checked both by deleting and adding it as a new device as well as a 2nd time including it whilst it still exists. Both didn't succeed. Did a full reset of the gateway and started fresh with only adding this dimmer switch, but it is still recognized as a smart plug. This took a while because I had to move the dongle to a location where it could directly communicate with the dimmer switch.

JSON file when recognized as smart plug:
{
"etag": "e714cd6e08fbdcd80dd0b0077b094da8",
"hascolor": false,
"lastannounced": null,
"lastseen": "2021-07-25T05:51Z",
"manufacturername": "_TZE200_la2c2uo9",
"modelid": "TS0601",
"name": "Smart plug 25",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "84:fd:27:ff:fe:86:6d:89-01"
}

JSON when recognized as dimmer, with a dimmable light icon in the phoscon app:
{
"etag": "e6dfbd39e323c0fa1a798184247ccdf6",
"hascolor": false,
"lastannounced": "2021-07-25T06:25:25Z",
"lastseen": "2021-07-25T06:36Z",
"manufacturername": "_TZE200_la2c2uo9",
"modelid": "TS0601",
"name": "Smart plug 26",
"state": {
"alert": "none",
"bri": 0,
"on": false,
"reachable": true
},
"swversion": null,
"type": "Dimmable light",
"uniqueid": "84:fd:27:ff:fe:86:6d:89-01"
}

Attached a log file of adding the device in a clean environment after just starting the container, no other device present.
_deconztest_logs.txt

@Smanar
Copy link
Collaborator

Smanar commented Jul 25, 2021

The second one have worked, look at the JSON

  • you have "bri": 0
  • you have "type": "Dimmable light"

This device can be a little boring to include, because the entry is created in database before having all data, it s for that the double inclusion can help.

07:58:26:000 Tuya debug 10 : Updating model ID

But from log it seem working

07:58:26:000 Tuya debug 5 : Status: 1 Transid: 90 Dp: 257 (0x01,0x01) Fn: 0 Data 0

So first you need to have the second Json, with the light icon in phoscon. But after that can you show log when using the device ?

It s the 1 gang or the 2 gang you have ?

@avdbmw
Copy link
Author

avdbmw commented Jul 25, 2021

Talking about boring and impossible to get connected, took me again half an hour to get the thing connected and recognized as dimmable light. Got it setup, but still I can only turn off the lights from the GUI, changing brightness doesn't work as well as turning on. Only physically I can turn them on.

I have the 1 gang version

In the log file, _deconztest_logs.txt, it seems that a cluster is called which doesn't exist:

13:35:00:709 Poll APS request to 0x84FD27FFFE866D89 cluster: 0x0006 dropped, cluster doesn't

The it doesn recognize physically turning on the lights:

13:35:10:010 Tuya debug 5 : Status: 2 Transid: 80 Dp: 257 (0x01,0x01) Fn: 0 Data 1

After changing the brightness from the GUI it seems to complain about another cluster and also giving an API error:

13:35:23:453 API error 6, /lights/2/state, parameter, transitiontime, not available
13:35:23:509 Poll APS request to 0x84FD27FFFE866D89 cluster: 0x0008 dropped, cluster doesn't exist

@Smanar
Copy link
Collaborator

Smanar commented Jul 25, 2021

Good news, you never need to re-include it now ^^

The it doesn recognize physically turning on the lights:

On log it do !
For "on"

13:35:10:010 Tuya debug 5 : Status: 2 Transid: 80 Dp: 257 (0x01,0x01) Fn: 0 Data 1
13:35:10:011 Websocket 192.168.1.7:44330 send message: {"e":"changed","id":"2","r":"lights","state":{"alert":null,"on":true,"reachable":true},"t":"event","uniqueid":"84:fd:27:ff:fe:86:6d:89-01"} (ret = 139)

For "off"

13:35:41:426 Tuya debug 5 : Status: 2 Transid: 82 Dp: 257 (0x01,0x01) Fn: 0 Data 0
13:35:41:427 Websocket 192.168.1.7:44330 send message: {"e":"changed","id":"2","r":"lights","state":{"alert":null,"bri":207,"on":false,"reachable":true},"t":"event","uniqueid":"84:fd:27:ff:fe:86:6d:89-01"} (ret = 150)

Same when you tru to change the brighness

13:35:10:097 Poll APS request to 0x84FD27FFFE866D89 cluster: 0x0008 dropped, cluster doesn't exist

This error is normal when are using tuya cluster

13:35:10:125 Tuya debug Request : Address 0x84FD27FFFE866D89, Endpoint 0x01, Command 0x02, Payload 02510202000400000330

You are sending the request to the device

13:35:10:125 Tuya debug 4 : Address 0x84FD27FFFE866D89 Payload 02510202000400000330
13:35:10:125 Tuya debug 5 : Status: 2 Transid: 81 Dp: 514 (0x02,0x02) Fn: 0 Data 816

Return from the device 816 *254 /100 = 207

13:35:10:126 Websocket 192.168.1.7:44330 send message: {"e":"changed","id":"2","r":"lights","state":{"alert":null,"bri":207,"on":true,"reachable":true},"t":"event","uniqueid":"84:fd:27:ff:fe:86:6d:89-01"} (ret = 149)

Good value is set in the websocket.

After changing the brightness from the GUI
I can only turn off the lights from the GUI

This device don't use classic cluster, so it don't use 0x0006 or 0x0008, and not possible to use the tuya cluster with the GUI. So need to use third app or Phoscon.

13:35:23:453 API error 6, /lights/2/state, parameter, transitiontime, not available

Have added some code for this error

cd deconz-rest-plugin
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

And ofc, no need to re-include the device, just restart deconz.

@avdbmw
Copy link
Author

avdbmw commented Jul 25, 2021

Sorry my dutch spell correction was probably changing some words:

  • I can only turn on the dimmer with the physical switch
  • GUI only allows turning the lights off.
  • cannot turn on from gui
  • And cannot change brightness from the gui, well I can change the slider and I see the log value. But the device doesn’t respond.

@Smanar
Copy link
Collaborator

Smanar commented Jul 25, 2021

Yep, not possible to use the GUI for this device, he use the tuya cluster. You need to use direclty the API with phoscon or third app (but update your code first for the "transitiontime" error)

@avdbmw
Copy link
Author

avdbmw commented Jul 25, 2021

Ahh ok, good to know. Give me an hour or so and I will update the container and retest.
I will also try changing the brightness from Home Assistant. That should work than.

@avdbmw
Copy link
Author

avdbmw commented Jul 25, 2021

Ok updated the container with the latest commit and the error doesn't seem to come along anymore.

And indeed control from home assistant is completely possible.

Thank you for the support!

@Smanar
Copy link
Collaborator

Smanar commented Jul 25, 2021

Ok so all is working ?
Making the PR.

@Smanar Smanar linked a pull request Jul 25, 2021 that will close this issue
@avdbmw
Copy link
Author

avdbmw commented Jul 25, 2021

Yes, all is working!

@boennhoff
Copy link

boennhoff commented Aug 15, 2021

Hi, I was waiting for this fix for days, because i have several of those dimmers. I was always able to turn the light on and off through iobroker, just no dimming. The new release 2.12.5 does not fix anything for me though. I tried deleting&readding as well as 2-times-adding. What process part am I missing?

My devices title Moes ZigBee Dimmer Module and require the N-wire. 10x times button press gets me to the paring mode (loud beeps). Is this the right thing? Maybe there are different devices with same id out there?

Phoscon shows me the vendor as _TZE200_la2c2uo9 but the model always as Fairy lights. No matter how I try to add the light.

Any ideas?

@Smanar
Copy link
Collaborator

Smanar commented Aug 15, 2021

Hello, yes, I think it s good, else you will not see the device in the API.
Can you show the device json (can use the beta version of phoscon in help/API information) ? To see if the device is reconised as "dimmable light"

Remember when you re-include a second time, don't delete the previous entry.

Can you use the GUI ?

@boennhoff
Copy link

Hi Smanar,
thanks for your fast response. Actually i had trouble getting deCONZ gui to run, but it worked finally and I was able to do some "read descriptors" and other methods. It was more of a lets-try-this, than a I-know-what-I-do thing :-)

But finally the JSON looks like this:

{
    "etag": "4aef32ff3006627d6336d5bdc0a05d8b",
    "hascolor": false,
    "lastannounced": "2021-08-15T20:32:46Z",
    "lastseen": "2021-08-16T08:23Z",
    "manufacturername": "_TZE200_la2c2uo9",
    "modelid": "TS0601",
    "name": "moes-dim-0",
    "state": {
        "alert": "none",
        "bri": 62,
        "on": false,
        "reachable": true
    },
    "swversion": null,
    "type": "Dimmable light",
    "uniqueid": "84:fd:27:ff:fe:89:2e:23-01"
}

I was puzzled seeing that Dimmable light there. This morning ioBroker was also correctly reporting a bunch of new states for this light, including a dimmer level. So, it works now, but I don't really understand what has triggered the correct state, I have to repeat this with 8 more devices soon, maybe I can tell more after that.

Did I coincidentally bought this one hard to pair device, or is this common with ZigBee implementations from different brands? And why is the light still announced as a Fairy light in phoscon (despite the icon showing a dimmable bulb)?

@Smanar
Copy link
Collaborator

Smanar commented Aug 16, 2021

Lol, magic ^^

No in reality it's something bad. The device inclusion is ATM event based, so code part are not trigger chronologically, and can depend of lot of thing, it s realy something chaotic.

The tuya brand is not realy zigbee compliant, so need to use "hacks", and thoses hack depend of event order too.

So it explain why full zigbee compliant device are easier to include, but can fail too. It's realy a weakness in deconz, but the "good" new, is the future API will be better to do that, so yes for the moment we are playing with "double inclusion without deleting with pray on pair day", waiting for something more robust.

Don't delete previous entry can help because some code part can re-use old data previously get by deconz.

And why is the light still announced as a Fairy light in phoscon

This is a phoscon problem, it s the application that choose to display this name, as you can see there is no "Fairy light" in the Json.

@boennhoff
Copy link

Well, that answers all my questions to satisfaction: Thank you!
Just a follow-up:

  1. This "future API", is this a rough idea or already estimated and planned for a milestone?
  2. You say, tuyas implementation is against the spec, is there any recommended read about zigbee and its implementations?

@Smanar
Copy link
Collaborator

Smanar commented Apr 26, 2022

You have unlocked something I think.
But yes using DDF can be usefull, just a thing, this device don't use "ZCL" mode but "TUYA" one, if you llok on the cluster list, you will see it haven't cluster 0x0008 for exemple.

Explanation here #5868
Sample #5869

And your logs mix 2 devices

    "manufacturername": "_TZE200_la2c2uo9",
    "modelid": "TS0601",

and


            "manufacturername": "LUMI",
            "modelid": "lumi.switch.n2aeu1",

@ContraNL
Copy link

ContraNL commented May 20, 2022

@6Ocy6 or anyone else, how did you get Phoscon to see it as a dimmable light?

My log shows the info below, and this even after trying to include it multiple times and even trying to delete and adding it again multiple times. It keeps labelling it as type smart plug.

"16": {
"etag": "b791d8aec64a0c813ac0c7c201056cec",
"hascolor": false,
"lastannounced": "2022-05-19T05:47:48Z",
"lastseen": "2022-05-19T19:33Z",
"manufacturername": "_TZE200_la2c2uo9",
"modelid": "TS0601",
"name": "Overloop lamp",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "84:ba:20:ff:fe:89:4b:d4-01"
},

Did anyone try the steps below from @Smanar succesfully?

Can try like the other user.

Set phosocn in permit join ("add new light")
And using the GUI, try to read again basic attribute (on cluster 0x0000) or read descriptor (the first circle on the node title).

This can update existing device as the device is in permit join mode.

Just tried the steps above from @Smanar but unfortunately within Phoscon nothing seems to change.

afbeelding
afbeelding

@Smanar
Copy link
Collaborator

Smanar commented May 20, 2022

Hello, can you try this DDF (I m using defaut value for the moment)

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_la2c2uo9",
  "modelid": "TS0601",
  "vendor": "$MF_TUYA",
  "product": "Moes MS-105Z",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_DIMMABLE_PLUGIN_UNIT",
      "restapi": "/lights",
      "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",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"},
          "refresh.interval": 300
        },
        {
          "name": "state/bri",
          "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = (Attr.val / 1000.0) * 254.0;"},
          "write": {"fn": "tuya", "dpid": 2, "dt": "0x2b", "eval": "(Item.val / 254.0) * 1000.0;"},
          "read": {"fn": "none"},
          "refresh.interval": 84000
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

@ContraNL
Copy link

ContraNL commented May 20, 2022

@Smanar , maybe a real newbee question but is this a new file or do I have to edit a specific file and can you please direct me to the right documentation on how/where to place a DDF file. I read you can do it through VNC to Deconz but am not sure.

Thanks in advance.

Contra

--Edit-- I found you own explanation here: https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839

@ContraNL
Copy link

ContraNL commented May 20, 2022

And maybe this is the difference, my product number is not Moes MS-105Z but Moes MS-105 seeing it is a 1 gang and not a 2 gang. But I see that name nowhere in Deconz

@ContraNL
Copy link

@Smanar , I have made a file in /usr/share/deCONZ/devices/moes called ms-105.json using apt-get update and apt-get nano to install nano and be able to edit the file. After that I used VNC to hot reload.

Do I need to do anything else like re-add the device?

@Smanar
Copy link
Collaborator

Smanar commented May 20, 2022

Moes MS-105 seeing it is a 1 gang and not a 2 gang. But I see that name nowhere in Deconz

I have just copied the issue title ^^
The DDF is for a 1 gang device, and the DDF is made for

  "manufacturername": "_TZE200_la2c2uo9",
  "modelid": "TS0601",

Do I need to do anything else like re-add the device?

You have found other DDF in the folder ? (just to be sure you are on the good folder ?)

And yes after you just need to re include the device and the DDF will be used to reconise it.

@ContraNL
Copy link

@Smanar , check. I will re include the device first thing tomorrow morning and report back.

Thanks in advance.

@ContraNL
Copy link

@Smanar , yeah it is in a folder with multiple folder. I have created a new folder named moes and then created a file with the name ms-105.json and copies your content into it.

Unfortunately it is not working, I even tried an extra re include again:

83B9909B-8D36-46FC-93E1-88FA366596DB

@Smanar
Copy link
Collaborator

Smanar commented May 21, 2022

Here it s phoscon ("fairy lights" don't exist in the API), can you take a look in the API
On phoscon help / API Information / light.

@ContraNL
Copy link

It still reports as a smart plug:

"18": {
"etag": "1b4a708fb6129b57812423c565e9fa9d",
"hascolor": false,
"lastannounced": "2022-05-21T05:45:33Z",
"lastseen": "2022-05-21T12:56Z",
"manufacturername": "_TZE200_la2c2uo9",
"modelid": "TS0601",
"name": "Overloop lamp",
"state": {
"alert": "none",
"bri": 177,
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "84:ba:20:ff:fe:89:4b:d4-01"
}

@Smanar
Copy link
Collaborator

Smanar commented May 21, 2022

The DDF haven't worked. You are the 4th today with that ....

Have you the complete deconz application ? with the GUI ?
Can you select the node, make "Edit DDF" and check in the DDF editor title if the path and file name is the good one ?
Then make a "hot relaod"

If it s still not working, can you do same but with loging enabled ? no need to share, just look for something usefull like an error message. Can try with "error" and "error_l2" then "DDF" "info" and "info_l2" ?

BTW what is your deconz version ?

@ContraNL
Copy link

I’ll check what you are asking when I get home tonight. But I was thinking that it may be file rights related. I will check that as well.

@Smanar
Copy link
Collaborator

Smanar commented May 21, 2022

IDK, I have so much problem with DDF not reconised thoses lasts days ...

@ContraNL
Copy link

ContraNL commented May 21, 2022

I'm running deconz in a docker. So I can VNC to it, don't know if that is the "GUI" you mean.

I did a hot reload the first time and it did not work. I looked at the logging but I'm only seeing below in regards to the DDF change, so I don't think there is a real error there it's just not picking it up:

21:21:59:408 update ddf TS0601 index 44

Version info:
Deconz
v2.14.1

Qt: 5.9.5
GCC: 7.5.0 (C++ 201402)

Commit: 28575b
Firmware: 0x26660700

Schermafbeelding 2022-05-21 213019

Rights wise it all seems to be ok as well. All files, even the new one are root root with rw-r-r.

@Smanar
Copy link
Collaborator

Smanar commented May 21, 2022

I haven't see this field

"bri": 177,

So the DDF have worked, you had not this field on the first json.
The problem is the type, locked to "Smart plug" even we are using TYPE_DIMMABLE_PLUGIN_UNIT in the DDF, have you deleted the previous entry before re make the inclusion ?

Because I can see state/alert on the last json, and this field was removed from the DDF. Perhaps some field are not updated.

@ContraNL
Copy link

I removed it from the phoscon GUI, but will try again but from deconz.

@ContraNL
Copy link

Unfortunately the same result:

"19": {
    "etag": "aaa8c46c3d9affb30749a9596ca0384c",
    "hascolor": false,
    "lastannounced": null,
    "lastseen": "2022-05-22T06:53Z",
    "manufacturername": "_TZE200_la2c2uo9",
    "modelid": "TS0601",
    "name": "Overloop lamp",
    "state": {
        "alert": "none",
        "bri": 0,
        "on": false,
        "reachable": true
    },
    "swversion": null,
    "type": "Smart plug",
    "uniqueid": "84:ba:20:ff:fe:89:4b:d4-01"
}

@Smanar
Copy link
Collaborator

Smanar commented May 22, 2022

Ok so can you try with this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_la2c2uo9",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Moes MS-105Z",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_DIMMABLE_PLUGIN_UNIT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "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", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"},
          "refresh.interval": 300
        },
        {
          "name": "state/bri",
          "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = (Attr.val / 1000.0) * 254.0;"},
          "write": {"fn": "tuya", "dpid": 2, "dt": "0x2b", "eval": "(Item.val / 254.0) * 1000.0;"},
          "read": {"fn": "none"},
          "refresh.interval": 84000
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_COLOR_DIMMABLE_LIGHT",
      "restapi": "/lights",
      "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",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"},
          "refresh.interval": 300
        },
        {
          "name": "state/bri",
          "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = (Attr.val / 1000.0) * 254.0;"},
          "write": {"fn": "tuya", "dpid": 2, "dt": "0x2b", "eval": "(Item.val / 254.0) * 1000.0;"},
          "read": {"fn": "none"},
          "refresh.interval": 84000
        },
        {
          "name": "state/reachable"
        }
      ]
    },
  ]
}

Have tried on my side, can just use "hot relaod" (but will need to delete the device to remove the fake entry later)
It will create 2 light entries.
Can you show the uniqueid of the 2 lights created ?

@ContraNL
Copy link

Same problem, deleted it in deconz and added it in phoscon:

“20": {
"etag": "7ddc6ae18d4c83874668d8451790d15e",
"hascolor": false,
"lastannounced": null,
"lastseen": "2022-05-22T15:03Z",
"manufacturername": "_TZE200_la2c2uo9",
"modelid": "TS0601",
"name": "Overloop lamp",
"state": {
"alert": "none",
"bri": 0,
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "84:ba:20:ff:fe:89:4b:d4-01"
}

@Smanar
Copy link
Collaborator

Smanar commented May 22, 2022

What is your deconz version ?
I realy don't understand, this DDF need to create 2 "light" entries (and have tested on my side)

Can you share logs with "DDF" just when making a "hot reload" ? (can use a screen capture)

@ContraNL
Copy link

Deconz is version v2.14.1

Did a hot reload with Moes DDF open on 21:12.

Schermafbeelding 2022-05-22 211345

@Smanar
Copy link
Collaborator

Smanar commented May 23, 2022

Arf, have tried too on my side with all debug, and can have only

15:30:19:947 update ddf TS0601 index 2
15:30:19:949 Hot reload device: 84:fd:27:ff:fe:89:2e:2c
15:30:20:004 DEV found DDF for 0x84FD27FFFE892E2C, path: /home/pi/.local/share/dresden-elektronik/deCONZ/devices/dimmer_module.json

So apart the path and file name with "info" there is realy nothing usefull on "hot reload".

You are sure not having something new or strange on the API in the "light" section ?

@ContraNL
Copy link

I’m sure, checked the GUI as well as the API Information page.

@Smanar
Copy link
Collaborator

Smanar commented May 23, 2022

I don't have more ideas, when you go on the DDF editor for this node, you can see "2 parts" on the left column ?
Perhaps your deconz version ? We are at 2.16 ATM.

@ContraNL
Copy link

ContraNL commented May 23, 2022

I’ll update and try again, first without DDF and then with.

—edit— updated my docker but am not getting further then stable version 2.15.3

Will test adding the dimm with and without DDF file tomorrow.

@ContraNL
Copy link

Omg…. Updated deconz and only using the read basic attributes when adding new lights is clicked it is now showing as dimmable light without DDF. After a reload on HA it also shows a light there. It is now using a draft DDF:

C4A2DE0B-01CC-41DE-9152-1CFD79917AC7

Sorry for using your time, but seeing my version was from 2022 and this thread was older I thought that my version was recent enough…

@Smanar
Copy link
Collaborator

Smanar commented May 24, 2022

DDF are something news that move a lot, a recent version is usefull for last features.

But take care:

  • My previous DDF was for a test, it create 2 entries (one is a fake), was just for a test, don't use this one
  • Status = draft mean the DDF is not used ATM.

@ContraNL
Copy link

Your DDF got lost when creating the new docker seeing it is not located in the config folder. So I’m using another and just got the one entity and that one is working from Home Assistant so I’m happy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants