Skip to content
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

[tado] Change humidity and heatingPower channels to QuantityType #16531

Merged
merged 6 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bundles/org.openhab.binding.tado/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ If you are unsure, have a look at the tado° app and see if the functionality is
Name | Type | Description | Read/Write | Zone type
-|-|-|-|-
`currentTemperature` | Number:Temperature | Current inside temperature | R | `HEATING`, `AC`
`humidity` | Number | Current relative inside humidity in percent | R | `HEATING`, `AC`
`humidity` | Number:Dimensionless | Current relative inside humidity in percent | R | `HEATING`, `AC`
`hvacMode` | String | Active mode, one of `OFF`, `HEAT`, `COOL`, `DRY`, `FAN`, `AUTO` | RW | `HEATING` and `DHW` support `OFF` and `HEAT`, `AC` can support more
`targetTemperature` | Number:Temperature | Set point | RW | `HEATING`, `AC`, `DHW`
`operationMode` | String | Operation mode the zone is currently in. One of `SCHEDULE` (follow smart schedule), `MANUAL` (override until ended manually), `TIMER` (override for a given time), `UNTIL_CHANGE` (active until next smart schedule block or until AWAY mode becomes active) | RW | `HEATING`, `AC`, `DHW`
`overlayExpiry` | DateTime | End date and time of a timer | R | `HEATING`, `AC`, `DHW`
`timerDuration` | Number | Timer duration in minutes | RW | `HEATING`, `AC`, `DHW`
`heatingPower` | Number | Amount of heating power currently present | R | `HEATING`
`heatingPower` | Number:Dimensionless | Amount of heating power currently present | R | `HEATING`
`acPower` | Switch | Indicates if the Air-Conditioning is Off or On | R | `AC`
`fanspeed`<sup>1)</sup> | String | Fan speed, one of `AUTO`, `LOW`, `MIDDLE`, `HIGH` | RW | `AC`
`fanLevel`<sup>1)</sup> | String | Fan speed, one of <sup>3)</sup> `AUTO`, `SILENT`, `LEVEL1`, `LEVEL2`, `LEVEL3`, `LEVEL4`, `LEVEL5` | RW | `AC`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.openhab.core.library.types.StringType;
import org.openhab.core.library.unit.ImperialUnits;
import org.openhab.core.library.unit.SIUnits;
import org.openhab.core.library.unit.Units;
import org.openhab.core.types.State;
import org.openhab.core.types.UnDefType;

Expand Down Expand Up @@ -75,13 +76,14 @@ public State getInsideTemperature() {

public State getHumidity() {
PercentageDataPoint humidity = zoneState.getSensorDataPoints().getHumidity();
return humidity != null ? toDecimalType(humidity.getPercentage()) : UnDefType.UNDEF;
return humidity != null ? new QuantityType<>(humidity.getPercentage(), Units.PERCENT) : UnDefType.UNDEF;
}

public DecimalType getHeatingPower() {
public State getHeatingPower() {
ActivityDataPoints dataPoints = zoneState.getActivityDataPoints();
return dataPoints.getHeatingPower() != null ? toDecimalType(dataPoints.getHeatingPower().getPercentage())
: DecimalType.ZERO;
return dataPoints.getHeatingPower() != null
? new QuantityType<>(dataPoints.getHeatingPower().getPercentage().doubleValue(), Units.PERCENT)
: UnDefType.UNDEF;
}

public State getAcPower() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

<properties>
<property name="vendor">tado°</property>
<property name="thingTypeVersion">1</property>
</properties>
<representation-property>id</representation-property>

Expand Down Expand Up @@ -135,15 +136,15 @@
</channel-type>

<channel-type id="humidity">
<item-type>Number</item-type>
<item-type>Number:Dimensionless</item-type>
jlaur marked this conversation as resolved.
Show resolved Hide resolved
<label>Humidity</label>
<description>Current humidity in %</description>
<category>Humidity</category>
<state readOnly="true" pattern="%.1f %%"></state>
</channel-type>

<channel-type id="heatingPower">
<item-type>Number</item-type>
<item-type>Number:Dimensionless</item-type>
<label>Heating Power</label>
<description>Current heating power</description>
<category>Fire</category>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">

<thing-type uid="tado:zone">
<instruction-set targetVersion="1">
<update-channel id="heatingPower">
<type>Number:Dimensionless</type>
jlaur marked this conversation as resolved.
Show resolved Hide resolved
</update-channel>
<update-channel id="humidity">
<type>Number:Dimensionless</type>
</update-channel>
</instruction-set>
</thing-type>

</update:update-descriptions>