dhayab / homebridge-withings-air-quality Goto Github PK
View Code? Open in Web Editor NEWHomebridge plugin that exposes air quality data from the Withings WS-50 Smart Body Analyzer
License: MIT License
Homebridge plugin that exposes air quality data from the Withings WS-50 Smart Body Analyzer
License: MIT License
Hello till last version all was ok, with the update to 1.3.4 now I get this problem.
Any idea?
many thanks
[6/5/2021, 00:32:36] [homebridge-withings-air-quality] This plugin generated a warning from the characteristic 'Battery Level': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.
(node:21526) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
at r.getTemperature (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:4:2582)
at i.updateTemperature (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:5207)
at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:3615
at i. (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4575)
at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529
at Object.next (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634)
at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:547
at new Promise ()
at t (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:295)
at CurrentTemperature. (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4505)
(node:21526) 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: 3)
(node:21526) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
at r.getCarbonDioxide (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:4:2513)
at i.updateAirQuality (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4891)
at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:3409
at i. (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4575)
at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529
at Object.next (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634)
at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:547
at new Promise ()
at t (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:295)
at AirQuality. (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4505)
(node:21526) 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: 4)
Plugin was suddenly failing bringing down a lot of other plugins.
Logs indicate an unhandled exception.
I went to the Withings portal and could not log in with my regular password.
I reset my password and reconfigured the plugin.
Plugin was working again.
Is it possible to improve the exception handling to clearly indicate the authentication failure?
TIA
I think this started happening after the last UI upgrade:
[12/13/2021, 8:31:46 PM] [homebridge-withings-air-quality] This plugin generated a warning from the characteristic 'Battery Level': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.
[12/13/2021, 8:31:46 PM] TypeError: Cannot read properties of undefined (reading 'value')
at r.getTemperature (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:4:2581)
at i.updateTemperature (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:5207)
at /usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:3615
at i.<anonymous> (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4575)
at /usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529
at Object.next (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634)
at /usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:547
at new Promise (<anonymous>)
at t (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:295)
at CurrentTemperature.<anonymous> (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4505)
[12/13/2021, 8:31:46 PM] TypeError: Cannot read properties of undefined (reading 'value')
at r.getCarbonDioxide (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:4:2512)
at i.updateAirQuality (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4891)
at /usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:3409
at i.<anonymous> (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4575)
at /usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529
at Object.next (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634)
at /usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:547
at new Promise (<anonymous>)
at t (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:295)
at AirQuality.<anonymous> (/usr/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4505)
[12/13/2021, 8:31:47 PM] Got SIGTERM, shutting down Homebridge...
I'm running the following:
Probably one can use Withings Data API instead of direct usage of login/pass: https://developer.withings.com/oauth2/#section/Data-API
For example, register your own app and provide only a token for your plugin. What do you think?
Was working ok and now..
(node:1556) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
at r.getTemperature (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:4:2582)
at i.updateTemperature (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:5207)
at /homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:3615
at i. (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:4575)
at /homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529
at Object.next (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634)
at /homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:547
at new Promise ()
at t (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:295)
at CurrentTemperature. (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:4505)
(Use node --trace-warnings ...
to show where the warning was created)
(node:1556) 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:1556) [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.
(node:1556) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
at r.getCarbonDioxide (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:4:2513)
at i.updateAirQuality (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:4891)
at /homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:3409
at i. (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:4575)
at /homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529
at Object.next (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634)
at /homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:547
at new Promise ()
at t (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:295)
at AirQuality. (/homebridge/node_modules/homebridge-withings-air-quality/dist/index.js:6:4505)
@dhayab , thanks for making this plugin. Had give up hope that somebody would make the effort.
After using the plugin for a couple of weeks, it seems that the temperature value is not updated.
I checked on the Withings portal and they are correct there.
Can you advise me how to debug your plugin to assert that my assumptions are correct?
Any solution about how to use this if we made our account in the Health Mate app using the Sign In with Apple method? There's a dummy e-mail address that Apple sends it, but there's no password.
It started not responding in homekit some days ago.
I removed it, reinstalled, bridged and unbridged on homebridge no way to show it again on homekit... No errors on log!
It seems API has been changed withings side, maybe is it the problem?
Hello,
First thanks for your work.
I've this in the homebridge logs :
[homebridge-withings-air-quality] This plugin slows down Homebridge. The read handler for the characteristic 'Carbon Dioxide Level' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
and:
[homebridge-withings-air-quality] This plugin generated a warning from the characteristic 'Carbon Dioxide Level': Characteristic not in required or optional characteristic section for service AirQualitySensor. Adding anyway.. See https://git.io/JtMGR for more info.
(node:60969) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: iid cannot be undefined for characteristic 'Carbon Dioxide Level'
at CarbonDioxideLevel.Characteristic.internalHAPRepresentation (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2156:11)
at CarbonDioxideLevel. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2130:25)
at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16)
at CarbonDioxideLevel.Characteristic.toHAP (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:1293:38)
at _loop_1 (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:617:24)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Service.js:454:21
(node:60969) 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: 2)
(node:60969) [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.
Can you something ?
Thanks, bye.
Tom
Getting the following error in the Homebridge logs. Any ideas how to fix this?
Could not fetch data from API / Invalid Session: sessionid missing
The plug-in will not be enhanced โฆ sadly
Working OK for a while and now for some days this issue.
(node:7823) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined at r.getTemperature (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:4:2582) at i.updateTemperature (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:5039) at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:3596 at i.<anonymous> (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4407) at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529 at Object.next (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634) at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:547 at new Promise (<anonymous>) at t (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:295) at Characteristic.CurrentTemperature.<anonymous> (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4337) at Characteristic.CurrentTemperature.emit (events.js:321:20) at Characteristic.CurrentTemperature.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:164:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:771:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:735:8) at HAPServer.emit (events.js:321:20) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:928:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:321:20) at endReadableNT (_stream_readable.js:1204:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) (node:7823) 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: 3) (node:7823) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined at r.getCarbonDioxide (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:4:2513) at i.updateAirQuality (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4723) at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:3390 at i.<anonymous> (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4407) at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1529 at Object.next (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:1634) at /usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:547 at new Promise (<anonymous>) at t (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:295) at Characteristic.AirQuality.<anonymous> (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4337) at Characteristic.AirQuality.emit (events.js:321:20) at Characteristic.AirQuality.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:164:10) at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:771:20) at Array.forEach (<anonymous>) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:735:8) at HAPServer.emit (events.js:321:20) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:928:10) at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:321:20) at endReadableNT (_stream_readable.js:1204:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) (node:7823) 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: 4)
I get this warning when starting up:
HAP Warning: Characteristic 00000093-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008D-0000-1000-8000-0026BB765291. Adding anyway.
which I think is essentially saying the CO2 level isn't set up as a characteristic of the Air Quality service.
I'm new at this, and not sure how to test this w/ your index.ts, but I think adding CarbonDioxideLevel
to airQualityService.setCharacteristic
might fix it, based on another plugin I was playing with?
this.airQualityService.setCharacteristic(Characteristic.Name, 'Air Quality');
this.initServiceEvents(
'carbondioxide',
this.airQualityService.getCharacteristic(Characteristic.AirQuality),
this.airQualityService.getCharacteristic(Characteristic.CarbonDioxideLevel),
() => this.updateAirQuality(),
);
And perhaps the same for StatusLowBattery
?
Hi,
First of all thanks for trying to bring withing scale sensors to Homebridge. Nevertheless, their seem to be an issue, upon installation and after configuration, homebridge will loop on restart displaying the following error.
TypeError: Cannot read property 'replace' of undefined at i.get [as formattedMacAddress] (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:4217) at new i (/usr/local/lib/node_modules/homebridge-withings-air-quality/dist/index.js:6:2560) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:308:29) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47
Just installed this and configured with username/pass of my withings dashboard, verified it is correct by logging in myself. The mac address is copy-pasted from the UI so it's fine to.
But I am getting this error on startup:
Could not fetch data from API / Cannot read property 'value' of undefined
I am guessing it is one of these:
Any chance you can advise on what to do? Or any possibility to enable some kind of debug mode which prints the calls?
Hello.
The log shows this error.
Withings Air Quality] Could not fetch data from API / Cannot read property 'date' of undefined.
How can we make the data update frequency more frequent? Now the update frequency can be up to 24 hours. The data you display is not current.
Thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.