[sleepiq] Add new channels (#14447)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
This commit is contained in:
@@ -76,6 +76,18 @@ public class SleepIQBindingConstants {
|
||||
public static final String CHANNEL_LEFT_TODAY_SLEEP_DURATION_SECONDS = "left#todaySleepDurationSeconds";
|
||||
public static final String CHANNEL_RIGHT_TODAY_SLEEP_DURATION_SECONDS = "right#todaySleepDurationSeconds";
|
||||
|
||||
public static final String CHANNEL_LEFT_TODAY_SLEEP_IN_BED_SECONDS = "left#todaySleepInBedSeconds";
|
||||
public static final String CHANNEL_RIGHT_TODAY_SLEEP_IN_BED_SECONDS = "right#todaySleepInBedSeconds";
|
||||
|
||||
public static final String CHANNEL_LEFT_TODAY_SLEEP_OUT_OF_BED_SECONDS = "left#todaySleepOutOfBedSeconds";
|
||||
public static final String CHANNEL_RIGHT_TODAY_SLEEP_OUT_OF_BED_SECONDS = "right#todaySleepOutOfBedSeconds";
|
||||
|
||||
public static final String CHANNEL_LEFT_TODAY_SLEEP_RESTFUL_SECONDS = "left#todaySleepRestfulSeconds";
|
||||
public static final String CHANNEL_RIGHT_TODAY_SLEEP_RESTFUL_SECONDS = "right#todaySleepRestfulSeconds";
|
||||
|
||||
public static final String CHANNEL_LEFT_TODAY_SLEEP_RESTLESS_SECONDS = "left#todaySleepRestlessSeconds";
|
||||
public static final String CHANNEL_RIGHT_TODAY_SLEEP_RESTLESS_SECONDS = "right#todaySleepRestlessSeconds";
|
||||
|
||||
public static final String CHANNEL_LEFT_MONTHLY_SLEEP_IQ = "left#monthlySleepIQ";
|
||||
public static final String CHANNEL_RIGHT_MONTHLY_SLEEP_IQ = "right#monthlySleepIQ";
|
||||
|
||||
|
||||
@@ -242,12 +242,20 @@ public class SleepIQDualBedHandler extends BaseThingHandler implements BedStatus
|
||||
updateState(CHANNEL_LEFT_TODAY_AVG_RESPIRATION_RATE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_LEFT_TODAY_MESSAGE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_DURATION_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_IN_BED_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_OUT_OF_BED_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_RESTFUL_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_RESTLESS_SECONDS, UnDefType.UNDEF);
|
||||
} else {
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_IQ, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_AVG_HEART_RATE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_AVG_RESPIRATION_RATE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_MESSAGE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_DURATION_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_IN_BED_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_OUT_OF_BED_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_RESTFUL_SECONDS, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_RESTLESS_SECONDS, UnDefType.UNDEF);
|
||||
}
|
||||
return;
|
||||
} else if (sleeper.getSide().equals(Side.LEFT)) {
|
||||
@@ -258,6 +266,14 @@ public class SleepIQDualBedHandler extends BaseThingHandler implements BedStatus
|
||||
updateState(CHANNEL_LEFT_TODAY_MESSAGE, new StringType(sleepData.getSleepDataDays().get(0).getMessage()));
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_DURATION_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalSleepSessionTime(), Units.SECOND));
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_IN_BED_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalInBedSeconds(), Units.SECOND));
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_OUT_OF_BED_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalOutOfBedSeconds(), Units.SECOND));
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_RESTFUL_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalRestfulSeconds(), Units.SECOND));
|
||||
updateState(CHANNEL_LEFT_TODAY_SLEEP_RESTLESS_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalRestlessSeconds(), Units.SECOND));
|
||||
} else if (sleeper.getSide().equals(Side.RIGHT)) {
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_IQ, new DecimalType(sleepData.getAverageSleepIQ()));
|
||||
updateState(CHANNEL_RIGHT_TODAY_AVG_HEART_RATE, new DecimalType(sleepData.getAverageHeartRate()));
|
||||
@@ -266,6 +282,14 @@ public class SleepIQDualBedHandler extends BaseThingHandler implements BedStatus
|
||||
updateState(CHANNEL_RIGHT_TODAY_MESSAGE, new StringType(sleepData.getSleepDataDays().get(0).getMessage()));
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_DURATION_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalSleepSessionTime(), Units.SECOND));
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_IN_BED_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalInBedSeconds(), Units.SECOND));
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_OUT_OF_BED_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalOutOfBedSeconds(), Units.SECOND));
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_RESTFUL_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalRestfulSeconds(), Units.SECOND));
|
||||
updateState(CHANNEL_RIGHT_TODAY_SLEEP_RESTLESS_SECONDS,
|
||||
new QuantityType<>(sleepData.getTotalRestlessSeconds(), Units.SECOND));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,76 @@
|
||||
# add-on
|
||||
|
||||
addon.sleepiq.name = SleepIQ Binding
|
||||
addon.sleepiq.description = This is the binding for the Sleep Number SleepIQ system.
|
||||
|
||||
# thing types
|
||||
|
||||
thing-type.sleepiq.cloud.label = SleepIQ Cloud
|
||||
thing-type.sleepiq.cloud.description = The SleepIQ cloud service provides connections to all beds in an account.
|
||||
thing-type.sleepiq.dualBed.label = Dual Chamber Bed
|
||||
thing-type.sleepiq.dualBed.description = A Sleep Number bed with SleepIQ and two individual air chambers
|
||||
|
||||
# thing types config
|
||||
|
||||
thing-type.config.sleepiq.cloud.password.label = Password
|
||||
thing-type.config.sleepiq.cloud.password.description = Password of a registered SleepIQ account owner
|
||||
thing-type.config.sleepiq.cloud.pollingInterval.label = Polling Interval
|
||||
thing-type.config.sleepiq.cloud.pollingInterval.description = Seconds between fetching values from the cloud service
|
||||
thing-type.config.sleepiq.cloud.username.label = Username
|
||||
thing-type.config.sleepiq.cloud.username.description = Username of a registered SleepIQ account owner
|
||||
thing-type.config.sleepiq.dualBed.bedId.label = Bed ID
|
||||
thing-type.config.sleepiq.dualBed.bedId.description = The bed identifier identifies a specific bed
|
||||
|
||||
# channel group types
|
||||
|
||||
channel-group-type.sleepiq.chamberGroupType.label = Chamber
|
||||
|
||||
# channel types
|
||||
|
||||
channel-type.sleepiq.alertDetailedMessageType.label = Alert Detailed Message
|
||||
channel-type.sleepiq.alertDetailedMessageType.description = A detailed message describing an alert condition with the chamber
|
||||
channel-type.sleepiq.alertIdType.label = Alert ID
|
||||
channel-type.sleepiq.alertIdType.description = Identifier for an alert condition with the chamber
|
||||
channel-type.sleepiq.firstNameType.label = First Name
|
||||
channel-type.sleepiq.firstNameType.description = The first name of the sleeper
|
||||
channel-type.sleepiq.inBedType.label = In Bed
|
||||
channel-type.sleepiq.inBedType.description = The presence of a person or object on the chamber
|
||||
channel-type.sleepiq.lastLinkType.label = Last Link
|
||||
channel-type.sleepiq.lastLinkType.description = The amount of time that has passed since a connection was made from the chamber to the cloud service (D d HH:MM:SS)
|
||||
channel-type.sleepiq.monthlyAverageHeartRateType.label = Monthly Avg Heart Rate
|
||||
channel-type.sleepiq.monthlyAverageHeartRateType.description = The average heart rate for the past month
|
||||
channel-type.sleepiq.monthlyAverageRespirationRateType.label = Monthly Avg Respiration Rate
|
||||
channel-type.sleepiq.monthlyAverageRespirationRateType.description = The average respiration rate for the past month
|
||||
channel-type.sleepiq.monthlySleepIQType.label = Monthly Sleep IQ
|
||||
channel-type.sleepiq.monthlySleepIQType.description = The overall Sleep Quotient for the past month
|
||||
channel-type.sleepiq.pressureType.label = Pressure
|
||||
channel-type.sleepiq.pressureType.description = The current pressure inside the chamber
|
||||
channel-type.sleepiq.privacyMode.label = Privacy Mode
|
||||
channel-type.sleepiq.privacyMode.description = Enable/disable privacy mode
|
||||
channel-type.sleepiq.sleepGoalMinutesType.label = Sleep Goal
|
||||
channel-type.sleepiq.sleepGoalMinutesType.description = The goal for the amount of sleep per night (in minutes)
|
||||
channel-type.sleepiq.sleepNumberType.label = Sleep Number
|
||||
channel-type.sleepiq.sleepNumberType.description = The Sleep Number setting of the chamber
|
||||
channel-type.sleepiq.todayAverageHeartRateType.label = Today's Avg Heart Rate
|
||||
channel-type.sleepiq.todayAverageHeartRateType.description = The average heart rate for today
|
||||
channel-type.sleepiq.todayAverageRespirationRateType.label = Today's Avg Respiration Rate
|
||||
channel-type.sleepiq.todayAverageRespirationRateType.description = The average respiration rate for today
|
||||
channel-type.sleepiq.todayMessageType.label = Today's Message
|
||||
channel-type.sleepiq.todayMessageType.description = The description of today's sleep quality
|
||||
channel-type.sleepiq.todaySleepDurationSecondsType.label = Today's Sleep Duration
|
||||
channel-type.sleepiq.todaySleepDurationSecondsType.description = The total duration of sleep for today in seconds
|
||||
channel-type.sleepiq.todaySleepIQType.label = Today's Sleep IQ
|
||||
channel-type.sleepiq.todaySleepIQType.description = The Sleep Quotient for today
|
||||
channel-type.sleepiq.todaySleepInBedSecondsType.label = Today's Sleep In Bed Duration
|
||||
channel-type.sleepiq.todaySleepInBedSecondsType.description = The total duration of time in bed in seconds
|
||||
channel-type.sleepiq.todaySleepOutOfBedSecondsType.label = Today's Sleep Out Of Bed Duration
|
||||
channel-type.sleepiq.todaySleepOutOfBedSecondsType.description = The total duration of time out of bed in seconds
|
||||
channel-type.sleepiq.todaySleepRestfulSecondsType.label = Today's Sleep Restful Duration
|
||||
channel-type.sleepiq.todaySleepRestfulSecondsType.description = The total duration of restful sleep for today in seconds
|
||||
channel-type.sleepiq.todaySleepRestlessSecondsType.label = Today's Sleep Restless Duration
|
||||
channel-type.sleepiq.todaySleepRestlessSecondsType.description = The total duration of restless sleep for today in seconds
|
||||
|
||||
# configuration messages
|
||||
config-status.error.missing-username-configuration=No username for the SleepIQ cloud has been provided.
|
||||
config-status.error.missing-password-configuration=No password for the SleepIQ cloud has been provided.
|
||||
|
||||
config-status.error.missing-username-configuration = No username for the SleepIQ cloud has been provided.
|
||||
config-status.error.missing-password-configuration = No password for the SleepIQ cloud has been provided.
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
<label>Username</label>
|
||||
<description>Username of a registered SleepIQ account owner</description>
|
||||
</parameter>
|
||||
<parameter name="password" type="text" required="false">
|
||||
<parameter name="password" type="text" required="true">
|
||||
<label>Password</label>
|
||||
<description>Password of a registered SleepIQ account owner</description>
|
||||
<context>password</context>
|
||||
</parameter>
|
||||
<parameter name="pollingInterval" type="integer" min="30" step="30" required="true">
|
||||
<parameter name="pollingInterval" type="integer" min="30" step="30">
|
||||
<label>Polling Interval</label>
|
||||
<description>Seconds between fetching values from the cloud service</description>
|
||||
<default>120</default>
|
||||
@@ -94,6 +94,10 @@
|
||||
<channel id="todayAverageRespirationRate" typeId="todayAverageRespirationRateType"/>
|
||||
<channel id="todayMessage" typeId="todayMessageType"/>
|
||||
<channel id="todaySleepDurationSeconds" typeId="todaySleepDurationSecondsType"/>
|
||||
<channel id="todaySleepInBedSeconds" typeId="todaySleepInBedSecondsType"/>
|
||||
<channel id="todaySleepOutOfBedSeconds" typeId="todaySleepOutOfBedSecondsType"/>
|
||||
<channel id="todaySleepRestfulSeconds" typeId="todaySleepRestfulSecondsType"/>
|
||||
<channel id="todaySleepRestlessSeconds" typeId="todaySleepRestlessSecondsType"/>
|
||||
<channel id="monthlySleepIQ" typeId="monthlySleepIQType"/>
|
||||
<channel id="monthlyAverageHeartRate" typeId="monthlyAverageHeartRateType"/>
|
||||
<channel id="monthlyAverageRespirationRate" typeId="monthlyAverageRespirationRateType"/>
|
||||
@@ -185,6 +189,30 @@
|
||||
<description>The total duration of sleep for today in seconds</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
<channel-type id="todaySleepInBedSecondsType">
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Today's Sleep In Bed Duration</label>
|
||||
<description>The total duration of time in bed in seconds</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
<channel-type id="todaySleepOutOfBedSecondsType">
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Today's Sleep Out Of Bed Duration</label>
|
||||
<description>The total duration of time out of bed in seconds</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
<channel-type id="todaySleepRestfulSecondsType">
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Today's Sleep Restful Duration</label>
|
||||
<description>The total duration of restful sleep for today in seconds</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
<channel-type id="todaySleepRestlessSecondsType">
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Today's Sleep Restless Duration</label>
|
||||
<description>The total duration of restless sleep for today in seconds</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
<channel-type id="monthlySleepIQType">
|
||||
<item-type>Number</item-type>
|
||||
<label>Monthly Sleep IQ</label>
|
||||
|
||||
Reference in New Issue
Block a user