dresden-elektronik / deconz-rest-plugin

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

hama Smart Radiator Thermostat #4305

Closed ruehcep closed 3 years ago

ruehcep commented 3 years ago

Device

https://www.hama.com/00176592/hama-smart-radiator-thermostat-for-hama-wlan-heating-control

The device is being identified as a light instead of a Thermostat and in the deconz software it seems to be a TRV Tuya. I do have a linux machine with full OS to make tests if required.

Screenshots

NodeInfo ClusterInfo

Smanar commented 3 years ago

Finally ^^, at third try.

Will add it today, do you have a unix machine to make test ?

ruehcep commented 3 years ago

All good things come in threes :-D I have a raspberry running Raspbian, can also quickly setup a different distro if needed. Many thanks!

Smanar commented 3 years ago

Nice, so I have aded it on the future Tuya modification, so you will have almost all future tuya change.

I haven't find information about your device, so I have used a basic one, and enable all features. So just use it some time, and take a look after some time, in the json to check the working one or not.

To test it https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only

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

You will probably need to make 2 inclusions, without deleting the old one, to include the device.

If something is not working, you can find some information in log, all tuya request are logged and start by "tuya debug"

ruehcep commented 3 years ago

Hi, I hope I am not missing anything basic here ... it is my my first not "out of the box" supported device in deconz. I now do see a second object (see screenshot below) but otherwise nothing changed. In REST also everything looks the same, only seeing the on/off light (see below). Could you explain what you mean with "making two inclusions"? Thanks for the support! 4 3

Smanar commented 3 years ago

2 inclusions/pairings/addings.

ATM we have some problem with tuya stuff, deconz is not able to reconize them, and they are not zigbee compliant. So at first inclusion, deconz memorise the device with some information, and make a "bad" entry in the api according to it. This device react like a "on/off light", it s for that you have this device created.

At the second inclusion, deconz will look in the database, the previous data to reconize it, and make the correct entry in the API.

It s for that, you need 2 inclusions and without deleting the device (to be sure data are still inside the DB)

github-actions[bot] commented 3 years ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] commented 3 years ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

bmgit26 commented 3 years ago

I installed the rest plugin from git and try to add the Hama thermostate in Phoscon. But the thermostate is not detected in Lights/Sensors/Switches. Do I need to add it in deconz-gui or should it work in phoscon too?

Mimiix commented 3 years ago

Should only be found in deCONZ/RestAPI

bmgit26 commented 3 years ago

Great, thanks, I see it in deconz and can use it in Home Assistant.

sedony23 commented 3 years ago

2 inclusions/pairings/addings.

ATM we have some problem with tuya stuff, deconz is not able to reconize them, and they are not zigbee compliant. So at first inclusion, deconz memorise the device with some information, and make a "bad" entry in the api according to it. This device react like a "on/off light", it s for that you have this device created.

At the second inclusion, deconz will look in the database, the previous data to reconize it, and make the correct entry in the API.

It s for that, you need 2 inclusions and without deleting the device (to be sure data are still inside the DB)

Hi there,

I also just got these thermostats. How do you include them twice? I added the thermostat through the Phoscon WebUI once and if I try to pair it again, it doesn't show up as new device. I can see it in deCONZ. However I can not control it via homebridge-hue. Some more info would be appreciated. Thanks and all the best.

Daniel

Screen Shot 2021-08-13 at 07 11 06
Smanar commented 3 years ago

You just need to set phoscon in permit join > add new sensors. Then make the inclusion procedure 2 times.

Where the name "Thermostat 81" is from ? if it s not you that have set it, it mean the device inclusion have worked. remember phoscon don't display thermostat.

sedony23 commented 3 years ago

Thanks for your help! Hmm, I added it twice through sensors. I can now control the temperature through homebridge-hue with the Eve app. However I cannot set the mode (heating on or off) nor can I set a schedule. When I toggle the switch, it just goes switching the state and then right back. See screenshot. Any ideas?

Screen Shot 2021-08-14 at 21 31 13
Smanar commented 3 years ago

Good question .... From the code it seem this device have the "mode" and the "preset" (not logic) But I don't know how work homekit, you can't use direclty the API ? with Curl or Using a Rest client ? https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/

I can explain with curl, but I need at least the device Json.

sedony23 commented 3 years ago

OK. I'll check and will post again here!

sedony23 commented 3 years ago

So I ran some tests. Here is what I get from the REST API:

{ "config": { "heatsetpoint": 1000, "locked": true, "mode": "heat", "offset": 200, "on": true, "preset": null, "reachable": true, "schedule": {}, "schedule_on": true, "setvalve": false, "windowopen_set": false }, "ep": 1, "etag": "1628e2eb7c431e5de05361db3c4b115c", "lastannounced": "2021-08-14T19:18:14Z", "lastseen": "2021-08-15T06:51Z", "manufacturername": "_TYST11_yw7cahqs", "modelid": "w7cahqs", "name": "Thermostat", "state": { "lastupdated": "none", "lowbattery": null, "on": null, "temperature": 2250, "valve": null }, "swversion": "20180727", "type": "ZHAThermostat", "uniqueid": "------------------------" }

I can also change the mode from "heat" to "auto" or to "off". However that doesn't change anything on the thermostat. Setting the temperature works though. Any ideas?

Smanar commented 3 years ago

Nice, thw a lot. Have found the problem, the "mode" use the wrong code, we need to use DP_IDENTIFIER_THERMOSTAT_MODE_3 for this one.

Are you able to compile to test code modification, or I made the fix in "blind mode" ? And I m not sure this device support the "heat" mode

sedony23 commented 3 years ago

Great, thanks for the quick fix! I'm not sure if everything else is ok and what the device actually exposes/uses. Maybe this helps: https://www.zigbee2mqtt.io/devices/SEA801-Zigbee_SEA802-Zigbee.html https://github.com/Koenkk/zigbee2mqtt/issues/5507 It also seems to be very close to this one: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3109

Unfortunately I run Docker and can't compile and test easily as the whole rest of the system is working fine.

Is there any other info I can get you to make it work?

Smanar commented 3 years ago

I only need test to confirm ^^.

I have made the PR, hoping I m right.

sedony23 commented 3 years ago

Will it be in the next beta release then? Then I could easily test it.

Smanar commented 3 years ago

IDK, depend of PR validation, but as it's a small fix, yes we probalby have it in next version.

sedony23 commented 3 years ago

Did the fix make it into the new release? Then I could test it!

Smanar commented 3 years ago

Nope, not yet, this issue will be closed in same time the PR will be validated. I think you will have on the next version a beta one.

sedony23 commented 3 years ago

Thank you!

pillemats commented 2 years ago

Hey guys,

I bought one today for testing. I am on 12.6 and had connceted the trv.

"151": { "config": { "heatsetpoint": 3000, "locked": true, "mode": "auto", "offset": 0, "on": true, "preset": null, "reachable": true, "schedule": {}, "schedule_on": false, "setvalve": false, "windowopen_set": false }, "ep": 1, "etag": "a60ba2517ca877b885358fdbbf4a6d49", "lastannounced": "2021-11-08T16:43:58Z", "lastseen": "2021-11-08T16:43Z", "manufacturername": "_TZE200_yw7cahqs", "modelid": "TS0601", "name": "Thermostat 151", "state": { "lastupdated": "none", "lowbattery": null, "on": null, "temperature": null, "valve": null }, "type": "ZHAThermostat",

That is what i get but it wont do anything….

Smanar commented 2 years ago

Yes, there is somethjing bad, you have sure the device is still connected ?

Go on deconz log with "info" and "info_l2" and try to set somme command manually, like a mode chnage et change the setpoint temperature.

You need to see on log somes lines starting by "tuya debug"

pillemats commented 2 years ago

Yes the device is connected. How to change manually ? In rest api ? How was the command?

Smanar commented 2 years ago

Manualy ? with your hand ^^. All tuya request are logued, so we will be able to compare it to see if it s the same device, or perhaps this device don't make request at all.

pillemats commented 2 years ago

Oh sorry :-D

Here is the log

https://pastebin.com/mMxY9yLG

Ich set up the temp from off to on with 30 and then to 23 but i unfortunately can't read the log because i am a noob :-D

I am also using homebrdige and if i set up temp manually it will shown in log of homebridge

Hopefully this is an small issue because this is my 6. different trv i want to run with deconz….

Smanar commented 2 years ago

Its the mac adress 0x5C0272FFFEC21516 ?

Because it have worked

21:42:54:966 Websocket 192.168.178.204:33144 send message: {"config":{"heatsetpoint":2300,"locked":true,"mode":"heat","offset":0,"on":true,"preset":null,"reachable":true,"schedule":{},"schedule_on":false,"setvalve":false,"windowopen_set":false},"e":"changed","id":"151","r":"sensors","t":"event","uniqueid":"5c:02:72:ff:fe:c2:15:16-01-0201"}

So you receive command from the device, but not send it using the API ?

The command for heat point for your device is

21:42:54:962 Tuya debug 5 : Status: 0 Transid: 3 Dp: 615 (0x02,0x67) Fn: 0 Data 230

And same on the code ....

Can you show the same log but this time trying with the API (or third app)

pillemats commented 2 years ago

Yes it is.

How was the command in rest api?

Many time ago I done some things in rest api

Smanar commented 2 years ago

But you have never tried the device ? How you can't know if it work or not ?

The temperature is still "Null" ?

Can try with Curl

curl -H 'Content-Type: application/json' -X PUT -d '{"heatsetpoint": 2500}' http://IP:PORT/api/APIKEY/sensors/151/config

pillemats commented 2 years ago

i dont understand curl.... i run deconz on my win10 VM

I got it!

it works right now and i can change temp

Bildschirmfoto 2021-11-09 um 20 06 30

but this wont work: {"mode": off}, or {"mode": auto},

i get bad request 400 if i try

maybe there is a connection problem with homebridge and homebridgehue plugin from @ebaauw ?

EDIT: that is strange.... i not changed my setting from yesterday and now the trv works also with homekit BUT i cant turn it off with HK. i only can set up to a temp of 5.

is it normal that it takes some time (10-15 seconds) if trv get the status update and will actualise the state?

maybe the state will be send but not to deconz i think:

[9.11.2021, 20:23:34] [Hue] Thermostat 151: homekit target heating cooling state changed from 1 to 0

if i set the trv off manually i get this status:

[9.11.2021, 20:25:47] [Hue] Thermostat 151: set homekit target temperature from 24°C to 5°C

and i turn it off manually and will turn on to 24 temp i get this

[9.11.2021, 20:26:45] [Hue] Thermostat 151: set homekit target temperature from 5°C to 14°C [9.11.2021, 20:26:46] [Hue] Thermostat 151: set homekit target temperature from 14°C to 23°C [9.11.2021, 20:26:49] [Hue] Thermostat 151: set homekit target temperature from 23°C to 5°C [9.11.2021, 20:26:52] [Hue] Thermostat 151: homekit target heating cooling state changed from 0 to 1

BUT the TRV will do nothing

Smanar commented 2 years ago

is it normal that it takes some time (10-15 seconds) if trv get the status update and will actualise the state?

Yes, lot of TRV are lazy.

The "auto" is broken ATM for your device https://github.com/dresden-elektronik/deconz-rest-plugin/pull/5471 But the "off" need to work, and it's "off" instead of off.

pillemats commented 2 years ago

Ah ok…

Mmh this is strange…. I get always error 400 if i want to turn off

See here:

980F9DE9-2559-4E58-9B1C-DEBB62131426

Should i try 13.1 ?

Smanar commented 2 years ago

It's "off" not off.

pillemats commented 2 years ago

oh sorry, my mistake.

i jst tried now and it will switch but the TRV does nothing. The state was changed in homebridge and homekit but not on the TRV itself

changing temp works perfect. on and off/auto not

Smanar commented 2 years ago

If you have the GUI, can you show the log when making the mode = off command. Logs with "info" and "info_l2"

pillemats commented 2 years ago

it should be work right now.... but i get this in homebridge if i try turn on and set up temp (Maybe this is the issue you wrote before)

[11.11.2021, 20:48:16] [Hue] Thermostat 151: homekit target heating cooling state changed from 0 to 1 [11.11.2021, 20:48:16] [Hue] Phoscon-GW: request 27: PUT /sensors/151/config {"mode":"auto"} [11.11.2021, 20:48:16] [Hue] Phoscon-GW: request 27: api error 608: Could not set attribute [11.11.2021, 20:48:21] [Hue] Thermostat 151: set homekit target heating cooling state from 1 to 0

Hope the log will help i tried also the silvercrest thermostate, if you are wondering about the second trv. but has nothing to do with this issue here...

log.docx

EDIT: Yesterday i tried this on 12.6 and today i updated to 13.2. maybe this is the reason why mode off via api works? on 12.6 it works not in my case

Smanar commented 2 years ago

Seriously I m totaly lost in deconz version, there is new trv every 2 days, and repair/add one can broke another. And I m sure there is fix for TRV in all new versions.

But yes, ATM the "auto" command is broken and provoke exactlty this message

pydeconz.errors.pydeconzException: /sensors/55/config/mode Could not set attribute

pillemats commented 2 years ago

hopefully it will fixed asap :-)

pillemats commented 2 years ago

How does it go on here ?

Smanar commented 2 years ago

For the "auto" issue ? still in waiting list https://github.com/dresden-elektronik/deconz-rest-plugin/pull/5471

pillemats commented 2 years ago

Same problem is with another manufacturer

8202B36E-8FA8-4AB1-9444-813774D7FA95 7D0DA0EA-0D2A-4E05-BF46-9068D8E5D457

Smanar commented 2 years ago

What does means "same problem" ? the missing "auto" feature ?

pillemats commented 2 years ago

Oh sorry…. Yes the Auto feature don’t work

Smanar commented 2 years ago

Have just updated the PR for this issue, if you can try it ? https://github.com/dresden-elektronik/deconz-rest-plugin/pull/5471

pillemats commented 2 years ago

Thanks! When should I try it ? I don’t understand I think

Smanar commented 2 years ago

You have the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5436#issuecomment-962259657

But you need a linux machine with full OS.

pillemats commented 2 years ago

Oh i don’t have it… only win10 with deconz