Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName. #12

Open
castleyt opened this issue Aug 27, 2024 · 12 comments

Comments

@castleyt
Copy link

Describe The Issue:
Plugin starts however get the following error

[27/08/2024, 10:19:40] [Tessie] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
at new Accessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
at new PlatformAccessory (/usr/lib/node_modules/homebridge/src/platformAccessory.ts:72:9)
at file:///usr/lib/node_modules/homebridge-tessie/src/platform.ts:134:33
at Array.forEach ()
at file:///usr/lib/node_modules/homebridge-tessie/src/platform.ts:109:30
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: undefined,
expected: true,
operator: '=='

To Reproduce:
Every time I start

Expected behavior:
Should load without issue.

Have two Teslas on the account

Logs:

{
"name": "Tessie",
"accessToken": "correct token applied",
"prefixName": false,
"_bridge": {
"username": "######",
"port": 47070
},
"platform": "Tessie"
}

Screenshots:

Environment:

  • Plugin Version:

All latest versions

@Bre77
Copy link
Contributor

Bre77 commented Aug 27, 2024

I suspect if you set prefixName to be true (which you would want to do with two vehicles) it might fix this, but I'll figure out why the issue occurred in the first place.

@castleyt
Copy link
Author

I had prefixName set to true before, same error...

[Tessie] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
at new Accessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
at new PlatformAccessory (/usr/lib/node_modules/homebridge/src/platformAccessory.ts:72:9)
at file:///usr/lib/node_modules/homebridge-tessie/src/platform.ts:134:33
at Array.forEach ()
at file:///usr/lib/node_modules/homebridge-tessie/src/platform.ts:109:30
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: undefined,
expected: true,
operator: '=='
}

JSON

{
"name": "Tessie",
"accessToken": "#####",
"prefixName": true,
"_bridge": {
"username": "#####",
"port": 47070
},
"platform": "Tessie"
}

@ggulik
Copy link

ggulik commented Aug 29, 2024

I get the same error. I've tried it with prefixName set to true and false, same error either way

[MyTesla@Vent Windows@Configured Name] Characteristic not in required or optional characteristic section for service Window. Adding anyway.
[MyTesla@Awake@Configured Name] Characteristic not in required or optional characteristic section for service Switch. Adding anyway.
[MyTesla@Homelink@Configured Name] Characteristic not in required or optional characteristic section for service GarageDoorOpener. Adding anyway.
[8/29/2024, 8:21:42 AM] [MyTesla] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
    at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
    at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:72:9)
    at file:///usr/local/lib/node_modules/homebridge-tessie/src/platform.ts:111:33
    at Array.forEach (<anonymous>)
    at file:///usr/local/lib/node_modules/homebridge-tessie/src/platform.ts:96:30
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

@thatsnasty
Copy link

thatsnasty commented Sep 3, 2024

Yep same error for me.

AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
    at new Accessory (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
    at new PlatformAccessory (/homebridge/node_modules/homebridge/src/platformAccessory.ts:72:9)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:91:33
    at Array.forEach (<anonymous>)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:68:26
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

@Bre77
Copy link
Contributor

Bre77 commented Sep 3, 2024

Ok I believe this happens if you haven't named your vehicle or energy site, 0.4.2 adds default values for both. Please let me know if this release fixes the issue or not.

@thatsnasty
Copy link

Same issue unfortunately.

AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
    at new Accessory (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
    at new PlatformAccessory (/homebridge/node_modules/homebridge/src/platformAccessory.ts:72:9)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:91:33
    at Array.forEach (<anonymous>)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:68:26
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
{
    "name": "Tesla",
    "accessToken": "redacted",
    "prefixName": true,
    "platform": "Tessie"
}

@Bre77
Copy link
Contributor

Bre77 commented Sep 3, 2024

Ok thanks for the updated error log, I moved the fix to cover both places displayName is used. Please try 0.4.3 and let me know again.

@ggulik
Copy link

ggulik commented Sep 3, 2024

That solved the problem for me, thank you!

@thatsnasty
Copy link

thatsnasty commented Sep 3, 2024

Still not working for me on 0.4.3

AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
    at new Accessory (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
    at new PlatformAccessory (/homebridge/node_modules/homebridge/src/platformAccessory.ts:72:9)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:92:33
    at Array.forEach (<anonymous>)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:68:26
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    {
    "name": "Tessie",
    "accessToken": "redacted",
    "prefixName": true,
    "platform": "Tessie"
}

@Bre77
Copy link
Contributor

Bre77 commented Sep 4, 2024

I'm going to push another release to fix it yet another way, but if you could turn on debug logging the log immediately before the error will tell me what your displayName is trying to be set to, which will help identify why this keeps failing.

@thatsnasty
Copy link

0.4.3

[9/4/2024, 1:55:44 PM] Got SIGTERM, shutting down Homebridge...
[9/4/2024, 1:55:55 PM] [Tessie] Initializing Tessie platform...
[9/4/2024, 1:55:55 PM] [Tessie] Finished initializing platform: Redacted
[9/4/2024, 1:55:55 PM] [Tessie] Executed didFinishLaunching callback
[9/4/2024, 1:55:55 PM] Publishing bridge accessory (name: Homebridge D64B, publishInfo: {
  username: '0E:62:63:CE:D6:4B',
  port: 51728,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'bonjour-hap'
}).
Setup Payload:
X-HM://00243X2Y2DETU
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 386-08-938 │     
    └────────────┘     
                       
[9/4/2024, 1:55:55 PM] Homebridge v1.8.4 (HAP v0.12.2) (Homebridge D64B) is running on port 51728.
[9/4/2024, 1:55:55 PM] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[9/4/2024, 1:55:56 PM] [Tessie] Adding new accessory: 
[9/4/2024, 1:55:56 PM] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
    at new Accessory (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:495:11)
    at new PlatformAccessory (/homebridge/node_modules/homebridge/src/platformAccessory.ts:72:9)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:92:33
    at Array.forEach (<anonymous>)
    at file:///homebridge/node_modules/homebridge-tessie/src/platform.ts:68:26
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[9/4/2024, 1:55:56 PM] Got SIGTERM, shutting down Homebridge...

0.4.4 appears to be working fine

[9/4/2024, 1:56:33 PM] [Tessie] Initializing Tessie platform...
[9/4/2024, 1:56:33 PM] [Tessie] Finished initializing platform: redacted
[9/4/2024, 1:56:33 PM] [Tessie] Executed didFinishLaunching callback
[9/4/2024, 1:56:33 PM] Publishing bridge accessory (name: Homebridge D64B, publishInfo: {
  username: '0E:62:63:CE:D6:4B',
  port: 51728,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'bonjour-hap'
}).
Setup Payload:
X-HM://00243X2Y2DETU
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 386-08-938 │     
    └────────────┘     
                       
[9/4/2024, 1:56:34 PM] Homebridge v1.8.4 (HAP v0.12.2) (Homebridge D64B) is running on port 51728.
[9/4/2024, 1:56:34 PM] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[9/4/2024, 1:56:36 PM] [Tessie] Adding new accessory: Tesla
[Tesla@Battery@Configured Name] Characteristic not in required or optional characteristic section for service Battery. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Battery
[Tesla@Climate@Configured Name] Characteristic not in required or optional characteristic section for service Thermostat. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Climate
[Tesla@Charge Current@Configured Name] Characteristic not in required or optional characteristic section for service Lightbulb. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Charge Current
[Tesla@Charge Limit@Configured Name] Characteristic not in required or optional characteristic section for service Lightbulb. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Charge Limit
[Tesla@Charge Port@Configured Name] Characteristic not in required or optional characteristic section for service LockMechanism. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Charge Port
[Tesla@Charge@Configured Name] Characteristic not in required or optional characteristic section for service Switch. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Charge
[Tesla@Defrost@Configured Name] Characteristic not in required or optional characteristic section for service Switch. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Defrost
[Tesla@Frunk@Configured Name] Characteristic not in required or optional characteristic section for service Door. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Frunk
[Tesla@Trunk@Configured Name] Characteristic not in required or optional characteristic section for service Door. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Trunk
[Tesla@Lock@Configured Name] Characteristic not in required or optional characteristic section for service LockMechanism. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Lock
[Tesla@Sentry@Configured Name] Characteristic not in required or optional characteristic section for service SecuritySystem. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Sentry
[Tesla@Vent Windows@Configured Name] Characteristic not in required or optional characteristic section for service Window. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Vent Windows
[Tesla@Awake@Configured Name] Characteristic not in required or optional characteristic section for service Switch. Adding anyway.
[9/4/2024, 1:56:36 PM] [Tessie] Configured name changing to Tesla Awake

@castleyt
Copy link
Author

castleyt commented Sep 4, 2024

working for me... thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants