Skip to content

Commit

Permalink
Add leak and temperature accessories only if values exist in returned…
Browse files Browse the repository at this point in the history
… data
  • Loading branch information
dkerr64 committed Aug 10, 2024
1 parent 5f24491 commit 900c912
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 145 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ YoLink vibration sensors also report device temperature. If you set the *tempera

### Water Meter Controller

YoLink water meter and valve controllers report as a *WaterMeterController* device, the plugin registers this as a HomeKit generic valve. HomeKit has the concept of both open/close and in-use where in-use means that fluid is actually flowing through the device. Presumably this allows for a valve to be open, but no fluid to flow.
YoLink water meter and valve controllers report as a *WaterMeterController* device, the plugin registers this as a HomeKit generic valve. HomeKit has the concept of both open/close and in-use where in-use means that fluid is actually flowing through the device. This allows for a valve to be open, but no fluid to flow.

In contrast to the original *Manipulator* devices, these devices do report whether water is flowing. However these devices currently do not update this status in real time and this can confuse Apple Home which will repport "Waiting..." after you open the valve -- as it waits for the in-use characteristic to indicate water flowing. Therefore, by default, this plugin will report in-use based on whether the value is open or closed. You can set the config *useWaterFlowing* setting to change this to use the water flowing status from the device.
The *YS-5008-UC* valve does report whether water is flowing. However these devices currently do not update this status in real time and this can confuse Apple Home which will repport "Waiting..." after you open the valve -- as it waits for the in-use characteristic to indicate water flowing. Therefore, by default, this plugin will report in-use based on whether the value is open or closed. You can set the config *useWaterFlowing* setting to change this to use the water flowing status from the device.

This plugin expects to receive status updates from YoLink devices when status changes. As this device is not currently doing this for *waterFlowing*, an alternative would be to change the *refreshAfter* config setting for this device only (do not change it globally) and the plugin will poll the device for status more regularly. The minimum time you can set this to is 60 seconds. However this is *not recommended* as it places additional load on the LoRa protocol and the affects on device battery life are unknown.

A Leak Sensor and Temperature Sensor service is added with this device. The name of each has "Leak" and "Temperature" appended to the end.
A Leak Sensor and, if supported, a Temperature Sensor service is added with this device. The name of each has "Leak" and "Temperature" appended to the end. *YS-5006-UC* is known not to report temperature.

### Unsupported Devices

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge YoLink",
"name": "homebridge-yolink",
"version": "1.5.8-beta.7",
"version": "1.5.8-beta.10",
"description": "Connect to YoLink.",
"license": "Apache-2.0",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/deviceHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const initDeviceService = {
Dimmer(this: YoLinkPlatformAccessory) { initLightbulb.bind(this)('open', 'open', 'close'); },
InfraredRemoter(this: YoLinkPlatformAccessory) { initInfraredRemoter.bind(this)(); },
COSmokeSensor(this: YoLinkPlatformAccessory) { initCoSmokeDetector.bind(this)(); },
WaterMeterController(this: YoLinkPlatformAccessory) { initValveDevice.bind(this)('WaterMeterController'); },
WaterMeterController(this: YoLinkPlatformAccessory) { initValveDevice.bind(this)(); },
};

export const mqttHandler = {
Expand Down
Loading

0 comments on commit 900c912

Please sign in to comment.