dkerr64 / homebridge-yolink

Apache License 2.0
12 stars 2 forks source link

Support for CO and Smoke Detectors #89

Closed threeonparfive closed 9 months ago

threeonparfive commented 9 months ago

I've added 2 smoke detectors and here are the logs. They do show up in HomeKit by name but showing as "Not Supported".

[12/9/2023, 8:42:50 AM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (Smoke Alarm (d88b4c0100061adc)) (initialize) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "deviceId": "d88b4c0100061adc", "deviceUDID": "14c6dd3d28ce48c89cd004771344893d", "name": "Smoke Alarm", "token": "D051DAF7ED981EFB16F6CE8859C2BB32", "type": "COSmokeSensor", "parentDeviceId": null, "modelName": "YS7A02-UC", "config": { "refreshAfter": 14500, "enableExperimental": false, "temperature": false, "powerFailureSensorAs": "Outlet" }, "data": {}, "deviceMsgName": "Smoke Alarm (d88b4c0100061adc)", "lastReportAtTime": 0, "hasBattery": false, "updateTime": 1702129370, "reportAtTime": "1970-01-01T00:00:00.000Z", "semaphore": { "_nextSemaphoreId": 0, "_maxSemaphores": 1, "name": "anonymous 10", "_loggedName": "“anonymous 10”", "_currentSemaphores": {}, "_waitingCallers": [] }, "timeout": 45, "targetState": "" } [12/9/2023, 8:42:50 AM] [YoLink] Adding new accessory: Smoke Alarm (d88b4c0100061a08) [12/9/2023, 8:42:50 AM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (Smoke Alarm (d88b4c0100061a08)) (initialize) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "deviceId": "d88b4c0100061a08", "deviceUDID": "b41e72750c404cdf9db29fb1a9474363", "name": "Smoke Alarm", "token": "DD62A949896A5C6ACFBC8CF37209DC6B", "type": "COSmokeSensor", "parentDeviceId": null, "modelName": "YS7A02-UC", "config": { "refreshAfter": 14500, "enableExperimental": false, "temperature": false, "powerFailureSensorAs": "Outlet" }, "data": {}, "deviceMsgName": "Smoke Alarm (d88b4c0100061a08)", "lastReportAtTime": 0, "hasBattery": false, "updateTime": 1702129370, "reportAtTime": "1970-01-01T00:00:00.000Z", "semaphore": { "_nextSemaphoreId": 0, "_maxSemaphores": 1, "name": "anonymous 11", "_loggedName": "“anonymous 11”", "_currentSemaphores": {}, "_waitingCallers": [] }, "timeout": 45, "targetState": "" } [12/9/2023, 8:42:50 AM] [YoLink] Not registering device YoLink Hub (d88b4c160303664a) as config 'hide=true' [12/9/2023, 8:42:50 AM] [YoLink] Create MQTT client to connect to YoLink message service [12/9/2023, 8:42:50 AM] [YoLink] MQTT subscribed: yl-home/b34dd4fd014b47879fa4b1051fca6440/+/report [12/9/2023, 8:42:50 AM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (Smoke Alarm (d88b4c0100061a08)) (handleGet) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "online": true, "state": { "battery": 4, "devTemperature": 22, "interval": 120, "metadata": { "inspect": true }, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "stateChangedAt": { "gasAlarm": 1701962206458, "smokeAlarm": 1701962206458, "unexpected": 1702128701737 }, "tz": 0, "version": "0202", "lastInspection": { "time": 1702128770316 } }, "deviceId": "d88b4c0100061a08", "reportAt": "2023-12-09T13:32:50.317Z" } [12/9/2023, 8:42:50 AM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (Smoke Alarm (d88b4c0100061adc)) (handleGet) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "online": true, "state": { "battery": 3, "devTemperature": 23, "interval": 120, "metadata": { "inspect": false }, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "stateChangedAt": { "gasAlarm": 1701958332245, "smokeAlarm": 1701958332245, "unexpected": 1702127796174 }, "tz": 0, "version": "0202", "lastInspection": { "time": 1702127796174 } }, "deviceId": "d88b4c0100061adc", "reportAt": "2023-12-09T13:16:36.882Z" } [12/9/2023, 8:48:19 AM] [YoLink] MQTT: THSensor.setAlarm for device Pool Temperature (d88b4c0100079e9c) not supported. Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "event": "THSensor.setAlarm", "time": 1702129699216, "msgid": "1702129699215", "data": { "interval": 0, "tempLimit": { "max": 39, "min": -1000 }, "humidityLimit": { "max": 0, "min": 0 }, "loraInfo": { "netId": "010202", "signal": -40, "gatewayId": "d88b4c160303664a", "gateways": 1 } }, "deviceId": "d88b4c0100079e9c" }

dkerr64 commented 9 months ago

Please test beta version that I just pushed. In Homebridge select the "manage version" or "install alternate version" in the user interface and select the beta version...

image

This is a work-in-progress, it should add a new HomeKit accessory with both a Carbon Monoxide and Smoke sensor (your device is I think smoke only, once I finish the config/UI support you will be able to hide the CO sensor).

I am most interested in the MQTT messages sent from the device... I think I am probably handling them correctly but as I don't have one of these devices I can't test, so I have left in the warning-level log message so it will appear in orange in your log. Soon as you see one of those please post it here. Note that an MQTT message may take a long time to arrive... up to 4 hours. These messages are sent by devices when something changes, or at a regular (long) interval. You could start a fire!!! or patiently wait for its regular "phone home" reporting.

The MQTT message you show in the log is from a temperature/humidity sensor. I do support those devices but the specific THSensor.setAlarm message I do not handle. I've not done anything to that yet, but it is a feature not supported by HomeKit so I will suppress that message.

THANK YOU. Looking forward to you reporting back.

threeonparfive commented 9 months ago

Here's what I have so far after updating and restarting. Will keep an eye out for the MQTT message and post when I can.

[12/9/2023, 12:19:14 PM] [YoLink] Loaded homebridge-yolink v1.4.4-beta.0 child bridge successfully [12/9/2023, 12:19:14 PM] Loaded 12 cached accessories from cachedAccessories.0E2268537B5C. [12/9/2023, 12:19:14 PM] [YoLink] YoLink plugin for HomeBridge version 1.4.4-beta.0 (c) 2022-2023 David A. Kerr Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues

[12/9/2023, 12:19:14 PM] [YoLink] Login to YoLink API with credentials from config [12/9/2023, 12:19:14 PM] Homebridge v1.7.0 (HAP v0.11.1) (YoLink) is running on port 30870. [12/9/2023, 12:19:15 PM] [YoLink] Starting interval timer to refresh accessToken every 6480 seconds [12/9/2023, 12:19:16 PM] [YoLink] [YS7A02-UC (d88b4c0100061adc) Smoke Alarm] Experimental device skipped. Enable experimental devices in config. Initializing as Unknown device [12/9/2023, 12:19:16 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061adc) Smoke Alarm) (initialize) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "deviceId": "d88b4c0100061adc", "deviceUDID": "14c6dd3d28ce48c89cd004771344893d", "name": "Smoke Alarm", "token": "D051DAF7ED981EFB16F6CE8859C2BB32", "type": "COSmokeSensor", "parentDeviceId": null, "modelName": "YS7A02-UC", "config": { "refreshAfter": 14500, "enableExperimental": false, "temperature": false, "powerFailureSensorAs": "Outlet" }, "deviceMsgName": "YS7A02-UC (d88b4c0100061adc) Smoke Alarm", "data": {}, "lastReportAtTime": 0, "hasBattery": true, "updateTime": 1702142356, "reportAtTime": "1970-01-01T00:00:00.000Z", "semaphore": { "_nextSemaphoreId": 8, "_maxSemaphores": 1, "name": "anonymous 1", "_loggedName": "“anonymous 1”", "_currentSemaphores": {}, "_waitingCallers": [ null, null, null, null, null, null, null, null ] }, "timeout": 45, "targetState": "" } [12/9/2023, 12:19:16 PM] [YoLink] [YS7A02-UC (d88b4c0100061a08) Smoke Alarm] Experimental device skipped. Enable experimental devices in config. Initializing as Unknown device [12/9/2023, 12:19:16 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061a08) Smoke Alarm) (initialize) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "deviceId": "d88b4c0100061a08", "deviceUDID": "b41e72750c404cdf9db29fb1a9474363", "name": "Smoke Alarm", "token": "DD62A949896A5C6ACFBC8CF37209DC6B", "type": "COSmokeSensor", "parentDeviceId": null, "modelName": "YS7A02-UC", "config": { "refreshAfter": 14500, "enableExperimental": false, "temperature": false, "powerFailureSensorAs": "Outlet" }, "deviceMsgName": "YS7A02-UC (d88b4c0100061a08) Smoke Alarm", "data": {}, "lastReportAtTime": 0, "hasBattery": true, "updateTime": 1702142356, "reportAtTime": "1970-01-01T00:00:00.000Z", "semaphore": { "_nextSemaphoreId": 9, "_maxSemaphores": 1, "name": "anonymous 1", "_loggedName": "“anonymous 1”", "_currentSemaphores": {}, "_waitingCallers": [ null, null, null, null, null, null, null, null, null ] }, "timeout": 45, "targetState": "" } [12/9/2023, 12:19:16 PM] [YoLink] [YS1603-UC (d88b4c160303664a) YoLink Hub] Not registering device as config 'hide=true' [12/9/2023, 12:19:16 PM] [YoLink] Create MQTT client to connect to YoLink message service [12/9/2023, 12:19:16 PM] [YoLink] MQTT subscribed: yl-home/b34dd4fd014b47879fa4b1051fca6440/+/report [12/9/2023, 12:19:16 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084e49) Hall Bath [12/9/2023, 12:19:16 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084d5d) Heat Pump [12/9/2023, 12:19:17 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084ceb) Main Shutoff [12/9/2023, 12:19:19 PM] [YoLink] Device initialized: YS5003-UC (d88b4c0100081e51) Main Water Valve [12/9/2023, 12:19:19 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084ce8) Master Bath [12/9/2023, 12:19:19 PM] [YoLink] Device initialized: YS8004-UC (d88b4c0100079e9c) Pool Temperature [12/9/2023, 12:19:20 PM] [YoLink] Device initialized: YS7906-UC (d88b4c010008519d) Refrigerator [12/9/2023, 12:19:20 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084d17) Sink [12/9/2023, 12:19:20 PM] [YoLink] Error in updateBatteryInfo Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues TypeError: Cannot read properties of undefined (reading 'updateCharacteristic') at YoLinkPlatformAccessory.updateBatteryInfo (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:226:33) at YoLinkPlatformAccessory.checkDeviceState (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:147:52) at processTicksAndRejections (node:internal/process/task_queues:95:5) at YoLinkPlatformAccessory.handleGet (/volume1/homebridge/node_modules/homebridge-yolink/src/unknownDevice.ts:39:9) at YoLinkPlatformAccessory.refreshDataTimer (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:195:5) [12/9/2023, 12:19:20 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061adc) Smoke Alarm) (handleGet) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "online": true, "state": { "battery": 3, "devTemperature": 21, "interval": 120, "metadata": { "inspect": false }, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "stateChangedAt": { "gasAlarm": 1701958332245, "smokeAlarm": 1701958332245, "unexpected": 1702127796174 }, "tz": 0, "version": "0202", "lastInspection": { "time": 1702127796174 } }, "deviceId": "d88b4c0100061adc", "reportAt": "2023-12-09T17:16:18.705Z" } [12/9/2023, 12:19:20 PM] [YoLink] Device initialized: YS7A02-UC (d88b4c0100061adc) Smoke Alarm [12/9/2023, 12:19:21 PM] [YoLink] Error in updateBatteryInfo Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues TypeError: Cannot read properties of undefined (reading 'updateCharacteristic') at YoLinkPlatformAccessory.updateBatteryInfo (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:226:33) at YoLinkPlatformAccessory.checkDeviceState (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:147:52) at processTicksAndRejections (node:internal/process/task_queues:95:5) at YoLinkPlatformAccessory.handleGet (/volume1/homebridge/node_modules/homebridge-yolink/src/unknownDevice.ts:39:9) at YoLinkPlatformAccessory.refreshDataTimer (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:195:5) [12/9/2023, 12:19:21 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061a08) Smoke Alarm) (handleGet) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "online": true, "state": { "battery": 4, "devTemperature": 22, "interval": 120, "metadata": { "inspect": true }, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "stateChangedAt": { "gasAlarm": 1701962206458, "smokeAlarm": 1701962206458, "unexpected": 1702128701737 }, "tz": 0, "version": "0202", "lastInspection": { "time": 1702128770316 } }, "deviceId": "d88b4c0100061a08", "reportAt": "2023-12-09T13:32:50.317Z" } [12/9/2023, 12:19:21 PM] [YoLink] Device initialized: YS7A02-UC (d88b4c0100061a08) Smoke Alarm [12/9/2023, 12:19:21 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100085195) Washer [12/9/2023, 12:19:21 PM] [YoLink] Device initialized: YS3604-UC (d88b4c01000687cb) YoLink Fob

dkerr64 commented 9 months ago

Thank you. Looks like I am still logging as unsupported, and have a bug in battery info. Will work on it later today.

dkerr64 commented 9 months ago

Just pushed a new beta that should clean up the unnecessary logging and remove the battery info error. Please install and run this and then patiently wait for a MQTT message to arrive. Thanks.

threeonparfive commented 9 months ago

This is what I have so far. I think the MQTT message may be from the water temperature sensor I recently added as well but not sure. I figured I'd give you everything just in case and will keep an eye out for more.

[12/9/2023, 1:13:11 PM] Registering platform 'homebridge-yolink.YoLink' [12/9/2023, 1:13:11 PM] [YoLink] Loaded homebridge-yolink v1.4.4-beta.2 child bridge successfully [12/9/2023, 1:13:11 PM] Loaded 12 cached accessories from cachedAccessories.0E2268537B5C. [12/9/2023, 1:13:11 PM] [YoLink] YoLink plugin for HomeBridge version 1.4.4-beta.2 (c) 2022-2023 David A. Kerr Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues

[12/9/2023, 1:13:11 PM] [YoLink] Login to YoLink API with credentials from config [12/9/2023, 1:13:11 PM] Homebridge v1.7.0 (HAP v0.11.1) (YoLink) is running on port 30870. [12/9/2023, 1:13:11 PM] [YoLink] Starting interval timer to refresh accessToken every 6480 seconds [12/9/2023, 1:13:12 PM] [YoLink] [YS7A02-UC (d88b4c0100061adc) Smoke Alarm] Experimental device skipped. Enable experimental devices in config. Initializing as Unknown device [12/9/2023, 1:13:12 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061adc) Smoke Alarm) (initialize) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "deviceId": "d88b4c0100061adc", "deviceUDID": "14c6dd3d28ce48c89cd004771344893d", "name": "Smoke Alarm", "token": "D051DAF7ED981EFB16F6CE8859C2BB32", "type": "COSmokeSensor", "parentDeviceId": null, "modelName": "YS7A02-UC", "config": { "refreshAfter": 14500, "enableExperimental": false, "temperature": false, "powerFailureSensorAs": "Outlet" }, "deviceMsgName": "YS7A02-UC (d88b4c0100061adc) Smoke Alarm", "data": {}, "lastReportAtTime": 0, "hasBattery": true, "updateTime": 1702145592, "reportAtTime": "1970-01-01T00:00:00.000Z", "semaphore": { "_nextSemaphoreId": 8, "_maxSemaphores": 1, "name": "anonymous 1", "_loggedName": "“anonymous 1”", "_currentSemaphores": {}, "_waitingCallers": [ null, null, null, null, null, null, null, null ] }, "timeout": 45, "targetState": "" } [12/9/2023, 1:13:12 PM] [YoLink] [YS7A02-UC (d88b4c0100061a08) Smoke Alarm] Experimental device skipped. Enable experimental devices in config. Initializing as Unknown device [12/9/2023, 1:13:12 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061a08) Smoke Alarm) (initialize) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "deviceId": "d88b4c0100061a08", "deviceUDID": "b41e72750c404cdf9db29fb1a9474363", "name": "Smoke Alarm", "token": "DD62A949896A5C6ACFBC8CF37209DC6B", "type": "COSmokeSensor", "parentDeviceId": null, "modelName": "YS7A02-UC", "config": { "refreshAfter": 14500, "enableExperimental": false, "temperature": false, "powerFailureSensorAs": "Outlet" }, "deviceMsgName": "YS7A02-UC (d88b4c0100061a08) Smoke Alarm", "data": {}, "lastReportAtTime": 0, "hasBattery": true, "updateTime": 1702145592, "reportAtTime": "1970-01-01T00:00:00.000Z", "semaphore": { "_nextSemaphoreId": 9, "_maxSemaphores": 1, "name": "anonymous 1", "_loggedName": "“anonymous 1”", "_currentSemaphores": {}, "_waitingCallers": [ null, null, null, null, null, null, null, null, null ] }, "timeout": 45, "targetState": "" } [12/9/2023, 1:13:12 PM] [YoLink] [YS1603-UC (d88b4c160303664a) YoLink Hub] Not registering device as config 'hide=true' [12/9/2023, 1:13:12 PM] [YoLink] Create MQTT client to connect to YoLink message service [12/9/2023, 1:13:12 PM] [YoLink] MQTT subscribed: yl-home/b34dd4fd014b47879fa4b1051fca6440/+/report [12/9/2023, 1:13:12 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084e49) Hall Bath [12/9/2023, 1:13:13 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084d5d) Heat Pump [12/9/2023, 1:13:13 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084ceb) Main Shutoff [12/9/2023, 1:13:17 PM] [YoLink] [YS5003-UC (d88b4c0100081e51) Main Water Valve] YoLink API error code: 000201 Can't connect to Device (Manipulator.getState) [12/9/2023, 1:13:26 PM] [YoLink] [YS5003-UC (d88b4c0100081e51) Main Water Valve] YoLink API error code: 000201 Can't connect to Device (Manipulator.getState) [12/9/2023, 1:13:39 PM] [YoLink] Device initialized: YS5003-UC (d88b4c0100081e51) Main Water Valve [12/9/2023, 1:13:39 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084ce8) Master Bath [12/9/2023, 1:13:39 PM] [YoLink] Device initialized: YS8004-UC (d88b4c0100079e9c) Pool Temperature [12/9/2023, 1:13:40 PM] [YoLink] Device initialized: YS7906-UC (d88b4c010008519d) Refrigerator [12/9/2023, 1:13:40 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100084d17) Sink [12/9/2023, 1:13:40 PM] [YoLink] Error in updateBatteryInfo Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues TypeError: Cannot read properties of undefined (reading 'updateCharacteristic') at YoLinkPlatformAccessory.updateBatteryInfo (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:226:33) at YoLinkPlatformAccessory.checkDeviceState (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:147:52) at processTicksAndRejections (node:internal/process/task_queues:95:5) at YoLinkPlatformAccessory.handleGet (/volume1/homebridge/node_modules/homebridge-yolink/src/unknownDevice.ts:39:9) at YoLinkPlatformAccessory.refreshDataTimer (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:195:5) [12/9/2023, 1:13:40 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061adc) Smoke Alarm) (handleGet) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "online": true, "state": { "battery": 3, "devTemperature": 21, "interval": 120, "metadata": { "inspect": false }, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "stateChangedAt": { "gasAlarm": 1701958332245, "smokeAlarm": 1701958332245, "unexpected": 1702127796174 }, "tz": 0, "version": "0202", "lastInspection": { "time": 1702127796174 } }, "deviceId": "d88b4c0100061adc", "reportAt": "2023-12-09T17:16:18.705Z" } [12/9/2023, 1:13:40 PM] [YoLink] Device initialized: YS7A02-UC (d88b4c0100061adc) Smoke Alarm [12/9/2023, 1:13:41 PM] [YoLink] Error in updateBatteryInfo Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues TypeError: Cannot read properties of undefined (reading 'updateCharacteristic') at YoLinkPlatformAccessory.updateBatteryInfo (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:226:33) at YoLinkPlatformAccessory.checkDeviceState (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:147:52) at processTicksAndRejections (node:internal/process/task_queues:95:5) at YoLinkPlatformAccessory.handleGet (/volume1/homebridge/node_modules/homebridge-yolink/src/unknownDevice.ts:39:9) at YoLinkPlatformAccessory.refreshDataTimer (/volume1/homebridge/node_modules/homebridge-yolink/src/platformAccessory.ts:195:5) [12/9/2023, 1:13:41 PM] [YoLink] YoLink device type: 'COSmokeSensor' is not supported (YS7A02-UC (d88b4c0100061a08) Smoke Alarm) (handleGet) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "online": true, "state": { "battery": 4, "devTemperature": 20, "interval": 120, "metadata": { "inspect": false }, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "stateChangedAt": { "gasAlarm": 1701962206458, "smokeAlarm": 1701962206458, "unexpected": 1702128701737 }, "tz": 0, "version": "0202", "lastInspection": { "time": 1702128770316 } }, "deviceId": "d88b4c0100061a08", "reportAt": "2023-12-09T17:31:55.448Z" } [12/9/2023, 1:13:41 PM] [YoLink] Device initialized: YS7A02-UC (d88b4c0100061a08) Smoke Alarm [12/9/2023, 1:13:41 PM] [YoLink] Device initialized: YS7906-UC (d88b4c0100085195) Washer [12/9/2023, 1:13:41 PM] [YoLink] Device initialized: YS3604-UC (d88b4c01000687cb) YoLink Fob [12/9/2023, 1:52:18 PM] [YoLink] Error in mqttThermoHydroDevice Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues TypeError: Cannot read properties of undefined (reading 'lowBattery') at YoLinkPlatformAccessory.mqttThermoHydroDevice (/volume1/homebridge/node_modules/homebridge-yolink/src/thermoHydroDevice.ts:253:31)

dkerr64 commented 9 months ago

Okay, my apologies, I forgot to tell you to turn on "experimental" flag, so it is not picking up the new device. Sorry about that. I have changed it so that it will initialize without that flag, please try beta 5.

Thanks, and sorry.

threeonparfive commented 9 months ago

Is this a what you need?

[12/9/2023, 8:16:19 PM] [YoLink] YoLink device type: 'COSmokeSensor' is under development (YS7A02-UC (d88b4c0100061adc) Kitchen Smoke Alarm) (MQTT) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "event": "COSmokeSensor.Report", "time": 1702170979707, "msgid": "1702170979707", "data": { "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "metadata": { "inspect": false }, "battery": 3, "interval": 120, "version": "0202", "devTemperature": 21, "tz": 0, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "loraInfo": { "netId": "010205", "signal": -47, "gatewayId": "d88b4c160303664a", "gateways": 1 }, "stateChangedAt": { "gasAlarm": 1701958332245, "smokeAlarm": 1701958332245, "unexpected": 1702127796174 } }, "deviceId": "d88b4c0100061adc" }

threeonparfive commented 9 months ago

Here's another example:

[12/9/2023, 8:31:56 PM] [YoLink] YoLink device type: 'COSmokeSensor' is under development (YS7A02-UC (d88b4c0100061a08) Upstairs Smoke Alarm) (MQTT) Please report all bugs at https://github.com/dkerr64/homebridge-yolink/issues { "event": "COSmokeSensor.Report", "time": 1702171916893, "msgid": "1702171916892", "data": { "state": { "unexpected": false, "sLowBattery": false, "smokeAlarm": false, "gasAlarm": false, "highTempAlarm": false, "silence": false }, "metadata": { "inspect": false }, "battery": 4, "interval": 120, "version": "0202", "devTemperature": 19, "tz": 0, "sche": { "type": "disable", "day": 0, "time": "0:0" }, "loraInfo": { "netId": "010205", "signal": -34, "gatewayId": "d88b4c160303664a", "gateways": 1 }, "stateChangedAt": { "gasAlarm": 1701962206458, "smokeAlarm": 1701962206458, "unexpected": 1702128701737 } }, "deviceId": "d88b4c0100061a08" }

dkerr64 commented 9 months ago

Good, thanks. Can you also confirm that the smoke/CO detector is showing up in Apple Home?

threeonparfive commented 9 months ago

Yes, it does. It shows an icon for each type of detection (though mine happens to be smoke only) Screenshot 2023-12-09 at 9 04 09 PM

dkerr64 commented 9 months ago

You can hide the CO alarm with this in your config file (within the YoLink section). You can add this in either the settings user interface or directly into the config file...

"devices": [
                {
                    "deviceId": "d88b4c0100061a08",
                    "config": {
                        "hide": "co"
                    }
                },
               {
                    "deviceId": "d88b4c0100061adc",
                    "config": {
                        "hide": "co"
                    }
                }
            ]

Thanks for all your help. I'll publish a new release with this device support tomorrow.

dkerr64 commented 9 months ago

Released 1.5.0 with this device support added.