-
-
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
[radiothermostat] Added Absolute Setpoint Mode #8393
Conversation
Travis tests were successfulHey @silverfunk, |
Signed-off-by: Ted Jordan <[email protected]>
Signed-off-by: Ted Jordan <[email protected]>
Travis tests were successfulHey @silverfunk, |
I'm not familiar with this device. But Is this something that is set once and than not changed? Or does it make sense for the user to sometimes change the setpoint temporary and other times permanent? In that case it might make more sense to have this as a channel parameter of a separate temporarySetPoint channel? |
Indeed afree with @Hilbrand would suggest the same. I would also recommend not to use 'absolute' as channel name, I don't think it well describes the intent of the functionality |
I would opt for a specific channel for temporarySetPoint as it would be easier. The user can simply pick a channel. Otherwise the user must first make sure the correct mode is set and then set the setpoint. |
bundles/org.openhab.binding.radiothermostat/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
Travis tests were successfulHey @silverfunk, |
I am not entirely sure this is needed. With the current implementation, the user can set the 'hold' switch on which will cause the temperature to maintain its current set point indefinitely. The thermostat will ignore its internal program schedule while in hold mode. |
| logRefresh | Overrides the refresh interval of the run-time logs & humidity data. Optional, the default is 10 minutes. | | ||
| isCT80 | Flag to enable additional features only available on the CT80 thermostat. Optional, the default is false. | | ||
| disableLogs | Disable retrieval of run-time logs from the thermostat. Optional, the default is false. | | ||
| absolute | Controls temporary or absolute mode. When false setpoint changes are temporary; the thermostat will return to its program after a time. When true setpoint changes are perminant; the thermostat will ignore its program maintaining the given setpoint. Optional, the default is false. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling: 'permanent'
The main idea behind creating an absolute mode is to allow the thermostat to be operated primarily via a program in the thermostat (thermostat driven) vs. operated via a smart home controller (openHAB). Without an absolute mode the thermostat only temporarily changes to the given setpoint, reverting later back to its program. Yes, hold could be used to force this same behavior but then hold cannot be used for smart home controller operations. For example I use hold on my thermostats to inform openHAB that it should maintain the setpoint regardless of whether or not people are home, e.g. it is hold for the thermostat and the smart home controller. The real point of adding an absolute mode is to essentially make the thermostat a dumb device. In this mode it controls the temperature based solely on what openHAB tells it to do. I do not want it to have other ideas of how and when the temperature should be changed. In my house openHAB is able to tell the thermostat to control the temperature based on when people are home, whether or not we are in bed for the night, and the price I am paying for electricity. In an absolute mode the thermostat's only function is to monitor the temperature and turn on the furnace or AC when it gets beyond the setpoint ranges. I do not want the thermostat to be able to make decisions beyond what openHAB tells it to do. When I originally contemplated this functionality I dithered between making it a parameter on the thing or a separate item channel. Ultimately I decided to go with a parameter on the thing because I could not fathom a reason why anyone would want to switch between the two. But that being said I am open to allowing for flexibility. If there is a desire to make the absolute mode into an item channel I can do that. I do think this would have to be an on/off switch though. Creating separate temporary and absolute setpoint items, while possible, would be complicated for a user interface. The thermostat is only able to maintain one active setpoint, either temporary or absolute. If both setpoints were items you could have a sitemap where both are visible but there is no indication which one is active. Changing one would inherently change the mode of the thermostat with no indication the thermostat was functioning differently. |
Travis tests were successfulHey @silverfunk, |
…/ESH-INF/thing/thing-types.xml Co-authored-by: cpmeister <[email protected]> Signed-off-by: Ted Jordan <[email protected]>
Travis tests were successfulHey @silverfunk, |
Co-authored-by: mlobstein Signed-off-by: Ted Jordan <[email protected]>
Travis tests were successfulHey @silverfunk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your extensive explanation. I now better understand it's usage. This is more about how to one wants to use the thermostat. I can image that if you want to run in absolute mode you never should send a temporary command as this will trigger the thermostat to start following it's program again. The naming of this option can be a discussion, but I guess it would best make sense to follow naming closely to what the thermostat uses and thus follow the terminology used as used in the pr.
I've one review request. Instead of using the a boolean to make it a options list. You can actually test this value in the initialize method and set the specific command, instead of testing it every time, since doesn't change anymore.
<parameter name="absolute" type="boolean"> | ||
<label>Run in Absolute Setpoint Mode</label> | ||
<description>Optional Flag to run in absolute or temporary setpoint mode</description> | ||
<default>false</default> | ||
</parameter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<parameter name="absolute" type="boolean"> | |
<label>Run in Absolute Setpoint Mode</label> | |
<description>Optional Flag to run in absolute or temporary setpoint mode</description> | |
<default>false</default> | |
</parameter> | |
<parameter name="setpointMode" type="text"> | |
<label>Setpoint Mode</label> | |
<description>Run in absolute or temporary setpoint mode</description> | |
<default>temporary</default> | |
<options> | |
<option value="absolute">Absolute</option> | |
<option value="temporary">Temporary</option> | |
</options> | |
</parameter> |
That makes sense. I had never explored absolute mode myself. It is rather strange that there is no way to tell if the thermostat is using an absolute setpoint or not. So from the binding perspective it makes sense to chose one mode or the other and stick with it instead of providing a way to dynamically switch. I have attached some refactoring changes to the code to remove the SuppressWarnings mainly and improve a few little things. Please add them to your PR (note .java files renamed to .txt) RadioThermostatConfiguration.java.txt |
@mlobstein You could also file a PR for the forked repo of @silverfunk |
Changed the absolute parameter to setpointMode. Signed-off-by: silverfunk <[email protected]>
Travis tests have failedHey @silverfunk, |
Signed-off-by: silverfunk <[email protected]>
this.isCT80 = config.isCT80; | ||
this.disableLogs = config.disableLogs; | ||
|
||
if (hostName == null || hostName == "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be hostName.equals(""), sorry about that.
...c/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java
Show resolved
Hide resolved
Travis tests were successfulHey @silverfunk, |
@mlobstein, I incorporated your refactoring changes. Thank you for the updates. In temporary mode the thermostat displays "Temporary" on the thermostat's screen while it is adjusting to the given temporary setpoint. In absolute mode it does not display "Temporary". That's the only indication I've seen that differentiates between the two modes. I have found nothing in the API to designate a difference between the modes. |
Signed-off-by: silverfunk <[email protected]>
Travis tests were successfulHey @silverfunk, |
Signed-off-by: silverfunk <[email protected]>
Travis tests were successfulHey @silverfunk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mlobstein any last words before I merge 😉 |
LGTM |
Signed-off-by: Ted Jordan <[email protected]>
Signed-off-by: Ted Jordan <[email protected]>
Signed-off-by: Ted Jordan <[email protected]>
When controlled remotely Radio Thermostat's can function in 2 modes. In temporary mode setpoint changes will be temporary; with the thermostat returning to run its program after a period of time. In absolute mode setpoint changes are permanent. The thermostat will maintain the given setpoint temperature until it is changed, completely ignoring the program. With OpenHab controlling the thermostat it is often not desirable to have the thermostat run its own program. Adding the absolute setpoint mode allows users to control the thermostat setpoint entirely through OpenHab.