deconz-rest-plugin icon indicating copy to clipboard operation
deconz-rest-plugin copied to clipboard

Thermostat offset unnecessarily clamped to -25/25 for Eurotronics SPZB001

Open LordOfTheRats opened this issue 3 years ago • 27 comments

Describe the bug

Using the REST API to set the thermostat offset on my Eurotronics SPZB001 with firmware 20191014 clampes the value from -25 to 25, although the thermostat is happily accepting values from -128 to 127.

Steps to reproduce the behavior

Use REST API / Homeassistant integration to set the offset to e.g. -460 (-4.6°C) offset, results in the value -25 to be sent to the device.

Expected behavior

The value -46 (-460/10) should be sent to the device.

Screenshots

Environment

  • Host system: VM
  • Running method: HASSIO Addon
  • Firmware version: (26660700)
  • deCONZ version: (2.13.4)
  • Device: ConBee II
  • Do you use an USB extension cable: yes
  • Is there any other USB or serial devices connected to the host system? No

deCONZ Logs

Additional context

https://github.com/dresden-elektronik/deconz-rest-plugin/blame/a6e045824461c571e51bbd74b503ae153bd5073c/rest_sensors.cpp#L1238 This commit introduced clamping the offset for all devices not explicitly handled otherwise. I propose removing this in the else case. I'd also be happy with an exception for the SPZB001.

LordOfTheRats avatar Dec 29 '21 18:12 LordOfTheRats

There is no information in the template. I'm closing the report.

Mimiix avatar Dec 29 '21 18:12 Mimiix

Sorry, i fat-fingered the submit button early. I have edited the report. Can you please reopen it?

Thank you!

LordOfTheRats avatar Dec 29 '21 18:12 LordOfTheRats

Sure :)

Mimiix avatar Dec 29 '21 18:12 Mimiix

Thank you :)

In current master the clamping happens here https://github.com/dresden-elektronik/deconz-rest-plugin/blame/master/rest_sensors.cpp#L979

LordOfTheRats avatar Dec 29 '21 18:12 LordOfTheRats

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] avatar Jan 20 '22 02:01 github-actions[bot]

Still relevant

LordOfTheRats avatar Jan 21 '22 10:01 LordOfTheRats

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] avatar Feb 12 '22 02:02 github-actions[bot]

Still relevant.

I realized I didn't include a screenshot of the device details. grafik

Anything else I can do to get this looked at?

LordOfTheRats avatar Feb 14 '22 10:02 LordOfTheRats

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] avatar Mar 09 '22 01:03 github-actions[bot]

Still relevant.

@Mimiix Any suggestion who the best person to tag would be? Maybe @SwoopX, since they seem to be the last person to work on this?

LordOfTheRats avatar Mar 14 '22 12:03 LordOfTheRats

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] avatar Apr 05 '22 02:04 github-actions[bot]

Bump

LordOfTheRats avatar Apr 05 '22 06:04 LordOfTheRats

Anything I can do to get this looked at?

LordOfTheRats avatar Apr 05 '22 06:04 LordOfTheRats

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] avatar Apr 27 '22 03:04 github-actions[bot]

Bump

LordOfTheRats avatar May 02 '22 10:05 LordOfTheRats

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] avatar May 25 '22 02:05 github-actions[bot]

bump

LordOfTheRats avatar May 25 '22 11:05 LordOfTheRats

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] avatar Jun 16 '22 02:06 github-actions[bot]

bump

@Mimiix @SwoopX what can I do to get this looked at?

LordOfTheRats avatar Jun 22 '22 12:06 LordOfTheRats

Not sure. I'll ask @manup to check.

Mimiix avatar Jun 22 '22 12:06 Mimiix

Thank you :)

LordOfTheRats avatar Jun 22 '22 12:06 LordOfTheRats

Just did a little test with my SPZB001 when I write a value below 500 (5°C) to the Current Temperature Setpoint 0x4003 attribute, like 0, the device clamps it automatically to min. 500.

From the manual control buttons on the device the minimum settable value is 5°C, however max. value seems to be 30°C.

manup avatar Jun 22 '22 16:06 manup

Hi @manup,

thank you for having a look :)

My issue is with the Local Temperature Calibration 0x0010. The SPZB001 accepts a (raw) range of -128 to 127 (= -1280 to 1270 using the REST API). This, however, gets clamped down to -25 to 25 at https://github.com/dresden-elektronik/deconz-rest-plugin/blame/master/rest_sensors.cpp#L1115. (I am currently running deCONZ 2.16.1)

Clamping happens for all devices that are not handled otherwise. Does this make sense? Is a range of -25/25 the default for most devices, except the SPZB001?

In any case, an exception for the SPZB001 would be nice, clamping to -128/127, or not clamping at all.

Thank you again for your help :)

LordOfTheRats avatar Jun 23 '22 08:06 LordOfTheRats

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] avatar Jul 15 '22 02:07 github-actions[bot]

I propose something like this:

diff --git a/rest_sensors.cpp b/rest_sensors.cpp
index d9fa48eb..8711fa4b 100644
--- a/rest_sensors.cpp
+++ b/rest_sensors.cpp
@@ -1108,6 +1108,16 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
                             updated = true;
                         }
                     }
+                    else if (sensor->modelId() == QLatin1String("SPZB0001"))
+                    {
+                        if (data.integer < -128) { data.integer = -128; }
+                        if (data.integer > 127)  { data.integer = 127; }
+
+                        if (addTaskThermostatReadWriteAttribute(task, deCONZ::ZclWriteAttributesId, 0x0000, THERM_ATTRID_LOCAL_TEMPERATURE_CALIBRATION, deCONZ::Zcl8BitInt, data.integer))
+                        {
+                            updated = true;
+                        }
+                    }
                     else if (sensor->type() == "ZHAThermostat")
                     {
                         if (!devManaged)

LordOfTheRats avatar Jul 15 '22 12:07 LordOfTheRats

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] avatar Aug 07 '22 02:08 github-actions[bot]

I'm currently working on the DDF version. Then you should be able to set whatever you want or amend any boundaries at will.

SwoopX avatar Aug 07 '22 11:08 SwoopX

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] avatar Aug 29 '22 02:08 github-actions[bot]

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.

github-actions[bot] avatar Sep 06 '22 02:09 github-actions[bot]