adizanni/floor3d-card

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

bugensui2022 opened this issue · 4 comments

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:

  • entity: binary_sensor.sxpad_is_charging
  • entity: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening
    type3d: door
    door:
    doortype: swing
    side: right
    direction: inner
    degrees: '60'
    hinge: null
    object_id: sweethome3d_opening_on_hinge_1_door_382
    action: more-info
    zoom_areas:
  • zoom: ''
    lock_camera: 'no'
    selectionMode: 'no'
    editModeNotifications: 'yes'
    header: 'yes'
    click: 'no'
    overlay: 'no'
    hideLevelsMenu: 'no'
    shadow: 'no'
    extralightmode: 'no'
    show_axes: 'no'
    sky: 'no'
    globalLightPower: '0.8'
    backgroundColor: transparent
    `

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: <binary_sensor.lumi_lumi_sensor_magnet_aq2_opening> 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)

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

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

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

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