『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1693|回复: 11

[技术探讨] 有没有人玩floor3d-card的怎么体现入户门的开关

[复制链接]

110

主题

1621

帖子

5110

积分

元老级技术达人

积分
5110
金钱
3484
HASS币
30
发表于 2023-7-11 12:32:04 | 显示全部楼层 |阅读模式
官方文档的案例并不具体,已经通过Sweet Home 3D软件,画好了全部房间的3d效果图,也导出了obj格式,在ha里,能查看效果的,就是想问下,入户门加了门窗传感器,怎么通过这个传感器在3d效果图里,动态显示门的开和关,
QQ截图20230711123144.jpg
回复

使用道具 举报

35

主题

372

帖子

2263

积分

金牌会员

Rank: 6Rank: 6

积分
2263
金钱
1891
HASS币
10
发表于 2023-7-11 14:23:20 | 显示全部楼层
本帖最后由 lexcao 于 2023-7-11 14:25 编辑
entities:
  - entity: <a on/off  entity>
    type3d: door
    object_id: <an object or object_group id representing the door>
    door:
      doortype: <'slide' for sliding doors/windows, 'swing' for swinging doors windows>
      side: 'up', 'down', 'left' and 'right', the border of the door that is the axis of rotation
      direction: 'inner' and 'outer', the direction of rotation
      hinge: the object_id of the door/window hinge
      pane: the object_id of the pane (main component) of the door/window
      degrees: the degrees of the door opening
a door/window object/entity is rotated by the sepcified degrees (swing) or slid (slide) along the axis defined in 'side' and the direction defined in 'direction'. You can use the object group to list the moving objects of the door. If you do that you can now select the hinge object or the pane object. When you select the hinge object only the direction parameter is used as the side and axix of rotation are bound to the hinge position and shape. Time allowing I will try to do a tutorial. It is getting complex.....
Different cases here:
For a Swing door:
TypeDirectionSideDegreesComment
hinge object specifiedxx-
pane object specifiedxxx-
no object specifiedxxxthe object_id is taken as a pane or the first object of the group
For a slide door (only pane object):
TypeDirectionSidePercentageComment
pane object specifiedxxx-
no pane object specifiedxxxthe object_id is taken as a pane or the first object of the group
Example of configuration for a window (Double French Window) exported using the ExportToHass plugin:
The entity section:
- entity: your_domain.your_door_entity
  object_id: <WindowDiningRoomLeft>
  type3d: door
  door:
    doortype: swing
    direction: inner
    degrees: '50'
    hinge: WindowDiningRoomLeft_4

And the related object group:
- object_group: WindowDiningRoomLeft
  objects:
    - object_id: WindowDiningRoomLeft_7
    - object_id: WindowDiningRoomLeft_6
    - object_id: WindowDiningRoomLeft_5




回复

使用道具 举报

110

主题

1621

帖子

5110

积分

元老级技术达人

积分
5110
金钱
3484
HASS币
30
 楼主| 发表于 2023-7-11 14:53:50 | 显示全部楼层
lexcao 发表于 2023-7-11 14:23
a door/window object/entity is rotated by the sepcified degrees (swing) or slid (slide) along the ax ...

还是没有理解,所以我才问的,
回复

使用道具 举报

35

主题

372

帖子

2263

积分

金牌会员

Rank: 6Rank: 6

积分
2263
金钱
1891
HASS币
10
发表于 2023-7-11 15:04:35 | 显示全部楼层
bugensui 发表于 2023-7-11 14:53
还是没有理解,所以我才问的,

hinge: the object_id of the door/window hinge
pane: the object_id of the pane (main component) of the door/window
degrees: the degrees of the door opening

第一段各个object_id搞清楚了就可以了。
设置实在太复杂,对显示硬件的要求也高,哎。
回复

使用道具 举报

110

主题

1621

帖子

5110

积分

元老级技术达人

积分
5110
金钱
3484
HASS币
30
 楼主| 发表于 2023-7-11 15:19:19 | 显示全部楼层
lexcao 发表于 2023-7-11 15:04
hinge: the object_id of the door/window hinge
pane: the object_id of the pane (main component) of  ...

object_id在ha前端页面就能获取,关键是怎么判断开门和关门呢,我的3d视图里,做的是关门,是把这块在3d软件留空,通过代码叠加?你有搞明白不
回复

使用道具 举报

35

主题

372

帖子

2263

积分

金牌会员

Rank: 6Rank: 6

积分
2263
金钱
1891
HASS币
10
发表于 2023-7-11 20:09:45 | 显示全部楼层
把铰链、门板和开门角度分别定义好。这里说的object_id都是不一样的
回复

使用道具 举报

110

主题

1621

帖子

5110

积分

元老级技术达人

积分
5110
金钱
3484
HASS币
30
 楼主| 发表于 2023-7-11 21:21:20 | 显示全部楼层
lexcao 发表于 2023-7-11 20:09
把铰链、门板和开门角度分别定义好。这里说的object_id都是不一样的

有参考代码吗,实在不知道是怎么个流程
回复

使用道具 举报

0

主题

45

帖子

477

积分

中级会员

Rank: 3Rank: 3

积分
477
金钱
432
HASS币
0
发表于 2023-7-25 00:38:30 | 显示全部楼层
本帖最后由 z00000000 于 2023-7-25 00:40 编辑

  - entity: binary_sensor.0x00158d0001d35406_contact
    type3d: door    门窗转动或推拉
    door:
      doortype: swing  摆动swing或滑动slide
      side: right    方向'up', 'down', 'left' and 'right
      direction: inner  内外outer
      degrees: '60'      角度
      pane: 窗玻璃object_id
      hinge: null 铰链object_id
    object_id: asweethome3d_opening_on_hinge_1_door_292
   
    action: more-info   点击动作
回复

使用道具 举报

0

主题

45

帖子

477

积分

中级会员

Rank: 3Rank: 3

积分
477
金钱
432
HASS币
0
发表于 2023-7-25 00:40:58 | 显示全部楼层
本帖最后由 z00000000 于 2023-7-25 00:49 编辑

  - entity: binary_sensor.0x00158d0001d35406_contact
    type3d: door
    door:
      doortype: swing
      side: right
      direction: inner
      degrees: '60'
      hinge: null
    object_id: asweethome3d_opening_on_hinge_1_door_313
    action: more-info

回复

使用道具 举报

110

主题

1621

帖子

5110

积分

元老级技术达人

积分
5110
金钱
3484
HASS币
30
 楼主| 发表于 2023-7-25 01:22:13 | 显示全部楼层
本帖最后由 bugensui 于 2023-7-25 12:50 编辑

测试了。报错,麻烦大佬指导下
Uncaught Error
    at floor3d-card.js:2356:4523
    at Object.onLoad (floor3d-card.js:2231:531795)
    at XMLHttpRequest.<anonymous> (floor3d-card.js:2231:435962)
Error: Object issue for Entity: <binary_sensor.lumi_lumi_sensor_magnet_aq2_opening> TypeError: Cannot read properties of undefined (reading 'objects')


TypeError: Cannot read properties of undefined (reading 'objects')


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-15 01:49 , Processed in 0.519749 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表