-
-
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] RadioThermostat Binding - initial contribution #7266
Merged
+2,271
−0
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
a143408
RadioThermostat Binding - initial contribution
mlobstein 2082b2d
remove HTTPException
mlobstein af112f4
update ui before sending command; slow response time caused the ui va…
mlobstein 00343ed
Add discovery service from billfor
mlobstein 2c1ed9b
make hold function a switch and improve examples in readme
mlobstein 29400b5
Merge pull request #1 from openhab/2.5.x
mlobstein caae683
Merge branch '2.5.x' into RadioThermostat
mlobstein 37d791e
Merge pull request #2 from openhab/2.5.x
mlobstein f43c452
Merge branch '2.5.x' into RadioThermostat
mlobstein 7f1529b
a couple more tweaks and increment pom version to 2.5.5
mlobstein 5affb52
some changes per review comments
mlobstein 8e3b104
format runtime output
mlobstein 2a7a732
Cleanup 'advanced' tag attribute usage on channel-types in thing-type…
mlobstein 2ae6d1b
Code review changes
mlobstein 5c1f7e3
Remove Thread.sleep
mlobstein 64f506f
update pom version to 2.5.6
mlobstein f068374
Remove org.apache.commons.lang dependency
mlobstein 07232c4
Add @NonNullByDefault annotations
mlobstein 82462cd
Merge pull request #3 from openhab/2.5.x
mlobstein c32d416
apply spotless and label name fixes
mlobstein 54603bd
Merge branch '2.5.x' into RadioThermostat
mlobstein b6ca717
Temp value needs to have decimal places
mlobstein 05043d3
code review changes
mlobstein 57f1143
fix hold switch bug
mlobstein 0ae2ac1
remove httpClient from discovery service
mlobstein 2a7d0c7
refactor to async http and other review changes
mlobstein 74d92c0
additional review changes
mlobstein c758c94
add missing return
mlobstein a2c0aa1
improve number parsing
mlobstein 87c5705
couple more changes
mlobstein 542afbb
fix some warnings
mlobstein 5d548cc
Merge pull request #4 from openhab/2.5.x
mlobstein a748961
fix compilier warnings
mlobstein 41709ef
Merge pull request #5 from openhab/2.5.x
mlobstein d290815
Merge branch '2.5.x' into RadioThermostat
mlobstein 76e8f56
Update pom version and format README
mlobstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.binding.radiothermostat</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This content is produced and maintained by the openHAB project. | ||
|
||
* Project home: https://www.openhab.org | ||
|
||
== Declared Project Licenses | ||
|
||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
|
||
== Source Code | ||
|
||
https://github.com/openhab/openhab-addons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
# RadioThermostat Binding | ||
|
||
This binding connects RadioThermostat/3M Filtrete models CT30, CT50/3M50, CT80, etc. with built-in Wi-Fi module to openHAB. | ||
|
||
The binding retrieves and periodically updates all basic system information from the thermostat. | ||
The main thermostat functions such as thermostat mode, fan mode, temperature set point and hold mode can be controlled. | ||
System run-time information and humidity readings are polled less frequently and can be disabled completely if not desired. | ||
Humidity information is available only when using a CT80 thermostat and I have noticed that the humidity reported is very inaccurate. | ||
|
||
The main caveat for using this binding is to keep in mind that the web server in the thermostat is very slow. | ||
Do not over load it with excessive amounts of simultaneous commands. | ||
When changing the thermostat mode, the current temperature set point is cleared and a refresh of the thermostat data is done to get the new mode's set point. | ||
Since retrieving the thermostat's data is the slowest operation, it will take several seconds after changing the mode before the new set point is displayed. | ||
The 'Program Mode' command is untested and according to the published API is only available on a CT80 Rev B. | ||
|
||
## Supported Things | ||
|
||
There is exactly one supported thing type, which represents the thermostat. | ||
It has the `rtherm` id. | ||
Multiple Things can be added if more than one thermostat is to be controlled. | ||
|
||
## Discovery | ||
|
||
Auto-discovery is supported if the thermostat can be located on the local network using SSDP. | ||
Otherwise the thing must be manually added. | ||
|
||
## Binding Configuration | ||
|
||
The binding has no configuration options, all configuration is done at Thing level. | ||
|
||
## Thing Configuration | ||
|
||
The thing has a few configuration parameters: | ||
|
||
| Parameter | Description | | ||
|-----------------|-----------------------------------------------------------------------------------------------------------| | ||
| hostName | The host name or IP address of the thermostat. Mandatory. | | ||
| refresh | Overrides the refresh interval of the thermostat data. Optional, the default is 2 minutes. | | ||
| 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. | | ||
|
||
## Channels | ||
|
||
The thermostat information that is retrieved is available as these channels: | ||
|
||
| Channel ID | Item Type | Description | | ||
|------------------------|----------------------|---------------------------------------------------------------------------| | ||
| temperature | Number:Temperature | The current temperature reading of the thermostat | | ||
| humidity | Number:Dimensionless | The current humidity reading of the thermostat (CT80 only) | | ||
| mode | Number | The current operating mode of the HVAC system | | ||
| fan_mode | Number | The current operating mode of the fan | | ||
| program_mode | Number | The program schedule that the thermostat is running (CT80 Rev B only) | | ||
| set_point | Number:Temperature | The current temperature set point of the thermostat | | ||
| status | Number | Indicates the current running status of the HVAC system | | ||
| fan_status | Number | Indicates the current fan status of the HVAC system | | ||
| override | Number | Indicates if the normal program set-point has been manually overridden | | ||
| hold | Switch | Indicates if the current set point temperature is to be held indefinitely | | ||
| day | Number | The current day of the week reported by the thermostat (0 = Monday) | | ||
| hour | Number | The current hour of the day reported by the thermostat (24 hr) | | ||
| minute | Number | The current minute past the hour reported by the thermostat | | ||
| dt_stamp | String | The current day of the week and time reported by the thermostat (E HH:mm) | | ||
| today_heat_runtime | Number:Time | The total number of minutes of heating run-time today | | ||
| today_cool_runtime | Number:Time | The total number of minutes of cooling run-time today | | ||
| yesterday_heat_runtime | Number:Time | The total number of minutes of heating run-time yesterday | | ||
| yesterday_cool_runtime | Number:Time | The total number of minutes of cooling run-time yesterday | | ||
|
||
## Full Example | ||
|
||
radiotherm.map: | ||
|
||
```text | ||
UNDEF_stus=- | ||
NULL_stus=- | ||
-_stus=- | ||
0_stus=Off | ||
1_stus=Heating | ||
2_stus=Cooling | ||
UNDEF_fstus=- | ||
NULL_fstus=- | ||
-_fstus=- | ||
0_fstus=Off | ||
1_fstus=On | ||
UNDEF_mode=- | ||
NULL_mode=- | ||
-_mode=- | ||
0_mode=Off | ||
1_mode=Heat | ||
2_mode=Cool | ||
3_mode=Auto | ||
UNDEF_fan=- | ||
NULL_fan=- | ||
-_fan=- | ||
0_fan=Auto | ||
1_fan=Auto/Circulate | ||
2_fan=On | ||
UNDEF_pgm=- | ||
NULL_pgm=- | ||
-_pgm=- | ||
-1_pgm=None | ||
0_pgm=Program A | ||
1_pgm=Program B | ||
2_pgm=Vacation | ||
3_pgm=Holiday | ||
UNDEF_over=- | ||
NULL_over=- | ||
-_over=- | ||
0_over=No | ||
1_over=Yes | ||
``` | ||
|
||
radiotherm.things: | ||
|
||
```java | ||
radiothermostat:rtherm:mytherm1 "My 1st floor thermostat" [ hostName="192.168.10.1", refresh=2, logRefresh=10, isCT80=false, disableLogs=false ] | ||
radiothermostat:rtherm:mytherm2 "My 2nd floor thermostat" [ hostName="mythermhost2", refresh=1, logRefresh=20, isCT80=true, disableLogs=false ] | ||
``` | ||
|
||
radiotherm.items: | ||
|
||
```java | ||
Number:Temperature Therm_Temp "Current Temperature [%.1f °F] " <temperature> { channel="radiothermostat:rtherm:mytherm1:temperature" } | ||
// Humidity only supported on CT80 | ||
Number Therm_Hum "Current Humidity [%d %%]" <temperature> { channel="radiothermostat:rtherm:mytherm1:humidity" } | ||
Number Therm_Mode "Thermostat Mode [MAP(radiotherm.map):%s_mode]" { channel="radiothermostat:rtherm:mytherm1:mode" } | ||
// The Auto/Circulate option will only appear for CT80 | ||
Number Therm_Fmode "Fan Mode [MAP(radiotherm.map):%s_fan]" { channel="radiothermostat:rtherm:mytherm1:fan_mode" } | ||
// Program Mode only supported on CT80 Rev B | ||
Number Therm_Pmode "Program Mode [MAP(radiotherm.map):%s_pgm]" { channel="radiothermostat:rtherm:mytherm1:program_mode" } | ||
Number:Temperature Therm_Setpt "Set Point [%d]" <temperature> { channel="radiothermostat:rtherm:mytherm1:set_point" } | ||
Number Therm_Status "Status [MAP(radiotherm.map):%s_stus]" { channel="radiothermostat:rtherm:mytherm1:status" } | ||
Number Therm_FanStatus "Fan Status [MAP(radiotherm.map):%s_fstus]" { channel="radiothermostat:rtherm:mytherm1:fan_status" } | ||
Number Therm_Override "Override [MAP(radiotherm.map):%s_over]" { channel="radiothermostat:rtherm:mytherm1:override" } | ||
Switch Therm_Hold "Hold" { channel="radiothermostat:rtherm:mytherm1:hold" } | ||
|
||
Number Therm_Day "Thermostat Day [%s]" { channel="radiothermostat:rtherm:mytherm1:day" } | ||
Number Therm_Hour "Thermostat Hour [%s]" { channel="radiothermostat:rtherm:mytherm1:hour" } | ||
Number Therm_Minute "Thermostat Minute [%s]" { channel="radiothermostat:rtherm:mytherm1:minute" } | ||
String Therm_Dstmp "Thermostat DateStamp [%s]" <time> { channel="radiothermostat:rtherm:mytherm1:dt_stamp" } | ||
|
||
Number:Time Therm_todayheat "Today's Heating Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:today_heat_runtime" } | ||
Number:Time Therm_todaycool "Today's Cooling Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:today_cool_runtime" } | ||
Number:Time Therm_yesterdayheat "Yesterday's Heating Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:yesterday_heat_runtime" } | ||
Number:Time Therm_yesterdaycool "Yesterday's Cooling Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:yesterday_cool_runtime" } | ||
|
||
// A virtual switch used to trigger a rule to send a json command to the thermostat | ||
Switch Therm_mysetting "Send my preferred setting" | ||
``` | ||
|
||
radiotherm.sitemap: | ||
|
||
```perl | ||
sitemap radiotherm label="My Thermostat" { | ||
Frame label="My 1st floor thermostat" { | ||
Text item=Therm_Temp icon="temperature" valuecolor=[>76="orange",>67.5="green",<=67.5="blue"] | ||
// Humidity only supported on CT80 | ||
Text item=Therm_Hum icon="humidity" | ||
Setpoint item=Therm_Setpt label="Target temperature [%d °F]" visibility=[Therm_Mode==1,Therm_Mode==2] icon="temperature" minValue=60 maxValue=85 step=1 | ||
Selection item=Therm_Mode icon="climate" | ||
Selection item=Therm_Fmode icon="fan" | ||
// Program Mode only supported on CT80 Rev B | ||
Selection item=Therm_Pmode icon="smoke" | ||
Text item=Therm_Status icon="climate" | ||
Text item=Therm_FanStatus icon="flow" | ||
Text item=Therm_Override icon="smoke" | ||
Switch item=Therm_Hold icon="smoke" | ||
|
||
// Virtual switch/button to trigger a rule to send a custom command | ||
// The ON value displays in the button | ||
Switch item=Therm_mysetting mappings=[ON="Heat, 58, hold"] | ||
|
||
Text item=Therm_Day | ||
Text item=Therm_Hour | ||
Text item=Therm_Minute | ||
Text item=Therm_Dstmp | ||
|
||
Text item=Therm_todayheat | ||
Text item=Therm_todaycool | ||
Text item=Therm_yesterdayheat | ||
Text item=Therm_yesterdaycool | ||
} | ||
} | ||
``` | ||
|
||
radiotherm.rules: | ||
|
||
```java | ||
rule "Send my thermostat command" | ||
when | ||
Item Therm_mysetting received command | ||
then | ||
val actions = getActions("radiothermostat","radiothermostat:rtherm:mytherm1") | ||
if(null === actions) { | ||
logInfo("actions", "Actions not found, check thing ID") | ||
return | ||
} | ||
// JSON to send directly to the thermostat's '/tstat' endpoint | ||
// See RadioThermostat_CT50_Honeywell_Wifi_API_V1.3.pdf for more detail | ||
actions.sendRawCommand('{"hold":1, "t_heat":' + "58" + ', "tmode":1}') | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>2.5.7-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.radiothermostat</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: RadioThermostat Binding</name> | ||
|
||
</project> |
9 changes: 9 additions & 0 deletions
9
bundles/org.openhab.binding.radiothermostat/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.binding.radiothermostat-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"> | ||
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> | ||
|
||
<feature name="openhab-binding-radiothermostat" description="Radio Thermostat Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.radiothermostat/${project.version}</bundle> | ||
</feature> | ||
</features> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Suggestion: Make it a
Switch
item-type to indicate the user overrode the setpoint.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.
I did this to match the display on the thermostat (using transform in the example) and because it is read-only in the api. It can't be turned off so having a switch here would be confusing IMHO.