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

Moes Tuya Thermostat BTH-002 #3304

Closed
d-litvinov opened this issue Sep 23, 2020 · 181 comments · Fixed by #3457
Closed

Moes Tuya Thermostat BTH-002 #3304

d-litvinov opened this issue Sep 23, 2020 · 181 comments · Fixed by #3457

Comments

@d-litvinov
Copy link

d-litvinov commented Sep 23, 2020

Device

Screenshot 2020-09-23 at 15 57 06

  • Product name: Moes thermostat BHT-002
  • Manufacturer: _TZE200_aoclfnxz
  • Model identifier: TS0601
  • Device type :
    • Thermostat

Screenshots

deconz version 2.05.81
Screenshot 2020-09-23 at 13 59 15

Screenshot 2020-09-23 at 13 58 56

Screenshot 2020-09-23 at 13 58 28

Screenshot 2020-09-23 at 13 59 50

Screenshot 2020-09-23 at 14 01 45

@d-litvinov
Copy link
Author

Those are cheap and pretty decent floor heating thermostats from Aliexpress, so I think they are going to be pretty popular.

@Smanar
Copy link
Collaborator

Smanar commented Oct 2, 2020

Hello, do you have an Unix machine to compile code to test it ?

Jut for information we already have some tuya thermostat working, but values can be different, so can take some time looking in log if your device don't work at first try.

@d-litvinov
Copy link
Author

Yes, I have a raspberry. And I'll be happy to help.
What should I test?

@Smanar
Copy link
Collaborator

Smanar commented Oct 3, 2020

Here you have the procedure https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only

Just replace the step 1 by
git clone --branch tuya https://github.com/Smanar/deconz-rest-plugin.git
and you can skip the step
git checkout -b mybranch HEAD

The last step replace your actual file, so better to close deconz before, or deconz will be closed itself by the change. (you can make a backup if you want but in another folder, file is libde_rest_plugin.so)

After that you just need to re-include the device, will be invisible in phoscon but visible in API, third applications.

@d-litvinov
Copy link
Author

d-litvinov commented Oct 3, 2020

It works! It adds to rest api as a smart plug
{ "etag": "e142589e806633ad22ee7215ec013336", "hascolor": false, "lastannounced": "2020-10-03T21:42:03Z", "lastseen": "2020-10-03T21:51Z", "manufacturername": "_TZE200_aoclfnxz", "modelid": "TS0601", "name": "Smart plug 2", "state": { "alert": "none", "on": false, "reachable": true }, "swversion": null, "type": "Smart plug", "uniqueid": "bc:33:ac:ff:fe:5e:c7:d7-01" }

And I can switch it on/off from the HomeAssistant.
But setting temperature isn't avaliable.

Do you need anything else? logs?

@Smanar
Copy link
Collaborator

Smanar commented Oct 4, 2020

Ha ?
Normally I need to disable it from the "light" section, because this device will create a ZHAthermostat entry in "sensor"
When you switch it on/off in HA it change something ? (Else I will disable the smart plug device)

You haven't another device created in "sensor" part ? try to add it with "add new sensor" in phoscon (don't delete the previous one), just try to add it again.

@d-litvinov
Copy link
Author

d-litvinov commented Oct 4, 2020

When you switch it on/off in HA it change something ?

No. But it updates the switch state, when I switch it on/off by the button on the thermostat.

try to add it with "add new sensor" in phoscon (don't delete the previous one), just try to add it again.

I tried that with no success.

But when I were trying to readd it by removing from the mesh and adding it through Phoscon, I got that sensor for a second:
"6": { "config": { "heatsetpoint": null, "locked": null, "mode": null, "offset": 0, "on": true, "preset": null, "reachable": true, "schedule": {}, "schedule_on": null, "windowopen_set": null }, "ep": 1, "etag": "ca04f5916fb6944912f01a427a7a06d5", "lastseen": "2020-10-04T13:24Z", "manufacturername": "_TZE200_aoclfnxz", "modelid": "TS0601", "name": "Thermostat 6", "state": { "lastupdated": "none", "lowbattery": false, "on": null, "temperature": null, "valve": null }, "type": "ZHAThermostat", "uniqueid": "bc:33:ac:ff:fe:5e:c7:d7-01-0201" }

But then it was replaced by the smart plug. It's weird.

@Smanar
Copy link
Collaborator

Smanar commented Oct 4, 2020

Ok so I have added your device in a blacklist to prevent the plug device creation.

But I don't understand why It was replaced, they can't have the same uniqueid ....
Normally you will have 2 entries, 1 light + 1 sensor

@ogkita
Copy link

ogkita commented Oct 15, 2020

Hello,

The first thing I want to say is thank you for the support this forum gives me, I am very new to this technology.

I'm very interested in this thermostat. @d-litvinov, did the @Smanar solution finally work?

Thank you!

@d-litvinov
Copy link
Author

@ogkita, no I haven’t tested the last version. Sorry, I’m on vacation at the moment, and can’t test it. I’ll check it in 2 weeks.

@ftp27
Copy link

ftp27 commented Oct 16, 2020

I've tried to build the latest commit in @Smanar 's branch tuya. So it was recognized as single light sensor

{
    "etag": "454432e75e25912c36b1438401483348",
    "hascolor": false,
    "lastannounced": "2020-10-16T11:03:40Z",
    "lastseen": "2020-10-16T11:04Z",
    "manufacturername": "Heiman",
    "modelid": "TS0601",
    "name": "Smart plug 4",
    "state": {
        "alert": "none",
        "on": false,
        "reachable": true
    },
    "swversion": null,
    "type": "Smart plug",
    "uniqueid": "bc:33:ac:ff:fe:5e:c8:82-01"
}

Maybe I do something wrong. I do it the very first time. So what can I do to help?

@Smanar
Copy link
Collaborator

Smanar commented Oct 16, 2020

Yep there is a problem, you have "Heiman" as manufacturename, the device can't work with that, all the code is based on the good manufacture name.

You haven't the GUI to read the values again ?

@ftp27
Copy link

ftp27 commented Oct 16, 2020

@Smanar sorry for the quality, it's VNC
image
image

Basic
image
image

Groups
image
Scenes
image

UPD:
I don't know why but now I'm receiving another json:

{
    "etag": "ef7f2ede8b4bc77609aa5376052a66d3",
    "hascolor": false,
    "lastannounced": "2020-10-16T11:03:40Z",
    "lastseen": "2020-10-16T20:13Z",
    "manufacturername": "_TZE200_aoclfnxz",
    "modelid": "TS0601",
    "name": "Smart plug 4",
    "state": {
        "alert": "none",
        "on": true,
        "reachable": true
    },
    "swversion": "0xFFFFFFFF",
    "type": "Smart plug",
    "uniqueid": "bc:33:ac:ff:fe:5e:c8:82-01"
}

@Smanar
Copy link
Collaborator

Smanar commented Oct 16, 2020

Nice, better.
Can you check in "sensor" if you haven't a new one too ?

It will depend if the tuya cluster is reconized on first try, don't work on all device.

@ftp27
Copy link

ftp27 commented Oct 16, 2020

No. Only smart plug

@Smanar
Copy link
Collaborator

Smanar commented Oct 16, 2020

Ok So I have updated the code, on the base of version 85 beta Smanar@2065fca

Now it force the device detection even without tuya cluster for this device

If you don't want to include the device again, just set phoscon in permit join "add new sensor" and read the basic attribute again (cluster 0x000, press the buton "read")

@ogkita
Copy link

ogkita commented Oct 23, 2020

Hello all,

Any progress on this issue?

I expect to receive my thermostat in the next few weeks. Then I can check it out.

Thank you!

@ogkita
Copy link

ogkita commented Oct 30, 2020

Hi @Smanar

I have here the thermostat and i am doing test for include in the deconz network.

When i link the termostat:

  1. I can only see a lights in phoscon web application.
  2. I can not see any more device (no sensor, no switch).

In /lights? api call i get this json:
{
"1": {
"etag": "eeebb8c23b7fb7eb40163ee292b7ab05",
"hascolor": false,
"lastannounced": null,
"lastseen": "2020-10-30T17:53Z",
"manufacturername": "dresden elektronik",
"modelid": "RaspBee II",
"name": "Configuration tool 1",
"state": {
"reachable": true
},
"swversion": null,
"type": "Configuration tool",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
},
"2": {
"etag": "d50809778874780320e29153d1c842b0",
"hascolor": false,
"lastannounced": "2020-10-30T17:30:38Z",
"lastseen": "2020-10-30T17:53Z",
"manufacturername": "_TZE200_aoclfnxz",
"modelid": "TS0601",
"name": "Smart plug 2",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": "0xFFFFFFFF",
"type": "Smart plug",
"uniqueid": "60:a4:23:ff:fe:9f:4f:a7-01"
}
}

In /sensors? api call i get this json:
{
"1": {
"config": {
"configured": true,
"on": true,
"sunriseoffset": 30,
"sunsetoffset": -30
},
"etag": "b8b1fa9f2a3ebc440a03f3af6ccfc7eb",
"manufacturername": "Philips",
"modelid": "PHDL00",
"name": "Daylight",
"state": {
"dark": true,
"daylight": false,
"lastupdated": "2020-10-30T17:42:22.617",
"status": 210,
"sunrise": "2020-10-30T06:42:31",
"sunset": "2020-10-30T17:14:05"
},
"swversion": "1.0",
"type": "Daylight",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
},
"2": {
"config": {
"heatsetpoint": null,
"locked": null,
"mode": "off",
"offset": 0,
"on": true,
"preset": null,
"reachable": true,
"schedule": {
"W127": [
{
"heatsetpoint": 40,
"localtime": "T06:00"
},
{
"heatsetpoint": 42,
"localtime": "T11:30"
},
{
"heatsetpoint": 44,
"localtime": "T13:30"
},
{
"heatsetpoint": 46,
"localtime": "T17:30"
},
{
"heatsetpoint": 48,
"localtime": "T06:00"
},
{
"heatsetpoint": 46,
"localtime": "T12:00"
},
{
"heatsetpoint": 44,
"localtime": "T14:30"
},
{
"heatsetpoint": 42,
"localtime": "T17:30"
},
{
"heatsetpoint": 38,
"localtime": "T06:00"
},
{
"heatsetpoint": 40,
"localtime": "T12:30"
},
{
"heatsetpoint": 42,
"localtime": "T14:30"
},
{
"heatsetpoint": 40,
"localtime": "T18:30"
}
]
},
"schedule_on": null,
"setvalve": null,
"windowopen_set": null
},
"ep": 1,
"etag": "1bbf09191538b1facfbbf770d32fda31",
"lastseen": "2020-10-30T17:53Z",
"manufacturername": "_TZE200_aoclfnxz",
"modelid": "TS0601",
"name": "TS0601",
"state": {
"lastupdated": "none",
"lowbattery": null,
"on": null,
"temperature": null,
"valve": null
},
"type": "ZHAThermostat",
"uniqueid": "60:a4:23:ff:fe:9f:4f:a7-01-0201"
}
}

I try to add de thermostat in the openhab and i get 3 devices:
Daylight (Philips), Daylight Sensor
image

Smart plug 2 (_TZE200_aoclfnxz), On/Off Light
image

TS0601 (_TZE200_aoclfnxz), Thermostat
image

I can only manage the "Smart plug 2", on/off, When I press the on button, the thermostat turns on the screen, off button turns off the screen.

I hope this information help you.

Thank you

@ogkita
Copy link

ogkita commented Oct 30, 2020

Hi @Smanar

One more thing: when I restarted my Raspberry, the two lights in the endpoint /lights? are disappeared.

Thank you.

@ogkita
Copy link

ogkita commented Oct 30, 2020

Hi @Smanar

After rebboting the raspberry, if I flash the raspbee with this command:
sudo GCFFlasher_internal -d /dev/ttyS0 -t 10 -f deCONZ_RaspBeeII_0x26660700.bin.GCF

Then i can see the smart plug 2 in /lights? endpoint

{
"1": {
"etag": "fe4d98e1b44d378727afef008d3cfb9f",
"hascolor": false,
"lastannounced": null,
"lastseen": "2020-10-30T20:12Z",
"manufacturername": "dresden elektronik",
"modelid": "RaspBee II",
"name": "Configuration tool 1",
"state": {
"reachable": true
},
"swversion": null,
"type": "Configuration tool",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
},
"2": {
"etag": "fe4d98e1b44d378727afef008d3cfb9f",
"hascolor": false,
"lastannounced": "2020-10-30T17:30:38Z",
"lastseen": "2020-10-30T20:12Z",
"manufacturername": "_TZE200_aoclfnxz",
"modelid": "TS0601",
"name": "Smart plug 2",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": "0xFFFFFFFF",
"type": "Smart plug",
"uniqueid": "60:a4:23:ff:fe:9f:4f:a7-01"
}
}

And i can see de version in the web application:
image

If i reboot and dont flash, the raspbee ii does not show lights and version in web app
image

Thank you

@Smanar
Copy link
Collaborator

Smanar commented Oct 30, 2020

Hello,

So first when you have "not connected" at firmware, it s not good, it mean deconz don't see the gateway, so better to use the other version.

I can only manage the "Smart plug 2", on/off, When I press the on button, the thermostat turns on the screen, off button turns off the screen.

Realy nice information, first time I see that, and the screen stay on, or turn off itself after a time ?

In reality I need to disable the device you are seen in "light", for you have only the one in "sensor", but I did know the last feature, now it s another question ...

But more important, need to check what is working, what is not working, and what the device don't have.

  • Temperature is not working
  • heatsetpoint is not working
  • Schedule is working, it s the first tuya it work natively, do you have a way to compare values ?
  • all options are not working, windowsopen, lock, battery, .....

I have updated the code according to your device, you will have more features working.
To update code

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

I haven't tested the code on my side, so if you have error message during compilation (except warning), stop the procedure

Edit:
ok, i have found for the display on/off, it because they are using same value than for switch, it s called "stand
by" option

@ogkita
Copy link

ogkita commented Oct 31, 2020

Hi @Smanar

I updated de git, compile without errors, delete device, and start again. this is that i have:

/lights?
{
"1": {
"etag": "088b17c4a2e088c243752ad9405eda10",
"hascolor": false,
"lastannounced": null,
"lastseen": "2020-10-31T06:39Z",
"manufacturername": "dresden elektronik",
"modelid": "RaspBee II",
"name": "Configuration tool 1",
"state": {
"reachable": true
},
"swversion": null,
"type": "Configuration tool",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
},
"3": {
"etag": "4bde907c04111e40f5e463a6492b6737",
"hascolor": false,
"lastannounced": null,
"lastseen": "2020-10-31T06:40Z",
"manufacturername": "Unknown",
"modelid": "TS0601",
"name": "Smart plug 3",
"state": {
"alert": "none",
"on": false,
"reachable": true
},
"swversion": null,
"type": "Smart plug",
"uniqueid": "60:a4:23:ff:fe:9f:4f:a7-01"
}
}

/sensors?
{
"1": {
"config": {
"configured": true,
"on": true,
"sunriseoffset": 30,
"sunsetoffset": -30
},
"etag": "c86d23c1dd5624a5ccb797ddd4442f55",
"manufacturername": "Philips",
"modelid": "PHDL00",
"name": "Daylight",
"state": {
"dark": true,
"daylight": false,
"lastupdated": "2020-10-31T06:38:44.807",
"status": 130,
"sunrise": "2020-10-31T06:43:41",
"sunset": "2020-10-31T17:12:52"
},
"swversion": "1.0",
"type": "Daylight",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
},
"2": {
"config": {
"heatsetpoint": null,
"locked": null,
"mode": "off",
"offset": 0,
"on": true,
"preset": null,
"reachable": true,
"schedule": {
"W127": [
{
"heatsetpoint": 40,
"localtime": "T06:00"
},
{
"heatsetpoint": 42,
"localtime": "T11:30"
},
{
"heatsetpoint": 44,
"localtime": "T13:30"
},
{
"heatsetpoint": 46,
"localtime": "T17:30"
},
{
"heatsetpoint": 48,
"localtime": "T06:00"
},
{
"heatsetpoint": 46,
"localtime": "T12:00"
},
{
"heatsetpoint": 44,
"localtime": "T14:30"
},
{
"heatsetpoint": 42,
"localtime": "T17:30"
},
{
"heatsetpoint": 38,
"localtime": "T06:00"
},
{
"heatsetpoint": 40,
"localtime": "T12:30"
},
{
"heatsetpoint": 42,
"localtime": "T14:30"
},
{
"heatsetpoint": 40,
"localtime": "T18:30"
}
]
},
"schedule_on": null,
"setvalve": null,
"windowopen_set": null
},
"ep": 1,
"etag": "8babac84e4da63a596029dcfabb15a01",
"lastseen": "2020-10-31T06:40Z",
"manufacturername": "_TZE200_aoclfnxz",
"modelid": "TS0601",
"name": "TS0601",
"state": {
"lastupdated": "none",
"on": null,
"temperature": null
},
"type": "ZHAThermostat",
"uniqueid": "60:a4:23:ff:fe:9f:4f:a7-01-0201"
}
}

in the openhab pannel adding devices:
image

In the openhab pannel things:
image
image

In the openhab control pannel:
image
image
image

Now the difference is that in the things panel in openhab the thermostat appears online.

If I turn the display on the thermostat physically, the smart plug 3 device is updated on the openhab panel to on. After a few seconds when the screen on the thermostat is physically turned off, on the openhab panel, the smart plug 3 device is turned off.

I hope this information help you.

Thank you

@Smanar
Copy link
Collaborator

Smanar commented Oct 31, 2020

After some time, you still have no value for "state/temperature" and "config/heatsetpoint" ?

I have take the tuya value from z2m project and it s the same device, strange you haven't the values ...

If you still haven't no value can you run deconz in debug mode

deCONZ --dbg-error=2 --dbg-info=2 --dbg-zdp=0 --dbg-zcl=0 --db-aps=0 --dbg-http=0 --dbg-ota=0

In log, every time your thermostat is sending information you will have debug line like

Tuya debug 4 : xxxxxxxxxxxxxxx
Tuya debug 5 : xxxxxxxxxxxxxxxxxxxxxxx

Im using them to find tuya value.

@ogkita
Copy link

ogkita commented Oct 31, 2020

Hi @Smanar

[Smanar] After some time, you still have no value for "state/temperature" and "config/heatsetpoint" ?
[Oscar No, any value

Here you have some debug data:
11:40:03:323 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c1100200040000000e
11:40:03:323 Tuya debug 5 : Status: 6 Transid: 193 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:40:03:344 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c2100200040000000e
11:40:03:344 Tuya debug 5 : Status: 6 Transid: 194 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:40:03:365 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c3100200040000000e
11:40:03:365 Tuya debug 5 : Status: 6 Transid: 195 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:40:32:682 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bc18020004000000b9
11:40:32:682 Tuya debug 5 : Status: 6 Transid: 188 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:40:32:881 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bc18020004000000b9
11:40:32:881 Tuya debug 5 : Status: 6 Transid: 188 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:40:33:082 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bc18020004000000b9
11:40:33:083 Tuya debug 5 : Status: 6 Transid: 188 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:40:33:290 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bc18020004000000b9
11:40:33:290 Tuya debug 5 : Status: 6 Transid: 188 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:41:32:298 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bd18020004000000b9
11:41:32:298 Tuya debug 5 : Status: 6 Transid: 189 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:41:32:499 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bd18020004000000b9
11:41:32:499 Tuya debug 5 : Status: 6 Transid: 189 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:41:32:701 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bd18020004000000b9
11:41:32:701 Tuya debug 5 : Status: 6 Transid: 189 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:41:32:904 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bd18020004000000b9
11:41:32:904 Tuya debug 5 : Status: 6 Transid: 189 Dp: 536 (0x02,0x18) Fn: 0 Data 185
11:41:35:101 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06be100200040000000e
11:41:35:101 Tuya debug 5 : Status: 6 Transid: 190 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:35:315 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06be100200040000000e
11:41:35:315 Tuya debug 5 : Status: 6 Transid: 190 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:35:504 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06be100200040000000e
11:41:35:504 Tuya debug 5 : Status: 6 Transid: 190 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:35:706 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06be100200040000000e
11:41:35:706 Tuya debug 5 : Status: 6 Transid: 190 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:35:906 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06be100200040000000e
11:41:35:906 Tuya debug 5 : Status: 6 Transid: 190 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:36:311 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06bf100200040000000e
11:41:36:311 Tuya debug 5 : Status: 6 Transid: 191 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:36:715 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c0100200040000000e
11:41:36:715 Tuya debug 5 : Status: 6 Transid: 192 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:37:118 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c1100200040000000e
11:41:37:118 Tuya debug 5 : Status: 6 Transid: 193 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:37:522 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c2100200040000000e
11:41:37:522 Tuya debug 5 : Status: 6 Transid: 194 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:37:926 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c3100200040000000e
11:41:37:926 Tuya debug 5 : Status: 6 Transid: 195 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:38:337 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c4100200040000000e
11:41:38:337 Tuya debug 5 : Status: 6 Transid: 196 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:38:734 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c5100200040000000e
11:41:38:734 Tuya debug 5 : Status: 6 Transid: 197 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:39:136 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c6100200040000000e
11:41:39:136 Tuya debug 5 : Status: 6 Transid: 198 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:39:540 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c7100200040000000e
11:41:39:540 Tuya debug 5 : Status: 6 Transid: 199 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:39:943 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c8100200040000000e
11:41:39:943 Tuya debug 5 : Status: 6 Transid: 200 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:40:347 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06c9100200040000000e
11:41:40:347 Tuya debug 5 : Status: 6 Transid: 201 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:40:751 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06ca100200040000000e
11:41:40:751 Tuya debug 5 : Status: 6 Transid: 202 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:41:157 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06cb100200040000000e
11:41:41:157 Tuya debug 5 : Status: 6 Transid: 203 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:41:557 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06cc100200040000000e
11:41:41:557 Tuya debug 5 : Status: 6 Transid: 204 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:41:963 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06cd100200040000000e
11:41:41:963 Tuya debug 5 : Status: 6 Transid: 205 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:42:365 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06ce100200040000000e
11:41:42:365 Tuya debug 5 : Status: 6 Transid: 206 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:42:769 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06cf100200040000000e
11:41:42:769 Tuya debug 5 : Status: 6 Transid: 207 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:43:173 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d0100200040000000e
11:41:43:173 Tuya debug 5 : Status: 6 Transid: 208 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:43:576 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d1100200040000000e
11:41:43:576 Tuya debug 5 : Status: 6 Transid: 209 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:43:979 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d2100200040000000e
11:41:43:979 Tuya debug 5 : Status: 6 Transid: 210 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:44:383 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d3100200040000000e
11:41:44:383 Tuya debug 5 : Status: 6 Transid: 211 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:44:786 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d4100200040000000e
11:41:44:786 Tuya debug 5 : Status: 6 Transid: 212 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:45:189 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d5100200040000000e
11:41:45:189 Tuya debug 5 : Status: 6 Transid: 213 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:45:595 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d6100200040000000e
11:41:45:595 Tuya debug 5 : Status: 6 Transid: 214 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:45:997 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d7100200040000000e
11:41:45:997 Tuya debug 5 : Status: 6 Transid: 215 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:46:401 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d8100200040000000e
11:41:46:401 Tuya debug 5 : Status: 6 Transid: 216 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:46:822 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06d9100200040000000e
11:41:46:822 Tuya debug 5 : Status: 6 Transid: 217 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:47:215 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06da100200040000000e
11:41:47:215 Tuya debug 5 : Status: 6 Transid: 218 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:47:630 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06db100200040000000e
11:41:47:630 Tuya debug 5 : Status: 6 Transid: 219 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:48:017 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06dc100200040000000e
11:41:48:017 Tuya debug 5 : Status: 6 Transid: 220 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:41:48:420 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 06dd100200040000000e
11:41:48:420 Tuya debug 5 : Status: 6 Transid: 221 Dp: 528 (0x02,0x10) Fn: 0 Data 14
11:42:31:908 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 000618020004000000be
11:42:31:908 Tuya debug 5 : Status: 0 Transid: 6 Dp: 536 (0x02,0x18) Fn: 0 Data 190
11:42:32:124 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 000618020004000000be
11:42:32:124 Tuya debug 5 : Status: 0 Transid: 6 Dp: 536 (0x02,0x18) Fn: 0 Data 190
11:42:32:310 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 000618020004000000be
11:42:32:310 Tuya debug 5 : Status: 0 Transid: 6 Dp: 536 (0x02,0x18) Fn: 0 Data 190
11:42:32:513 Tuya debug 4 : Address 0x60A423FFFE9F4FA7 Payload 000618020004000000be
11:42:32:513 Tuya debug 5 : Status: 0 Transid: 6 Dp: 536 (0x02,0x18) Fn: 0 Data 190

Any test do you need more only let me know it.

Thank you

@ogkita
Copy link

ogkita commented Oct 31, 2020

Hi Again @Smanar

Here you have a complete log for some time.

Thank you

20201031 1352 deconz.log

@Smanar
Copy link
Collaborator

Smanar commented Oct 31, 2020

Ok I have found the problem, my bad ^^
It s because of the light device, the code use only the "light" part and ignore the sensor part, if you delete the "light" sensor, the code surely work.

I have updated the code, I think it will be better, it will prevent the light creation and can ignore it later.

@ogkita
Copy link

ogkita commented Oct 31, 2020

Hi @Smanar

No changes,

When you say "I have updated the code", do i need update my git and compile library again?

Sorry, maybe i doing something wrong

Thank you.

@Smanar
Copy link
Collaborator

Smanar commented Oct 31, 2020

Yep, but faster this time

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

@ogkita
Copy link

ogkita commented Oct 31, 2020

Hi @Smanar

Now it is diferent ;-)

/lights?
{
"1": {
"etag": "b354aaa7ad21e67fcc6bee0122d163a3",
"hascolor": false,
"lastannounced": null,
"lastseen": "2020-10-31T17:06Z",
"manufacturername": "dresden elektronik",
"modelid": "RaspBee II",
"name": "Configuration tool 1",
"state": {
"reachable": true
},
"swversion": null,
"type": "Configuration tool",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
}
}

/switch?
[
{
"error": {
"address": "/switch",
"description": "method, GET, not available for resource, /switch",
"type": 4
}
}
]

/sensors?
{
"1": {
"config": {
"configured": true,
"on": true,
"sunriseoffset": 30,
"sunsetoffset": -30
},
"etag": "7f194c898b2054c3c94694e7bef7f906",
"manufacturername": "Philips",
"modelid": "PHDL00",
"name": "Daylight",
"state": {
"dark": false,
"daylight": false,
"lastupdated": "2020-10-31T16:53:02.811",
"status": 180,
"sunrise": "2020-10-31T06:43:41",
"sunset": "2020-10-31T17:12:52"
},
"swversion": "1.0",
"type": "Daylight",
"uniqueid": "00:21:2e:ff:ff:06:1b:54-01"
},
"2": {
"config": {
"heatsetpoint": 2200,
"locked": true,
"mode": "auto",
"offset": 50,
"on": true,
"preset": null,
"reachable": false,
"schedule": {
"W127": [
{
"heatsetpoint": 40,
"localtime": "T06:00"
},
{
"heatsetpoint": 42,
"localtime": "T11:30"
},
{
"heatsetpoint": 44,
"localtime": "T13:30"
},
{
"heatsetpoint": 46,
"localtime": "T17:30"
},
{
"heatsetpoint": 48,
"localtime": "T06:00"
},
{
"heatsetpoint": 46,
"localtime": "T12:00"
},
{
"heatsetpoint": 44,
"localtime": "T14:30"
},
{
"heatsetpoint": 42,
"localtime": "T17:30"
},
{
"heatsetpoint": 38,
"localtime": "T06:00"
},
{
"heatsetpoint": 40,
"localtime": "T12:30"
},
{
"heatsetpoint": 42,
"localtime": "T14:30"
},
{
"heatsetpoint": 40,
"localtime": "T18:30"
}
]
},
"schedule_on": null,
"setvalve": null,
"windowopen_set": null
},
"ep": 1,
"etag": "73f0c1567b0dd3f1ce08a39f0e9995cb",
"lastseen": "2020-10-31T16:56Z",
"manufacturername": "_TZE200_aoclfnxz",
"modelid": "TS0601",
"name": "TS0601",
"state": {
"lastupdated": "none",
"on": null,
"temperature": 1800
},
"type": "ZHAThermostat",
"uniqueid": "60:a4:23:ff:fe:9f:4f:a7-01-0201"
}
}

In openhab things pannel i have this devices:
image
image

In openhab control pannel i have this data in the thermostat:
image

I can see:

  • Temperature, but this value is not correct, in display i have 20 grades.
  • Target temperature, but this value is not correct, i have set the thermostat on 16 grades.
  • Mode, It the same, I change this value and nothing happend.
  • Offset, I don't know what it means

Thank you

@guny74
Copy link

guny74 commented Dec 30, 2022

Hello,
I have the problem to set the "offset" or "heatsetpoint" to values x.5 maybe 20.5 Degress.
From the display it works fine and the Deconz node send values like "2050"

I tried to set the heatsetpoint with e.g, deconz node red with values like 1950 / 2050 or so or the offset with -150 but all it rounded down to "1900" / "2000" or "-100".
Also via DECONZ REST API the same behavior....

Is this a "bug" in the deconz implementation or a limitation of the thermostat ?

@Smanar
Copy link
Collaborator

Smanar commented Dec 31, 2022

Depend of device, but it generaly don't work same on TRV.
On the model "_TZE200_aoclfnxz" the value need to be between -600 and 600 and it s a tuya request, the value is send to the device, and it's the device itself than do "something" with it, probable the "temperature compensation"

@guny74
Copy link

guny74 commented Dec 31, 2022

I have the Model "_TZE200_aoclfnxz" (TS0601), in the description I did not found any hint, that there ist an "feature" thats only allows temperture without "x.5" digits. At the display I also could set this correctly to e.g. 20.5 degrees
I there a way to debug an see, which value send exaclty to the device ?

Regards and I wish a happy new year

@Smanar
Copy link
Collaborator

Smanar commented Dec 31, 2022

This device don't support x.5 value for heatsetpoint.
It's temperature compensation, I think it's internaly.

Yes you can see value incoming and outcoming from tuya device in log with flag "info_l2"

@guny74
Copy link

guny74 commented Dec 31, 2022

hm ok, strange that I could set it via display at the device.

ok, thank you

@guny74
Copy link

guny74 commented Jan 4, 2023

Hopefully one last question....during tests I noticed, that the schedule (week programm) is always "empty".
Is this implemented ?

Thank you

@Smanar
Copy link
Collaborator

Smanar commented Jan 4, 2023

There is in the code, lines about this device, but I don't remember if it was finished, try to set it manualy on the device, you will see if it's updated on the device json too.

Somes informations here #2393 (comment)

@guny74
Copy link

guny74 commented Jan 4, 2023

I tried that way of reengenierung before asking. I set schedule on device and via zigbee2mqtt (as altenative), but the schedule is alway empty using deconz. So I did now know how the sub elements in the schedule are named. I tried some of the linked issue, but it does not work. Maybe I have a deeper look tomorrow or add the device to zigbee2mqtt at a separate controler.

Thank you regards

@Smanar
Copy link
Collaborator

Smanar commented Jan 5, 2023

You can see perhaps error on logs with "info" and "info_l2" on deconz.
But it's not possible to set them manually on the device to see result on the API ?

@guny74
Copy link

guny74 commented Jan 5, 2023

Where could I see this errors ? I user Deconz docker....

Schedule on device is possible and is "on", than requesting per REST API .../sensors/164/ response is

{ "config": { "heatsetpoint": 2100, "locked": false, "offset": -300, "on": true, "preset": "auto", "reachable": true, "schedule": {}, "schedule_on": true, "setvalve": false }, "ep": 1, "etag": "13c0ca2a068e7cb98a9c6167b3d30664", "lastannounced": null, "lastseen": "2023-01-05T19:45Z", "manufacturername": "_TZE200_aoclfnxz", "modelid": "TS0601", "name": "Thermostat 164", "state": { "lastupdated": "2023-01-05T19:44:34.743", "on": false, "temperature": 2100 }, "type": "ZHAThermostat", "uniqueid": "00:3c:84:ff:fe:f9:8d:3a-01-0201" }

here "schedule": {},

Calling .../sensors/164/config

[ { "error": { "address": "/sensors/164/config", "description": "resource, /sensors/164/config, not available", "type": 3 } } ]

or .../sensors/164/config/schedule

[ { "error": { "address": "/sensors/164/config/schedule", "description": "resource, /sensors/164/config/schedule, not available", "type": 3 } } ]

@Smanar
Copy link
Collaborator

Smanar commented Jan 6, 2023

Where could I see this errors ? I user Deconz docker....

You haven't access to the GUI ? using VNC ?

You have 2 solutions to make test.

@guny74
Copy link

guny74 commented Jan 6, 2023

No, I only had a look via portainer to the log console of the docker, where e.g. the tuya debug info are visible.

I postest the responses from REST API above. so the schedule is empty although I set it via display. I did this several times.
Also I deleted the thermostat an add it again, but no change.

Ok, I did now know that I could see the "deconz ui" via VNC...I found the debug view with INFO und INFO_l2,
most of the Log I could see via portainer from teh docker console, but now I colud active info_l2.
I see some tuya communication, but could now "decode" ist and see no errors...

But "schedule" keeps empty = {}

@Smanar
Copy link
Collaborator

Smanar commented Jan 7, 2023

.I found the debug view with INFO und INFO_l2

its perfect.

I see some tuya communication, but could now "decode" ist and see no errors

Every time the device send a report you need to have this line, visible with "info"

        DBG_Printf(DBG_INFO, "Tuya debug 4 : Address 0x%016llX Payload %s\n", ind.srcAddress().ext(), qPrintable(zclFrame.payload().toHex()));
        DBG_Printf(DBG_INFO, "Tuya debug 5 : Status: %u Transid: %u Dp: %u (0x%02X,0x%02X) Fn: %u Data %d\n", status, transid, dp, dp_type, dp_identifier, fn, data);

when you set the schedule on the device, you need to have a log in same time on deconz (if all is working)

And if you try a POST to the url /sensors/ID/config/schedule/W4
With body [{"localtime": "T00:05", "heatsetpoint": 1500}]

@guny74
Copy link

guny74 commented Jan 7, 2023

Strange Thing.

After the last "new Pairing" (this night) in the UI this additional part appears.... so I could see this new part in the UI (VNC)
image

POSTing to /sensors/165/config/schedule/W4 also works (now)....

I also tried /sensors/165/config/schedule/W127 also works.....

Thank you very much for your support.... one last question.... I found some hints, for what "w" (W4 / w36 and so on) stands for, but is the a complete desrciption ?

@Smanar
Copy link
Collaborator

Smanar commented Jan 7, 2023

????
This device don't use the 0x0201 thermostat but the Tuya one, IDK what happen ....

https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/thermostat.cpp

 *   Day of Week: bitmap8 [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Away]
 *                bit         0       1       2         3        4         5        6       7
 *   Example:
 *   Monday, Tuesday, Thursday, Friday = 0011 0110 = 0x36
 *        |        |         |     ^-------^|  ||
 *        |        |          ---------------  ||
 *        |        -----------------------------|
 *        ---------------------------------------
 *

W64 is Monday, W32 Tuesday, W1 Sunday. W124 is weekdays, W3 is weekends

@guny74
Copy link

guny74 commented Jan 7, 2023

Thank you, but I did now make the "biggest" mistake..."never change a running system"... I now did a new pairung, and the 0x0201 is gone and the "schedule" is no longer working again.... gggrrr

Several repairing does not bring back the 0x0201....

image
Is this normal, that it would markes as "smart plug" ?

I think I will give up for a the weekend....

@Smanar
Copy link
Collaborator

Smanar commented Jan 7, 2023

Yes all tuya stuff are "Smart plug", it s the value returned by their firmware.

I now did a new pairung, and the 0x0201 is gone and the "schedule" is no longer working again

It's normal the cluster disapear, for me this device don't have it.
But why the command is working only if the cluster exist .... There is probably a new check in code that block the fonction.

Can you show the request you made and the error as result ?
Because I m checking thoses one #3304 (comment) and it's not the one you need to have

It seem the only working one for tuya is

/*! POST, DELETE /api/<apikey>/sensors/<id>/config/schedule/Wbbb

@guny74
Copy link

guny74 commented Jan 7, 2023

Ok, thank for checking...

  • I made a schedule on the device and via POSTMAN I asked the sensor data
    GET .../sensors/165

Response
{ "config": { "heatsetpoint": 1900, "locked": false, "offset": -300, "on": true, "preset": "auto", "reachable": true, "schedule": {}, "schedule_on": false, "setvalve": false }, "ep": 1, "etag": "ec7ca01d2fe48ebb62a130a19b3d7cb2", "lastannounced": null, "lastseen": "2023-01-07T18:31Z", "manufacturername": "_TZE200_aoclfnxz", "modelid": "TS0601", "name": "Thermostat 165", "state": { "lastupdated": "2023-01-07T18:31:25.385", "on": false, "temperature": 2300 }, "type": "ZHAThermostat", "uniqueid": "00:3c:84:ff:fe:f9:8d:3a-01-0201" }

Strange that the schedules from device does not visible..

Now, I tried to set schedule again POST /sensors/165/config/schedule/W4

Payload
[{"localtime": "T00:05", "heatsetpoint": 1500}]
and it worked (again).

But schedule changes at the devices does not come back zu "Deconz"....

So I try out tomorow to build good "schedules"... the first values shown at the device, after setting via "REST API" look a little bit strange....

Is there a way to set different schedules at once with one call ?

Maybe POST to POST /sensors/165/
e.g.
Payload
{ "config": { "schedule": { "W4": [ { "heatsetpoint": 1000, "localtime": "T00:01" } ], "W127": [ { "heatsetpoint": 1000, "localtime": "T00:01" }, { "heatsetpoint": 800, "localtime": "T08:05" }, { "heatsetpoint": 2100, "localtime": "T18:05" } ] } } }

Thanks

@Smanar
Copy link
Collaborator

Smanar commented Jan 8, 2023

So you mean making a POST to /sensors/165/ work but not the POST to /sensors/165/config/schedule/W4 ?

@guny74
Copy link

guny74 commented Jan 8, 2023

Sorry, no... the Post to the POST to /sensors/165/config/schedule/W4 works, but I want to do a POST to /sensors/165/ or /sensors/165/config to set multiple "Wbbb" values.... This does not work, maybe this is not supported...

But I give up, because the "0201" is even back and I could set the Values via REST API, but at the device are very strange "Values"...they look like a screen defect....

So for this device I switch to zigbee2mqtt...at the moment, I could only set the same schedule for all Weekdays, but the I have to do some stuff at node red to make different schedules for each day....

Thank you for your support so far.

@Mimiix
Copy link
Collaborator

Mimiix commented Feb 8, 2023

Re openeing as another request came in.

@Mimiix Mimiix reopened this Feb 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

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 github-actions bot added the stale label Mar 2, 2023
@github-actions
Copy link
Contributor

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.

@scrap84
Copy link

scrap84 commented Jul 29, 2023

I have some new BTH-002 devices, which are coming in with the manufacturer code TZE204_aoclfnxz, is it possible to add this as well?

image

@Smanar
Copy link
Collaborator

Smanar commented Jul 30, 2023

        fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_aoclfnxz'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_ztvwu4nk'},
            {modelID: 'TS0601', manufacturerName: '_TZE204_5toc8efa'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_5toc8efa'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_ye5jkfsb'},
            {modelID: 'TS0601', manufacturerName: '_TZE204_aoclfnxz'},
            {modelID: 'TS0601', manufacturerName: '_TZE200_u9bfwha0'}],

All of them are clone, but different than this one, need to make a new DDF, better to make a new device support.

Will be probably this DDF https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/tuya/_TZE200_h4cgnbzg_trv.json

But the device can have special features else Z2M will have mix them.

@scrap84
Copy link

scrap84 commented Jul 31, 2023

Done, see #7135

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.