adizanni / floor3d-card

Your Home Digital Twin: aka floor3d-card. Visualize Home Assistant state and perform actions using objects in a 3D home model based on Three.js.
https://github.com/adizanni/floor3d-card
MIT License
448 stars 65 forks source link

Need help: I need to use a door magnetic sensor to provide feedback on the door switch in the 3D layout #162

Closed bugensui2022 closed 11 months ago

bugensui2022 commented 1 year ago

The code is as follows. I have used Sweet Home 3D software to draw the house type diagram and exported it in OBJ format. The room door is closed by default, and the 3D house type diagram can be displayed correctly on the front end of HA. I have added the entity of the door magnetic sensor to display the opening and closing of the door, but an error is reported. I don't know where the problem is, please request help!

`type: custom:floor3d-card path: /local/floor3d-card name: Home objfile: 985.obj mtlfile: 985.mtl entities:

TypeError: Cannot read properties of undefined (reading 'objects') at floor3d-card.js:2356:6622 at Array.forEach () at bf._add3dObjects (floor3d-card.js:2356:4982) at bf._onLoaded3DModel (floor3d-card.js:2288:35635) at Object.onLoad (floor3d-card.js:2231:531770) at XMLHttpRequest. (floor3d-card.js:2231:435962) floor3d-card.js:2356 Error: Object issue for Entity: TypeError: Cannot read properties of undefined (reading 'objects') at floor3d-card.js:2356:11044 at Array.forEach () at bf._add3dObjects (floor3d-card.js:2356:4982) at bf._onLoaded3DModel (floor3d-card.js:2288:35635) at Object.onLoad (floor3d-card.js:2231:531770) at XMLHttpRequest. (floor3d-card.js:2231:435962)

adizanni commented 1 year ago

Hello @bugensui2022, you need to provide a hinge or a panel object. The object-id represent the group of elements of the door that are moving when you open and close the door. The hinge represent the object-id of the door hinge which is also the axis on which the door is swinging. The panel object is used when you do not have the hinge to repesent the main element of the door. There are some examples in the card guide even if I recognize it is not always trivial to use

bugensui2022 commented 1 year ago

Hello @bugensui2022, you need to provide a hinge or a panel object. The object-id represent the group of elements of the door that are moving when you open and close the door. The hinge represent the object-id of the door hinge which is also the axis on which the door is swinging. The panel object is used when you do not have the hinge to repesent the main element of the door. There are some examples in the card guide even if I recognize it is not always trivial to use

Thank you for your help

adizanni commented 1 year ago

If you were able to fix, can I please ask you to close the issue ?

bugensui2022 commented 1 year ago

If you were able to fix, can I please ask you to close the issue ? OK