-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[max] Setting temperature can inadvertently change automatic/manual mode #4347
Comments
I'm planning to go with approach 3 (Delay and combine commands). It looks like I can simply steal much of the code from the Homematic binding. |
Addresses issue Setting temperature can inadvertently change automatic/manual mode #4347 Signed-off-by: Marcel Verpaalen <[email protected]>
Seems like #22a8575 follows approach 1. :-) |
Uh, okay... Thanks for updating me! |
Can someone assign this issue to him then to reduce confusion? :-) |
* Fix inadvertently change automatic/manual mode Addresses issue Setting temperature can inadvertently change automatic/manual mode Fixes #4347 Signed-off-by: Marcel Verpaalen <[email protected]>
…enhab#4755) * Fix inadvertently change automatic/manual mode Addresses issue Setting temperature can inadvertently change automatic/manual mode Fixes openhab#4347 Signed-off-by: Marcel Verpaalen <[email protected]> Signed-off-by: Pshatsillo <[email protected]>
…enhab#4755) * Fix inadvertently change automatic/manual mode Addresses issue Setting temperature can inadvertently change automatic/manual mode Fixes openhab#4347 Signed-off-by: Marcel Verpaalen <[email protected]> Signed-off-by: Maximilian Hess <[email protected]>
Expected Behavior
I'm using my thermostats in automatic mode by default. In order to set something like an "away mode", I've set up a rule that sets the thermostat to mode MANUAL, then sets a lower temperature. Example:
This should result in the thermostat being set to a set temperature of 18° C and manual mode.
Current Behavior
What happens is that the thermostat is set to manual mode at first, but when the temperature is set, it switches back to automatic mode.
See also this forum thread.
Possible Solution(s)
I'm asking for your assessment regarding the fix I propose!
Approach 1: Update internal status when sending commands
I've been trying to dig into the source code, and I believe this is the problem:
The obvious solution is to update the internal value of the device object at the same time when sending out the command. What are the implications? It would mean that the data of the internal device object may not reflect the actual device data, if, for unknown reasons, the command fails. (When could that happen?) On the other hand, now that the internal status is not updated, the device object definitely holds incorrect data for a while until it's been updated.
In the worst case, with the proposed fix applied, the command would be sent but fails to update the thermostat for some reason. The device object status would then stay wrong for an undefined time period. On the other hand, I see no reason why the command would fail other than the device (or cube) being unreachable. In this case, the problems are on a more basic level, and the device status would be unknown anyway.
Pros
Cons
Approach 2: Allow to set control mode with setpoint temperature
Another approach would be to reflect the way the protocol is designed by allowing to set the control mode with the setpoint temperature. Practically, this could be done by allowing String type parameters that add the control mode to the temperature, like
Pros
Cons
Approach 3: Delay and combine commands
A more complicated, but from the users' view elegant solution would be to delay the sending of the commands and combine them into one. For example, if a change is received over the control mode channel, the binding could wait for a short (configurable) time, for example in the range of 50-500 ms. If during this delay, the setpoint temperature is changed, both settings would be combined and sent in one command.
Pros
Cons
Alternative Work-around
A work-around (outside the binding implementation) would be to set up the rule in a way that, after sending the control mode command, it waits until the cube has sent back an update about the control mode change before sending out the new setpoint temperature. According to my observations, the update back takes around 30 seconds to arrive. To be on the safe side, one could add a delay of 60 seconds. A cleaner - yet more complicated - work-around would to wait for the specific expected update. However, both variants can lead to additional complications, like how to handle updates of the control mode and/or setpoint temperature that occur in between the two commands?
The downside is that you always need a quite complex rule to handle switching temperature and control mode at the same time. If you change control mode and temperature manually (using two different widgets in the UI), you won't be able to handle it without using proxy items and rules. Quite a complex approach for such a simple and basic requirement. I consider this not acceptable for the user.
Steps to Reproduce (for Bugs)
Example items:
Example rule:
Context
I'm trying to set up a rule that detects when no one is home and if so, lowers the temperature. I usually run all my thermostats in automatic mode. I know that some prefer not to use automatic mode at all, and that I wouldn't experience this issue if I used only manual mode, but I find the automatic mode very convenient and do no want to do without it.
Your Environment
The text was updated successfully, but these errors were encountered: