Closed isaac-the-newt closed 2 years ago
6 Dec 13:58:05 - [error] ReferenceError: sensor is not defined at EventEmitter. (/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:161:38) at EventEmitter.emit (node:events:390:28) at HueBridge.emitUpdates (/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:216:18) at /config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:41:11 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)
From your error log, you want the https://github.com/Foddy/node-red-contrib-huemagic repo
Hi Jason,
Thanks for the redirect.
I’ve added this to an existing issue https://github.com/Foddy/node-red-contrib-huemagic/issues/246 which appears to have identical symptoms and log entries.
regards,
Greg Belcher
From: Jason @.> Sent: Monday, 6 December 2021 15:09 To: zachowj/hass-node-red @.> Cc: isaac-the-newt @.>; Author @.> Subject: Re: [zachowj/hass-node-red] Philips Hue tap switch nodes generate uncaught exceptions in Node-RED (Issue #89)
6 Dec 13:58:05 - [error] ReferenceError: sensor is not defined at EventEmitter. (/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:161:38) at EventEmitter.emit (node:events:390:28) at HueBridge.emitUpdates (/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:216:18) at /config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:41:11 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)
From your error log, you want the https://github.com/Foddy/node-red-contrib-huemagic repo
— You are receiving this because you authored the thread. Reply to this email directly, https://github.com/zachowj/hass-node-red/issues/89#issuecomment-986419624 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AWY7QE5SU27UOU2XB7M22NTUPQZPHANCNFSM5JNS6JWA unsubscribe. Triage notifications on the go with GitHub Mobile for https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 iOS or https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub Android. https://github.com/notifications/beacon/AWY7QE5VWBOAPTFIIQZLIBTUPQZPHA5CNFSM5JNS6JWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLFZDKA.gif
The problem
I have two HUE tap switches and a HUE smart button switch as input nodes. These are not configured with the HUE application (on IOS and that executes in the HUE Bridge) and are used only in Node-RED. They stopped working a few days ago. The Node-RED log file shows that activation of any switch on either of the two tap switches generates an uncaught exception error ... 6 Dec 13:22:28 - [red] Uncaught Exception: 6 Dec 13:22:28 - [error] ReferenceError: sensor is not defined and Node-RED restarts. The smart button works fine. I've reset the HUE Bridge API key and rejoined it into Node-RED with no joy. I've also deleted and then rejoined the tap switches from the HUE system with no joy. I've also deleted all tap switch nodes from all flows (leaving just the smart button, the bridge and the light nodes) and the error still occurs.
HUE version (reported from IOS app) 3.48.0 (11197) The HUE bridge was last updated 1 Nov 2021 to SW version 194808600 All other HUE items (lights, dimmer switches, etc) are at the current firmware release. The Node-RED version is 10.2.0 The balance of Node-RED flows are working fine. Home Assistant is a core with supervisor VM instance running inside unRAID application and file server. This configuration has been stable for more than 12 months.
What version of Home Assistant Core has the issue?
core-2021.11.5
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Philips Hue with Node-RED
Anything in the logs that might be useful for us?
Node-RED log 6 Dec 13:58:05 - [red] Uncaught Exception: 6 Dec 13:58:05 - [error] ReferenceError: sensor is not defined at EventEmitter. (/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:161:38)
at EventEmitter.emit (node:events:390:28)
at HueBridge.emitUpdates (/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:216:18)
at /config/node-red/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:41:11
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[13:58:06] INFO: Starting Node-RED...
System Health
Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 6.6 -- | -- update_channel | stable supervisor_version | supervisor-2021.10.8 docker_version | 20.10.8 disk_total | 30.8 GB disk_used | 8.7 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Samba share (9.5.1), Studio Code Server (3.7.0), TasmoAdmin (0.16.0), MariaDB (2.4.0), Node-RED (10.2.0), Spotify Connect (0.10.0), Terminal & SSH (9.2.1), Mosquitto broker (6.0.1), AirCast (3.2.0), File editor (5.3.3), Check Home Assistant configuration (3.9.0), Home Assistant Google Drive Backup (0.105.2), chrony (2.2.1)Lovelace
dashboards | 1 -- | -- resources | 0 views | 6 mode | storageI have mashed up some images to further clarify what I am observing as attached;
Home Assistant.jpg: shows the supervisor and configuration tabs with add-ons and integrations that currently comprise my system.
Node-RED.jpg: shows the HUE nodes that I use in my flows and two examples of the Smart Button device successfully providing input events into the flow (“short released” and “held”) while the Tap Switch devices remain in the “waiting …” state because Node-RED has reset and the events presumably never reach the UI to be updated. After a few seconds, the Smart Button event text returns to the “waiting …” state too.
OS App.jpg: is four screen captures taken from my iPad using the HUE App stitched together to show the successful operation of the tap switches. The first column shows the Office Standing Desk Button 4 is being registered, the second column a few seconds later when the timestamp for that event replaces the green event text. The third and forth columns show the same event recording process for the Downstairs Lights Override tap switch, this time for Button 1.
Notice that the two tap switches and the smart button are “not configured” in the IOS App. This means that the HUE application itself (running in the HUE Bridge device) does not do anything when these button events occur. They are just events that are broadcast to interested parties but the HUE itself takes no action. I have no automations running in any platform other than Node-RED within Home Assistant (not in Apple Home kit either).