dresden-elektronik / deconz-rest-plugin

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

Saswell SEA801-Zigbee TRV #3109

Closed rotragit closed 4 years ago

rotragit commented 4 years ago

SASWELL-SEA801-zigbee-wifi-Regolatore-di-Temperatura-del-Termostato-riscaldamento-programmabile-lavoro-con-tuya-gateway

Device

This is a TRV valve from Saswell. Joined deconz using Phoscon -> Sensors. Attached is the screenshot, no useful information seem to be present in other clusters.

Attached SEA801.zip with sniffing the operations when connected to a Tuya Zigbee Gateway. Room temperature was 28°C. Temperature in the filenames are without the comma (200 = 20.0°C, 165 = 16.5°C).

At the moment I have a Tuya Zigbee Gateway, but it's not mine. I was unable to find the Netwok key while sniffing. Could it be it's not encrypted?

SEA801-basic-cluster

SEA801.zip

Oderik commented 3 years ago

It's 0x0000 or 0x1002, 1/2 chance to have the good one.

@Smanar mine says 0x1002. Is that good or bad news?

Can I expect support for the device in an upcoming release? I don't know how to test a current beta release (without tearing apart my current HASS.io installation that's also hosting my Deconz bridge), so I have to wait until any change makes it into this: https://github.com/home-assistant/addons/tree/master/deconz

Smanar commented 3 years ago

Bad, sorry, I have write the code for the other. Can you confirm the model id and the mac adress for your device pls ? To add it in code.

And yes, If the modification is just to add a manufacture number I think it can be validated on the future stable.

Oderik commented 3 years ago

IEEE / MAC: bc33acfffe5262a0 Model: TS0601 Vendor: _TZE200_c88teujp

image image image

EDIT: Here is some Deconz log output. A nearby Osram light bulp behaves strange since I put the thermostat nearby for testing. I hope this has something to do with misunderstood telegrams of the thermostat that is still not recognized correctly.

13:13:13:906 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:13:14:953 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00046905000100
13:13:14:954 Tuya debug 5 : Status: 0 Transid: 4 Dp: 1385 (0x05,0x69) Fn: 0 Data 0
13:13:17:975 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:13:18:988 Tuya : data length excess, not managed yet
13:13:18:990 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00ff7b00001104016800c801e000a0043800c8052800a0
13:13:18:991 Tuya debug 5 : Status: 0 Transid: 255 Dp: 123 (0x00,0x7B) Fn: 0 Data 67201024
13:13:19:830 dev /dev/ttyAMA0
13:13:19:831 GW firmware version: 0x26610700
13:13:22:395 Bind response success for 0x84182600000e2400 ep: 0x03 cluster: 0x0006
13:13:22:396 skip configure report for cluster: 0x0006 attr: 0x0000 of node 0x84182600000E2400 (seems to be active)
13:13:24:441 Bind response success for 0x84182600000e2400 ep: 0x03 cluster: 0x0008
13:13:24:442 skip configure report for cluster: 0x0008 attr: 0x0000 of node 0x84182600000E2400 (seems to be active)
13:13:26:467 Bind response success for 0x84182600000e2400 ep: 0x03 cluster: 0x0300
13:13:26:468 skip configure report for cluster: 0x0300 attr: 0x0007 of node 0x84182600000E2400 (seems to be active)
13:13:26:469 skip configure report for cluster: 0x0300 attr: 0x0003 of node 0x84182600000E2400 (wait reading or unsupported)
13:13:26:470 skip configure report for cluster: 0x0300 attr: 0x0004 of node 0x84182600000E2400 (wait reading or unsupported)
13:13:26:471 skip configure report for cluster: 0x0300 attr: 0x0008 of node 0x84182600000E2400 (seems to be active)
13:13:26:829 Current channel 15
13:13:26:850 Device TTL 5040 s flags: 0x7
13:13:29:500 Tuya : data length excess, not managed yet
13:13:29:501 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 01037f00001104016800c801e000a0043800c8052800a0
13:13:29:502 Tuya debug 5 : Status: 1 Transid: 3 Dp: 127 (0x00,0x7F) Fn: 0 Data 67201024
13:13:29:835 dev /dev/ttyAMA0
13:13:29:836 GW firmware version: 0x26610700
13:13:36:281 Set sensor check interval to 100 milliseconds
13:13:39:836 dev /dev/ttyAMA0
13:13:39:837 GW firmware version: 0x26610700
13:13:40:967 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:13:41:991 Tuya : data length excess, not managed yet
13:13:41:992 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 01048000001104016800c801e000a0043800c8052800a0
13:13:41:993 Tuya debug 5 : Status: 1 Transid: 4 Dp: 128 (0x00,0x80) Fn: 0 Data 67201024
13:13:44:985 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:13:45:993 Tuya : data length excess, not managed yet
13:13:45:994 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 000d6e000018000000000000000000000000000000000000000000000000
13:13:45:995 Tuya debug 5 : Status: 0 Transid: 13 Dp: 110 (0x00,0x6E) Fn: 0 Data 0
13:13:49:839 dev /dev/ttyAMA0
13:13:49:840 GW firmware version: 0x26610700
13:13:56:010 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:13:57:011 Tuya : data length excess, not managed yet
13:13:57:012 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 000d6e000018000000000000000000000000000000000000000000000000
13:13:57:014 Tuya debug 5 : Status: 0 Transid: 13 Dp: 110 (0x00,0x6E) Fn: 0 Data 0
13:13:59:846 dev /dev/ttyAMA0
13:13:59:848 GW firmware version: 0x26610700
13:14:00:965 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:01:978 Tuya : data length excess, not managed yet
13:14:01:979 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00107200000c000000000000000000000000
13:14:01:979 Tuya debug 5 : Status: 0 Transid: 16 Dp: 114 (0x00,0x72) Fn: 0 Data 0
13:14:04:001 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:04:464 Tuya : data length excess, not managed yet
13:14:04:464 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00147a00000c000000000000000000000000
13:14:04:465 Tuya debug 5 : Status: 0 Transid: 20 Dp: 122 (0x00,0x7A) Fn: 0 Data 0
13:14:06:914 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:08:013 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 000266020004000000b5
13:14:08:014 Tuya debug 5 : Status: 0 Transid: 2 Dp: 614 (0x02,0x66) Fn: 0 Data 181
13:14:09:840 dev /dev/ttyAMA0
13:14:09:842 GW firmware version: 0x26610700
13:14:12:838 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:13:941 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00016501000101
13:14:13:941 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
13:14:16:948 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:17:980 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00076c01000100
13:14:17:981 Tuya debug 5 : Status: 0 Transid: 7 Dp: 364 (0x01,0x6C) Fn: 0 Data 0
13:14:18:440 [INFO] - No button handler for: RWL021 endpoint: 0x02 cluster: 0x0001 command: 0x0A payload[0]: 021
13:14:18:440 ZCL attribute report 0x0017880103A56C3F for cluster: 0x0001, ep: 0x02, frame control: 0x08, mfcode: 0x0000 
13:14:19:833 dev /dev/ttyAMA0
13:14:19:834 GW firmware version: 0x26610700
13:14:26:827 Current channel 15
13:14:26:851 Device TTL 4980 s flags: 0x7
13:14:28:473 Tuya : data length excess, not managed yet
13:14:28:474 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00147a00000c000000000000000000000000
13:14:28:475 Tuya debug 5 : Status: 0 Transid: 20 Dp: 122 (0x00,0x7A) Fn: 0 Data 0
13:14:29:835 dev /dev/ttyAMA0
13:14:29:836 GW firmware version: 0x26610700
13:14:31:872 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:32:967 Tuya : data length excess, not managed yet
13:14:32:968 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00ff7b00001104016800c801e000a0043800c8052800a0
13:14:32:969 Tuya debug 5 : Status: 0 Transid: 255 Dp: 123 (0x00,0x7B) Fn: 0 Data 67201024
13:14:35:493 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:35:981 sensor 3 (MS01): disable presence
13:14:35:986 Tuya : data length excess, not managed yet
13:14:35:987 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 01037f00001104016800c801e000a0043800c8052800a0
13:14:35:988 Tuya debug 5 : Status: 1 Transid: 3 Dp: 127 (0x00,0x7F) Fn: 0 Data 67201024
13:14:36:181 Set sensor check interval to 1000 milliseconds
13:14:38:991 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:39:845 dev /dev/ttyAMA0
13:14:39:846 GW firmware version: 0x26610700
13:14:39:967 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00056a01000100
13:14:39:968 Tuya debug 5 : Status: 0 Transid: 5 Dp: 362 (0x01,0x6A) Fn: 0 Data 0
13:14:46:195 DeviceAnnce of SensorNode: 0xBC33ACFFFE5262A0 [1]
13:14:47:160 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 00056a01000100
13:14:47:162 Tuya debug 5 : Status: 0 Transid: 5 Dp: 362 (0x01,0x6A) Fn: 0 Data 0
13:14:49:825 dev /dev/ttyAMA0
13:14:49:826 GW firmware version: 0x26610700
13:14:57:662 Tuya : data length excess, not managed yet
13:14:57:663 Tuya debug 4 : Address 0xBC33ACFFFE5262A0 Payload 01007c00001104016800c801e000a0043800c8052800a0
13:14:57:664 Tuya debug 5 : Status: 1 Transid: 0 Dp: 124 (0x00,0x7C) Fn: 0 Data 67201024
13:14:59:834 dev /dev/ttyAMA0
13:14:59:835 GW firmware version: 0x26610700
13:15:08:164 Tuya : data length excess, not managed yet
Smanar commented 3 years ago

Ok so the device was realy not in the code, it s a new variant (again) I have modified the code, do you have an unix machine to test it if you can ?

Oderik commented 3 years ago

I have a RaspBee II connected to a Raspberry Pi 4 running Hass.io, the "official" docker based Home Assistant distribution. I would love to test your code, but I am not sure how to achieve that.

Is there an option to replace my official HA -> official Deconz (docker image) with a development version? Problem is (I guess) that the system is more or less missing standard linux tools because it's tailored to run HA only.

Of course I could setup a testing environment using a different sd card to boot the pi from. But I don't know where to start for that... (and currently I don't really have the time) :/ But I understand you somehow need my testing assistance here.

Do you have any more hints for me what would be the best option to help?

EDIT: One more thought about this: I looked into your change, @Smanar, and it looks like you basically white listed my device to be treated like an existing one. Assuming the filters you added don't match any different model, this will only make a change for owners of the same device model. As the device currently isn't working, you change is very unlikely to make things worse. So, wouldn't it be an option to just release your changes untested? Because it might be an improvement and if not it doesn't make any difference.

AndreaAPMS commented 3 years ago

Guys it seems to work better for me now, I even understood what was my problem...I have to load deconz with sudo. I’ll test new real ease now

Andrea Pesci Apms

www.apms.it

Sent from mobile

On 21 Nov 2020, at 14:31, Smanar notifications@github.com wrote:

 Ok so the device was realy not in the code, it s a new variant (again) I have modified the code, do you have an unix machine to test it if you can ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Smanar commented 3 years ago

Yeah, my better hint is : never touch the HA installation ^^. It s not a real OS.

If you can install it on other machine real or virtual, you can use it with HA, else don't take risks. And yes, the modification is easy, realy few risks, I can submit it in blind mode. No problem if you haven't time, was for you, if I m wrong you will need the next version again.

oberschwabe commented 3 years ago

@Smanar : so you think in in the next stable deconz release the new firmware of the hvac is supported in deconz and device could be used? I am asking as in the beta release description this case 3109 is not mentioned.

Is there anything i can help with?

Smanar commented 3 years ago

Next Beta: v2.7.0 expected at the 15th of December. Next Stable: v2.6.2 expected at 8th Decenmber.

Stable is using only "corrections" or "not sensible modifications", so not all PR are validated for this one. If you already have the device, it can be already supported, tuya have so much variant, but lot of them are already supported.

If you have an independant Unix OS, you can try to compile the code to confirm it s working.

Smanar commented 3 years ago

Ok so it seem some user have problem to use the "mode" request.

First, I have made a mistake on last PR and the last deconz can have problem with "mode" and "preset" for all tuya device that have "TS0601" as model name. Will be corrected soon, sorry.

For other that have issue can you try the request direclty using the API ?

curl -H 'Content-Type: application/json' -X PUT -d '{"mode": "off"}' http://IP:PORT/api/KEY/sensors/ID/config IP and PORT are the same used for phosocn ID is the device ID KEy an api key supported mode for this device are "off" "auto" and "heat"

To generate a new api key

curl http://IP:PORT/api/ -X POST -d '{"devicetype": "TestKey"}'

Or if you can just take a look in log during the request, all tuya logs are written with "info".

ozupey commented 3 years ago

Is this actually working for someone? I ran into several problems:

The only way to get it to physically turn off is by setting heatsetpoint to something low

Smanar commented 3 years ago

Yep, I have broken some stuff https://github.com/dresden-elektronik/deconz-rest-plugin/issues/4417 Depend of the version you have.

Phoscon won't list the device.

TRV are not visible in phoscon

changing mode to off changes it in the JSON but doesn't actually physically turn it off.

It s the thing I have broked on version 2.9.3

on is always false even when it's heating.

state/on or config/on ?

locked is always true.

Try to change it manualy to heck

temperature is off by several degrees.

How much ? There is an offset in deconz

Max temperature in Hassio is 35 rather than 30.

I don't see what is it on the device ?

Hassio shows different templates, some have an auto button, some don't.

Not all device support the same feature, for exemple some TRV use "mode" and other "preset"

ozupey commented 3 years ago

Thanks for your quick response!

Depend of the version you have.

Latest stable.

TRV are not visible in phoscon

Why not? An end-user should have an UI to manage devices instead of having to set up an API just to rename or delete a device. If I wanted something less user friendly, I'd buy a 5 EUR device + zigbee2mqtt rather than a 40 EUR ConBee.

It s the thing I have broked on version 2.9.3

When will it be fixed?

state/on or config/on ?

state.on is always false and config.on is always null.

How much ? There is an offset in deconz

About 2-3C higher than actual.

I don't see what is it on the device ?

If I physically press the + it stops at 30C.

Not all device support the same feature, for exemple some TRV use "mode" and other "preset"

It's the same device (_TZE200_c88teujp). One has more options than the other:

    "config": {
        "heatsetpoint": 2000,
        "locked": true,
        "mode": "off",
        "offset": 0,
        "on": true,
        "preset": null,
        "reachable": true,
        "schedule": {},
        "schedule_on": false,
        "setvalve": false,
        "windowopen_set": false
    },
    "ep": 1,
    "lastseen": "2021-02-22T18:51Z",
    "manufacturername": "_TZE200_c88teujp",
    "modelid": "TS0601",
    "name": "Thermostat 84",
    "state": {
        "lastupdated": "none",
        "lowbattery": null,
        "on": null,
        "temperature": 2040,
        "valve": null
    },
    "type": "ZHAThermostat",

---------------------------------------------

    "config": {
        "heatsetpoint": 2000,
        "offset": 0,
        "on": true,
        "reachable": true,
        "schedule": {},
        "schedule_on": false
    },
    "ep": 1,
    "lastseen": "2021-02-22T15:10Z",
    "manufacturername": "_TZE200_c88teujp",
    "modelid": "TS0601",
    "name": "Fairy lights (2)",
    "state": {
        "lastupdated": "none",
        "on": false,
        "temperature": 2000
    },
    "type": "ZHAThermostat",
},
Smanar commented 3 years ago

Why not? An end-user should have an UI to manage devices instead of having to set up an API just to rename or delete a device. If I wanted something less user friendly, I'd buy a 5 EUR device + zigbee2mqtt rather than a 40 EUR ConBee.

Phoscon is just an app that use the API, it s not the deconz app, but you can use the free third app you want.

state.on is always false and config.on is always null.

On your c/c I m seing config/on = true and state/on = false/null, the first one is useless for you, the second one is the valve state.

About 2-3C higher than actual.

2/3, can be normal for me, you can use the config/offset, to have a more "precise" value

If I physically press the + it stops at 30C.

Good question, it s probably locked by the device itself.

It's the same device (_TZE200_c88teujp). One has more options than the other: When will it be fixed?

I have checked, and yes, your device have more feature. If you restart deconz, it can re-add the missing field, easy test to do, and remember this kind of device is lazy, can take time, to have all values updated.

The big part is already corrected by the last PR validated by manup today, I m making some last tests ATM for the future version in 1 week. So If you don't want to use beta version, I realy think all will be corrected for the 10 march

Next Beta: v2.10.0-beta. Next Stable: v2.10.x expected at the 10th of March.

Else if you have a linux machine with full OS, I can explain you how to compile the code ?