jvmahon / Homebridge-HomeSeer4

Homebridge Plugin for HomeSeer 3 and 4
29 stars 8 forks source link

Error adding fan #111

Closed teladog01 closed 4 years ago

teladog01 commented 4 years ago

I am trying to add a fan device and getting the error below. It is the fan device for my thermostat, which was added to Homebridge a long time ago and has worked fine. I am adding the fan, devRef 310, as a "simple" device.

Screen Shot 2020-09-03 at 5 19 36 PM
[9/3/2020, 5:14:41 PM] [HomeSeer] Added a battery to device#: 310
(node:27960) UnhandledPromiseRejectionWarning: SyntaxError: 
config.json error: property: batteryRef is not a valid property for item named: Hallway Thermostat Fan Mode of type: BinaryFan. 
Valid Properties for this type are: type,name,ref,uuid_base,interface_name,onValue,offValue.
    at Object.hasValidProperties (/usr/local/lib/node_modules/homebridge-homeseer4/lib/DeviceDefaults.js:637:11)
    at Object.checkConfig (/usr/local/lib/node_modules/homebridge-homeseer4/lib/HomeSeerUtilities.js:263:18)
    at HomeSeerPlatform.accessories (/usr/local/lib/node_modules/homebridge-homeseer4/index.js:160:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:27960) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:27960) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I guess the plugin is detecting that the fan is a child device of the Thermostat, and trying to add the associated battery device as well. But the battery device is already added with the Thermostat. Is there any way to make this work?

jvmahon commented 4 years ago

Maybe try adding it as a Complex device in the "Advanced Device" section.

For the Uuid Base, choose a random number that does NOT match any reference value of a homeseer device.

You (usually) only need to put in the Ref - in this case, as the device was previously added, it might be necessary to specify a new Uuid_Base which is why I am saying to do this.

image

teladog01 commented 4 years ago

I got the same error when adding it that way. The plugin is trying to add a battery device to it even though I explicitly left that field empty in the Complex device config.

[9/3/2020, 7:39:19 PM] [HomeSeer] Added a battery to device#: 310
(node:845) UnhandledPromiseRejectionWarning: SyntaxError: 
config.json error: property: batteryRef is not a valid property for item named: Thermostat Fan of type: BinaryFan. 
Valid Properties for this type are: type,name,ref,uuid_base,interface_name,onValue,offValue.
    at Object.hasValidProperties (/usr/local/lib/node_modules/homebridge-homeseer4/lib/DeviceDefaults.js:637:11)
    at Object.checkConfig (/usr/local/lib/node_modules/homebridge-homeseer4/lib/HomeSeerUtilities.js:263:18)
    at HomeSeerPlatform.accessories (/usr/local/lib/node_modules/homebridge-homeseer4/index.js:160:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:845) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:845) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Screen Shot 2020-09-03 at 7 40 22 PM
jvmahon commented 4 years ago

I'll take another look when I get the chance. The config-ui-x interface is pretty "experimental" right now.

jvmahon commented 4 years ago

Upgrade to 1.0.7 and try again. Please close out the comment if it works (or let me know if it doesn't).

teladog01 commented 4 years ago

Looks like this one is fixed. No more error, although it did still add add a battery device to the fan. I guess it is querying HomeSeer and for other associated child devices and seeing the battery device with the same parent?

jvmahon commented 4 years ago

Correct. If there is a battery device on the parent, it gets added for the child device.
I'll close this out.