kbrashears5 / typescript-homebridge-schedule

Scheduled, repeatable triggers for Homebridge automation with HomeKit
https://github.com/kbrashears5/typescript-homebridge-schedule#readme
MIT License
56 stars 11 forks source link

ERROR LOADING PLUGIN homebridge-schedule: Unexpected token #156

Closed KarstenS123 closed 2 years ago

KarstenS123 commented 2 years ago

Hello,

I've freshly installed the plugin, the missing depency and configured a accessorie in my homebridge config as follows:

     {
       "accessory": "Schedule",
       "name": "Rollercheck",
       "interval": 5
     }

When homebridge get started, the plugin loader throw an error:

Apr 10 16:38:05 Server systemd[1]: Started Node.js HomeKit Server.
Apr 10 16:38:05 Server homebridge[2122]: [2022-4-10 16:38:05] Loaded config.json with 0 accessories and 2 platforms.
Apr 10 16:38:05 Server homebridge[2122]: [2022-4-10 16:38:05] Loaded 0 cached accessories from cachedAccessories.
Apr 10 16:38:05 Server homebridge[2122]: [2022-4-10 16:38:05] ---
Apr 10 16:38:06 Server homebridge[2122]: [2022-4-10 16:38:06] Loaded plugin: homebridge-fhem@0.5.32
Apr 10 16:38:06 Server homebridge[2122]: homebridge API version: 2.7
Apr 10 16:38:06 Server homebridge[2122]: this is homebridge-fhem 0.5.32
Apr 10 16:38:06 Server homebridge[2122]: [2022-4-10 16:38:06] Registering platform 'homebridge-fhem.FHEM'
Apr 10 16:38:06 Server homebridge[2122]: [2022-4-10 16:38:06] ---
Apr 10 16:38:06 Server homebridge[2122]: [2022-4-10 16:38:06] Loaded plugin: homebridge-fritz@0.9.5
Apr 10 16:38:07 Server homebridge[2122]: [2022-4-10 16:38:07] Registering platform 'homebridge-fritz.FRITZ!Box'
Apr 10 16:38:07 Server homebridge[2122]: [2022-4-10 16:38:07] ---
Apr 10 16:38:07 Server homebridge[2122]: [2022-4-10 16:38:07] ====================
Apr 10 16:38:07 Server homebridge[2122]: [2022-4-10 16:38:07] ERROR LOADING PLUGIN homebridge-schedule:
Apr 10 16:38:07 Server homebridge[2122]: [2022-4-10 16:38:07] /usr/lib/node_modules/homebridge-schedule/dist/schedule-accessory.js:6
Apr 10 16:38:07 Server homebridge[2122]:     log;
Apr 10 16:38:07 Server homebridge[2122]:        ^
Apr 10 16:38:07 Server homebridge[2122]: SyntaxError: Unexpected token ;
Apr 10 16:38:07 Server homebridge[2122]:     at Module._compile (internal/modules/cjs/loader.js:760:23)
Apr 10 16:38:07 Server homebridge[2122]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
Apr 10 16:38:07 Server homebridge[2122]:     at Module.load (internal/modules/cjs/loader.js:685:32)
Apr 10 16:38:07 Server homebridge[2122]:     at Function.Module._load (internal/modules/cjs/loader.js:620:12)
Apr 10 16:38:07 Server homebridge[2122]:     at Module.require (internal/modules/cjs/loader.js:723:19)
Apr 10 16:38:07 Server homebridge[2122]:     at require (internal/modules/cjs/helpers.js:14:16)
Apr 10 16:38:07 Server homebridge[2122]:     at Plugin.load (/usr/lib/node_modules/homebridge/src/plugin.ts:192:73)
Apr 10 16:38:07 Server homebridge[2122]:     at PluginManager.initializeInstalledPlugins (/usr/lib/node_modules/homebridge/src/pluginManager.ts:131:22)
Apr 10 16:38:07 Server homebridge[2122]: [2022-4-10 16:38:07] ====================

Any hint?

ghost commented 2 years ago

AUTOMATICALLY GENERATED by kbrashears5/github-action-issue-notifier

Mentioning @kbrashears5 to notify them. This will be looked at soon!

kbrashears5 commented 2 years ago

do you have a rogue ; in your JSON somewhere? based on the stack trace it looks like internals to homebridge.

or more in general it maybe sounds like your config.json isn't formatted properly

KarstenS123 commented 2 years ago

JSON Checker said all is ok. If not, homebridge wouldn't start at all and exit earlier in the boot up process.

Homebridge UI is also not showing errors.

Homebridge itself is working. Just this plugin won't load because of this error.

[2022-4-12 08:53:35] [HB Supervisor] Restarting Homebridge...
[2022-4-12 08:53:35] [HB Supervisor] Starting Homebridge with extra flags: -I
[2022-4-12 08:53:35] [HB Supervisor] Started Homebridge v1.4.0 with PID: 1417
[2022-4-12 08:53:36] Loaded config.json with 1 accessories and 3 platforms.
[2022-4-12 08:53:36] Loaded 0 cached accessories from cachedAccessories.
[2022-4-12 08:53:36] ---
[2022-4-12 08:53:36] Loaded plugin: homebridge-config-ui-x@4.42.0
[2022-4-12 08:53:36] Registering platform 'homebridge-config-ui-x.config'
[2022-4-12 08:53:36] ---
[2022-4-12 08:53:36] Loaded plugin: homebridge-fhem@0.5.33
homebridge API version: 2.7
this is homebridge-fhem 0.5.33
[2022-4-12 08:53:37] Registering platform 'homebridge-fhem.FHEM'
[2022-4-12 08:53:37] ---
[2022-4-12 08:53:37] Loaded plugin: homebridge-fritz@0.9.5
[2022-4-12 08:53:37] Registering platform 'homebridge-fritz.FRITZ!Box'
[2022-4-12 08:53:37] ---
[2022-4-12 08:53:37] ====================
[2022-4-12 08:53:37] ERROR LOADING PLUGIN homebridge-schedule:
[2022-4-12 08:53:37] /usr/lib/node_modules/homebridge-schedule/dist/schedule-accessory.js:6
    log;
       ^

SyntaxError: Unexpected token ;
    at Module._compile (internal/modules/cjs/loader.js:760:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Plugin.load (/usr/lib/node_modules/homebridge/src/plugin.ts:197:93)
    at PluginManager.initializeInstalledPlugins (/usr/lib/node_modules/homebridge/src/pluginManager.ts:131:22)
[2022-4-12 08:53:37] ====================
[2022-4-12 08:53:37] Loading 3 platforms...
[2022-4-12 08:53:37] [FHEM] Initializing FHEM platform...
starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1649746417519
[2022-4-12 08:53:37] [FritzBox] Initializing FRITZ!Box platform...
[2022-4-12 08:53:37] [FritzBox] Deprecated `hide` setting is ignored. Use `devices` instead
[2022-4-12 08:53:37] [Config] Initializing config platform...
[2022-4-12 08:53:37] [Config] Running in Service Mode
[2022-4-12 08:53:37] Loading 1 accessories...
[2022-4-12 08:53:37] No plugin was found for the accessory "Schedule" in your config.json. Please make sure the corresponding plugin is installed correctly.
Server listening on: http://<ip>:8282
[2022-4-12 08:53:37] [FHEM] Checking devices and attributes...
[2022-4-12 08:53:37] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&fwcsrf=csrf_667777955684671&XHR=1
[2022-4-12 08:53:37] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE=siri&fwcsrf=csrf_667777955684671&XHR=1
[2022-4-12 08:53:37] [FHEM] no siri device found. please define it.
[2022-4-12 08:53:37] [FritzBox] FRITZ!Box platform login successful
[2022-4-12 08:53:37] [FritzBox] Discovering accessories
[2022-4-12 08:53:37] [FritzBox] Using tr64 api for guest Wifi
[2022-4-12 08:53:38] [FHEM] Fetching FHEM devices...
[2022-4-12 08:53:38] [FHEM] fetching: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20room%3DHomekit&fwcsrf=csrf_667777955684671&XHR=1
[2022-4-12 08:53:38] [FHEM] got: 0 results
[2022-4-12 08:53:38] [FritzBox] Updating guest WLAN
[2022-4-12 08:53:41] [FritzBox] Updating alarm sensor 119340124481-1
[2022-4-12 08:53:41] [FritzBox] Updating alarm sensor 113240299255-1
[2022-4-12 08:53:41] [FritzBox] Updating alarm sensor 119340163553-1
[2022-4-12 08:53:41] [FritzBox] Alarm sensors found: 119340124481-1,113240299255-1,119340163553-1
[2022-4-12 08:53:41] [FritzBox] Buttons found: none
[2022-4-12 08:53:41] [FritzBox] Outlets found: none
[2022-4-12 08:53:41] [FritzBox] Thermostats found: 099950143245,099950097788,099950135109,099950138505,099950142493
[2022-4-12 08:53:41] [FritzBox] Updating thermostat 099950143245
[2022-4-12 08:53:41] [FritzBox] Updating thermostat 099950097788
[2022-4-12 08:53:41] [FritzBox] Updating thermostat 099950135109
[2022-4-12 08:53:41] [FritzBox] Updating thermostat 099950138505
[2022-4-12 08:53:41] [FritzBox] Updating thermostat 099950142493
[2022-4-12 08:53:41] [FritzBox] Sensors found: none
[2022-4-12 08:53:41] Initializing platform accessory 'Guest WLAN'...
[2022-4-12 08:53:41] Initializing platform accessory 'Fenster Kinderzimmer'...
[2022-4-12 08:53:41] Initializing platform accessory 'Fenster Bad'...
[2022-4-12 08:53:41] Initializing platform accessory 'Küchenfenster'...
[2022-4-12 08:53:41] Initializing platform accessory 'Wohnzimmer'...
[2022-4-12 08:53:41] Initializing platform accessory 'Schlafzimmer'...
[2022-4-12 08:53:41] Initializing platform accessory 'Kinderzimmer'...
[2022-4-12 08:53:41] Initializing platform accessory 'Küche'...
[2022-4-12 08:53:41] Initializing platform accessory 'Bad'...
Setup Payload:
X-HM://XXXXXXXXXX
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ XXX-XXX-XXX │     
    └────────────┘     

[2022-4-12 08:53:41] Homebridge v1.4.0 (HAP v0.10.0) (Homebridge) is running on port 51826.
[2022-4-12 08:53:42] [FritzBox] Getting guest WLAN state
[2022-4-12 08:53:42] [FritzBox] Getting alarm sensor 119340124481-1 alarm state
[2022-4-12 08:53:42] [FritzBox] Getting alarm sensor 113240299255-1 alarm state
[2022-4-12 08:53:42] [FritzBox] Getting alarm sensor 119340163553-1 alarm state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950143245 current heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950143245 target heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950143245 temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950143245 target temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950143245 battery status
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950143245 battery level
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950097788 current heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950097788 target heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950097788 temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950097788 target temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950097788 battery status
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950097788 battery level
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950135109 current heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950135109 target heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950135109 temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950135109 target temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950135109 battery status
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950135109 battery level
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950138505 current heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950138505 target heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950138505 temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950138505 target temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950138505 battery status
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950138505 battery level
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950142493 current heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950142493 target heating state
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950142493 temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950142493 target temperature
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950142493 battery status
[2022-4-12 08:53:42] [FritzBox] Getting thermostat 099950142493 battery level

The target for the error is line 6 of schedule-accessory.js

Thats where the variable "log" gets declared.

kbrashears5 commented 2 years ago

is this still an issue? sorry have been able to look for a while

KarstenS123 commented 2 years ago

Can't tell you anymore, as I switched over to another plugin.