Shelly TRV - Multiple Target Temperature Updates - not keeping most recent value

Hi there,
I connected my new Shelly TRV to OpenHab today. I am experiencing a weird behaviour, when tapping “+” or “-” on a stepper widget, in order to set the target temperature.

When I wait a couple of seconds between each tap/click, everything works as expected.

When I tap/click several times in short intervals, the target temperature is being reset to a wrong value after few seconds. E. G., when increasing the target temp. from 19°C to 27°C, the value is eventually set to 20°C.

My guess is, that eiher not all http requests are successfully sent (so that not the last value is kept) or that the requests are not received in correct order by the shelly device (so that not the last value is set as target temperature).

The debug output, after increasing the target temperature by 7°C in short succession looks like this:

2022-10-22 21:16:10.558 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 19 °C
2022-10-22 21:16:11.923 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 20 °C
2022-10-22 21:16:12.118 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 21 °C
2022-10-22 21:16:12.225 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Message from /192.168.178.85:5683 (MID=308): {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,20.0],[0,3104,68],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]}
2022-10-22 21:16:12.226 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Sensor data {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,20.0],[0,3104,68],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]} (serial=308)
2022-10-22 21:16:12.226 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 12 CoAP sensor updates received
2022-10-22 21:16:12.228 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Channel control#targetTemp updated with 20 °C (type class org.openhab.core.library.types.QuantityType).
2022-10-22 21:16:12.230 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 2 channels updated from CoIoT status, serial=308
2022-10-22 21:16:12.232 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Message from /192.168.178.85:5683 (MID=309): {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,20.0],[0,3104,68],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]}
2022-10-22 21:16:12.234 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Sensor data {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,20.0],[0,3104,68],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]} (serial=309)
2022-10-22 21:16:12.235 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 12 CoAP sensor updates received
2022-10-22 21:16:12.334 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 22 °C
2022-10-22 21:16:12.455 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 23 °C
2022-10-22 21:16:12.578 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 24 °C
2022-10-22 21:16:12.713 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 25 °C
2022-10-22 21:16:12.818 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Set temperature to 26 °C
2022-10-22 21:16:13.205 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Message from /192.168.178.85:5683 (MID=310): {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,26.0],[0,3104,78],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]}
2022-10-22 21:16:13.206 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Sensor data {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,26.0],[0,3104,78],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]} (serial=310)
2022-10-22 21:16:13.206 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 12 CoAP sensor updates received
2022-10-22 21:16:13.206 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Channel control#targetTemp updated with 26 °C (type class org.openhab.core.library.types.QuantityType).
2022-10-22 21:16:13.207 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 1 channels updated from CoIoT status, serial=310
2022-10-22 21:16:13.207 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Message from /192.168.178.85:5683 (MID=311): {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,26.0],[0,3104,78],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]}
2022-10-22 21:16:13.208 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Sensor data {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,26.0],[0,3104,78],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,74]]} (serial=311)
2022-10-22 21:16:13.208 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 12 CoAP sensor updates received
2022-10-22 21:16:19.273 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Message from /192.168.178.85:5683 (MID=312): {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,19.0],[0,3104,66],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,75]]}
2022-10-22 21:16:19.273 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Sensor data {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,19.0],[0,3104,66],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,75]]} (serial=312)
2022-10-22 21:16:19.273 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 12 CoAP sensor updates received
2022-10-22 21:16:19.274 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellytrv-8cf681149871: Channel control#targetTemp updated with 19 °C (type class org.openhab.core.library.types.QuantityType).
2022-10-22 21:16:19.274 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 2 channels updated from CoIoT status, serial=312
2022-10-22 21:16:19.274 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Message from /192.168.178.85:5683 (MID=313): {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,19.0],[0,3104,66],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,75]]}
2022-10-22 21:16:19.274 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: CoIoT Sensor data {"G":[[0,3101,999.0],[0,3102,1830.2],[0,3103,19.0],[0,3104,66],[0,3115,0],[0,3116,0],[0,3117,1],[0,3118,0],[0,3111,100],[0,3121,0.00],[0,3122,0],[0,9103,75]]} (serial=313)
2022-10-22 21:16:19.274 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellytrv-8cf681149871: 12 CoAP sensor updates received

Has anyone else experienced the same behaviour?
Any suggestions, how this can be fixed are highly appreciated!

Thanks, Stefan

I justed called http://<shelly-trv-ip>/thermostat/0?target_t_enabled=1&target_t=?? in quick succesion via browser, with increasing values from 22 to 28, with 21°C being the target temperature before.

Calling the valve’s api manually results in the same erroneous behaviour.

So my question is: @markus7017 - do you think, the binding should in some way wait for the http response of the valve or wait a fixed amount of time between two api calls? Should it skip multiple api calls of the same kind, and just make sure to make the last call, which e. g. sets the target temperature, that the user actually set last?

Maybe I could provide a pull request, but haven’t had a closer look into the code yet.

Thanks, Stefan

please move to the Shelly Binding post, so all of us could consume the discussion

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.